comparison src/share/vm/graal/graalJavaAccess.cpp @ 4181:319860ae697a

Simplify FrameMap: make offsets of spill slots and outgoing parameters independent so that they can be allocated at the same time, eliminating the separate phases. This makes the separate StackBlock unnecesary. Change CiStackSlot to use byte offsets instead of spill slot index. This makes CiTarget.spillSlotSize unnecessary.
author Christian Wimmer <Christian.Wimmer@Oracle.com>
date Mon, 02 Jan 2012 14:16:08 -0800
parents a59727158259
children 511612d1b5c1
comparison
equal deleted inserted replaced
4180:383c1272cd1f 4181:319860ae697a
1 /* 1 /*
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
29 // It looks up the name and signature symbols without creating new ones, all the symbols of these classes need to be already loaded. 29 // It looks up the name and signature symbols without creating new ones, all the symbols of these classes need to be already loaded.
30 30
31 void compute_offset(int &dest_offset, klassOop klass_oop, const char* name, const char* signature, bool static_field) { 31 void compute_offset(int &dest_offset, klassOop klass_oop, const char* name, const char* signature, bool static_field) {
32 Symbol* name_symbol = SymbolTable::probe(name, (int)strlen(name)); 32 Symbol* name_symbol = SymbolTable::probe(name, (int)strlen(name));
33 Symbol* signature_symbol = SymbolTable::probe(signature, (int)strlen(signature)); 33 Symbol* signature_symbol = SymbolTable::probe(signature, (int)strlen(signature));
34 #ifdef DEBUG 34 #ifndef PRODUCT
35 if (name_symbol == NULL) { 35 if (name_symbol == NULL) {
36 tty->print_cr("symbol with name %s was not found in symbol table (klass=%s)", name, klass_oop->klass_part()->name()->as_C_string()); 36 tty->print_cr("symbol with name %s was not found in symbol table (klass=%s)", name, klass_oop->klass_part()->name()->as_C_string());
37 } 37 }
38 #endif 38 #endif
39 assert(name_symbol != NULL, "symbol not found - class layout changed?"); 39 guarantee(name_symbol != NULL, "symbol not found - class layout changed?");
40 assert(signature_symbol != NULL, "symbol not found - class layout changed?"); 40 guarantee(signature_symbol != NULL, "symbol not found - class layout changed?");
41 41
42 instanceKlass* ik = instanceKlass::cast(klass_oop); 42 instanceKlass* ik = instanceKlass::cast(klass_oop);
43 fieldDescriptor fd; 43 fieldDescriptor fd;
44 if (!ik->find_field(name_symbol, signature_symbol, &fd)) { 44 if (!ik->find_field(name_symbol, signature_symbol, &fd)) {
45 ResourceMark rm; 45 ResourceMark rm;
46 tty->print_cr("Invalid layout of %s at %s", name_symbol->as_C_string(), ik->external_name()); 46 tty->print_cr("Invalid layout of %s at %s", name_symbol->as_C_string(), ik->external_name());
47 fatal("Invalid layout of preloaded class"); 47 fatal("Invalid layout of preloaded class");
48 } 48 }
49 assert(fd.is_static() == static_field, "static/instance mismatch"); 49 guarantee(fd.is_static() == static_field, "static/instance mismatch");
50 dest_offset = fd.offset(); 50 dest_offset = fd.offset();
51 } 51 }
52 52
53 // This piece of macro magic creates the contents of the graal_compute_offsets method that initializes the field indices of all the access classes. 53 // This piece of macro magic creates the contents of the graal_compute_offsets method that initializes the field indices of all the access classes.
54 54