# HG changeset patch # User Gilles Duboscq # Date 1398172358 -7200 # Node ID 29e3ba750c9ea3d2544418919f34a10c497f0752 # Parent 0b25b81414c926c0b577e2010d8c4d77b83d7d05 graalCodeInstaller translate BytecodeFrame::BEFORE_BCI into SynchronizationEntryBCI diff -r 0b25b81414c9 -r 29e3ba750c9e src/share/vm/graal/graalCodeInstaller.cpp --- a/src/share/vm/graal/graalCodeInstaller.cpp Tue Apr 22 17:38:21 2014 +0200 +++ b/src/share/vm/graal/graalCodeInstaller.cpp Tue Apr 22 15:12:38 2014 +0200 @@ -676,8 +676,11 @@ oop hotspot_method = BytecodePosition::method(frame); Method* method = getMethodFromHotSpotMethod(hotspot_method); jint bci = BytecodePosition::bci(frame); + if (bci == BytecodeFrame::BEFORE_BCI()) { + bci = SynchronizationEntryBCI; + } bool reexecute; - if (bci == -1 || bci == -2){ + if (bci == SynchronizationEntryBCI){ reexecute = false; } else { Bytecodes::Code code = Bytecodes::java_code_at(method, method->bcp_from(bci)); diff -r 0b25b81414c9 -r 29e3ba750c9e src/share/vm/graal/graalJavaAccess.cpp --- a/src/share/vm/graal/graalJavaAccess.cpp Tue Apr 22 17:38:21 2014 +0200 +++ b/src/share/vm/graal/graalJavaAccess.cpp Tue Apr 22 15:12:38 2014 +0200 @@ -59,10 +59,11 @@ #define FLOAT_FIELD(klass, name) FIELD(klass, name, "F", false) #define OOP_FIELD(klass, name, signature) FIELD(klass, name, signature, false) #define STATIC_OOP_FIELD(klass, name, signature) FIELD(klass, name, signature, true) +#define STATIC_INT_FIELD(klass, name) FIELD(klass, name, "I", true) void graal_compute_offsets() { - COMPILER_CLASSES_DO(START_CLASS, END_CLASS, CHAR_FIELD, INT_FIELD, BOOLEAN_FIELD, LONG_FIELD, FLOAT_FIELD, OOP_FIELD, STATIC_OOP_FIELD) + COMPILER_CLASSES_DO(START_CLASS, END_CLASS, CHAR_FIELD, INT_FIELD, BOOLEAN_FIELD, LONG_FIELD, FLOAT_FIELD, OOP_FIELD, STATIC_OOP_FIELD, STATIC_INT_FIELD) guarantee(InstalledCode::_address_offset == sizeof(oopDesc), "codeBlob must be first field!"); } @@ -72,7 +73,7 @@ #define FIELD2(klass, name) int klass::_##name##_offset = 0; #define FIELD3(klass, name, sig) FIELD2(klass, name) -COMPILER_CLASSES_DO(EMPTY1, EMPTY0, FIELD2, FIELD2, FIELD2, FIELD2, FIELD2, FIELD3, FIELD3) +COMPILER_CLASSES_DO(EMPTY1, EMPTY0, FIELD2, FIELD2, FIELD2, FIELD2, FIELD2, FIELD3, FIELD3, FIELD2) diff -r 0b25b81414c9 -r 29e3ba750c9e src/share/vm/graal/graalJavaAccess.hpp --- a/src/share/vm/graal/graalJavaAccess.hpp Tue Apr 22 17:38:21 2014 +0200 +++ b/src/share/vm/graal/graalJavaAccess.hpp Tue Apr 22 15:12:38 2014 +0200 @@ -47,7 +47,7 @@ * */ -#define COMPILER_CLASSES_DO(start_class, end_class, char_field, int_field, boolean_field, long_field, float_field, oop_field, static_oop_field) \ +#define COMPILER_CLASSES_DO(start_class, end_class, char_field, int_field, boolean_field, long_field, float_field, oop_field, static_oop_field, static_int_field) \ start_class(HotSpotResolvedObjectType) \ oop_field(HotSpotResolvedObjectType, javaClass, "Ljava/lang/Class;") \ end_class \ @@ -196,6 +196,7 @@ int_field(BytecodeFrame, numLocks) \ boolean_field(BytecodeFrame, rethrowException) \ boolean_field(BytecodeFrame, duringCall) \ + static_int_field(BytecodeFrame, BEFORE_BCI) \ end_class \ start_class(BytecodePosition) \ oop_field(BytecodePosition, caller, "Lcom/oracle/graal/api/code/BytecodePosition;") \ @@ -313,7 +314,19 @@ oop_store((oop*)addr, x); \ } \ } -COMPILER_CLASSES_DO(START_CLASS, END_CLASS, CHAR_FIELD, INT_FIELD, BOOLEAN_FIELD, LONG_FIELD, FLOAT_FIELD, OOP_FIELD, STATIC_OOP_FIELD) +#define STATIC_INT_FIELD(klassName, name) \ + static int _##name##_offset; \ + static int name() { \ + InstanceKlass* ik = InstanceKlass::cast(klassName::klass()); \ + address addr = ik->static_field_addr(_##name##_offset - InstanceMirrorKlass::offset_of_static_fields()); \ + return *((jint *)addr); \ + } \ + static void set_##name(int x) { \ + InstanceKlass* ik = InstanceKlass::cast(klassName::klass()); \ + address addr = ik->static_field_addr(_##name##_offset - InstanceMirrorKlass::offset_of_static_fields()); \ + *((jint *)addr) = x; \ + } +COMPILER_CLASSES_DO(START_CLASS, END_CLASS, CHAR_FIELD, INT_FIELD, BOOLEAN_FIELD, LONG_FIELD, FLOAT_FIELD, OOP_FIELD, STATIC_OOP_FIELD, STATIC_INT_FIELD) #undef START_CLASS #undef END_CLASS #undef FIELD @@ -324,6 +337,7 @@ #undef FLOAT_FIELD #undef OOP_FIELD #undef STATIC_OOP_FIELD +#undef STATIC_INT_FIELD void compute_offset(int &dest_offset, Klass* klass, const char* name, const char* signature, bool static_field);