comparison src/share/vm/graal/graalCodeInstaller.cpp @ 6948:e522a00b91aa

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author Doug Simon <doug.simon@oracle.com>
date Mon, 12 Nov 2012 23:14:12 +0100
parents fd71ca8c5f88
children 41938af2b3d8
comparison
equal deleted inserted replaced
6711:ae13cc658b80 6948:e522a00b91aa
41 XMMRegister XMM_REGS[] = { xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 }; 41 XMMRegister XMM_REGS[] = { xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 };
42 const static int NUM_XMM_REGS = sizeof(XMM_REGS) / sizeof(XMMRegister); 42 const static int NUM_XMM_REGS = sizeof(XMM_REGS) / sizeof(XMMRegister);
43 const static int NUM_REGS = NUM_CPU_REGS + NUM_XMM_REGS; 43 const static int NUM_REGS = NUM_CPU_REGS + NUM_XMM_REGS;
44 const static jlong NO_REF_MAP = 0x8000000000000000L; 44 const static jlong NO_REF_MAP = 0x8000000000000000L;
45 45
46 // convert graal register indices (as used in oop maps) to hotspot registers 46 // convert Graal register indices (as used in oop maps) to HotSpot registers
47 VMReg get_hotspot_reg(jint graal_reg) { 47 VMReg get_hotspot_reg(jint graal_reg) {
48 48
49 assert(graal_reg >= 0 && graal_reg < NUM_REGS, "invalid register number"); 49 assert(graal_reg >= 0 && graal_reg < NUM_REGS, "invalid register number");
50 if (graal_reg < NUM_CPU_REGS) { 50 if (graal_reg < NUM_CPU_REGS) {
51 return CPU_REGS[graal_reg]->as_VMReg(); 51 return CPU_REGS[graal_reg]->as_VMReg();
67 static int bitmap_size(oop bit_map) { 67 static int bitmap_size(oop bit_map) {
68 arrayOop arr = (arrayOop) GraalBitMap::words(bit_map); 68 arrayOop arr = (arrayOop) GraalBitMap::words(bit_map);
69 return arr->length() * MapWordBits; 69 return arr->length() * MapWordBits;
70 } 70 }
71 71
72 // creates a hotspot oop map out of the byte arrays provided by DebugInfo 72 // creates a HotSpot oop map out of the byte arrays provided by DebugInfo
73 static OopMap* create_oop_map(jint total_frame_size, jint parameter_count, oop debug_info) { 73 static OopMap* create_oop_map(jint total_frame_size, jint parameter_count, oop debug_info) {
74 OopMap* map = new OopMap(total_frame_size, parameter_count); 74 OopMap* map = new OopMap(total_frame_size, parameter_count);
75 oop register_map = (oop) DebugInfo::registerRefMap(debug_info); 75 oop register_map = (oop) DebugInfo::registerRefMap(debug_info);
76 oop frame_map = (oop) DebugInfo::frameRefMap(debug_info); 76 oop frame_map = (oop) DebugInfo::frameRefMap(debug_info);
77 77
88 } 88 }
89 } 89 }
90 90
91 for (jint i = 0; i < bitmap_size(frame_map); i++) { 91 for (jint i = 0; i < bitmap_size(frame_map); i++) {
92 bool is_oop = is_bit_set(frame_map, i); 92 bool is_oop = is_bit_set(frame_map, i);
93 // hotspot stack slots are 4 bytes 93 // HotSpot stack slots are 4 bytes
94 VMReg reg = VMRegImpl::stack2reg(i * 2); 94 VMReg reg = VMRegImpl::stack2reg(i * 2);
95 if (is_oop) { 95 if (is_oop) {
96 map->set_oop(reg); 96 map->set_oop(reg);
97 } else { 97 } else {
98 map->set_value(reg); 98 map->set_value(reg);
100 } 100 }
101 101
102 return map; 102 return map;
103 } 103 }
104 104
105 // TODO: finish this - graal doesn't provide any scope values at the moment
106 static ScopeValue* get_hotspot_value(oop value, int total_frame_size, GrowableArray<ScopeValue*>* objects, ScopeValue* &second) { 105 static ScopeValue* get_hotspot_value(oop value, int total_frame_size, GrowableArray<ScopeValue*>* objects, ScopeValue* &second) {
107 second = NULL; 106 second = NULL;
108 if (value == Value::ILLEGAL()) { 107 if (value == Value::ILLEGAL()) {
109 return new LocationValue(Location::new_stk_loc(Location::invalid, 0)); 108 return new LocationValue(Location::new_stk_loc(Location::invalid, 0));
110 } 109 }
177 } 176 }
178 tty->print("%i", type); 177 tty->print("%i", type);
179 } else if (value->is_a(VirtualObject::klass())) { 178 } else if (value->is_a(VirtualObject::klass())) {
180 oop type = VirtualObject::type(value); 179 oop type = VirtualObject::type(value);
181 int id = VirtualObject::id(value); 180 int id = VirtualObject::id(value);
182 klassOop klass = java_lang_Class::as_klassOop(HotSpotResolvedJavaType::javaMirror(type)); 181 oop javaMirror = HotSpotResolvedJavaType::javaMirror(type);
182 Klass* klass = java_lang_Class::as_Klass(javaMirror);
183 bool isLongArray = klass == Universe::longArrayKlassObj(); 183 bool isLongArray = klass == Universe::longArrayKlassObj();
184 184
185 for (jint i = 0; i < objects->length(); i++) { 185 for (jint i = 0; i < objects->length(); i++) {
186 ObjectValue* obj = (ObjectValue*) objects->at(i); 186 ObjectValue* obj = (ObjectValue*) objects->at(i);
187 if (obj->id() == id) { 187 if (obj->id() == id) {
188 return obj; 188 return obj;
189 } 189 }
190 } 190 }
191 191
192 ObjectValue* sv = new ObjectValue(id, new ConstantOopWriteValue(JNIHandles::make_local(Thread::current(), klass))); 192 ObjectValue* sv = new ObjectValue(id, new ConstantOopWriteValue(JNIHandles::make_local(Thread::current(), javaMirror)));
193 objects->append(sv); 193 objects->append(sv);
194 194
195 arrayOop values = (arrayOop) VirtualObject::values(value); 195 arrayOop values = (arrayOop) VirtualObject::values(value);
196 for (jint i = 0; i < values->length(); i++) { 196 for (jint i = 0; i < values->length(); i++) {
197 ScopeValue* cur_second = NULL; 197 ScopeValue* cur_second = NULL;
268 } 268 }
269 } 269 }
270 } 270 }
271 271
272 // constructor used to create a method 272 // constructor used to create a method
273 CodeInstaller::CodeInstaller(Handle& comp_result, nmethod*& nm, bool install_code) { 273 CodeInstaller::CodeInstaller(Handle& comp_result, methodHandle method, nmethod*& nm, bool bind_to_method) {
274 _env = CURRENT_ENV; 274 _env = CURRENT_ENV;
275 GraalCompiler::initialize_buffer_blob(); 275 GraalCompiler::initialize_buffer_blob();
276 CodeBuffer buffer(JavaThread::current()->get_buffer_blob()); 276 CodeBuffer buffer(JavaThread::current()->get_buffer_blob());
277 jobject comp_result_obj = JNIHandles::make_local(comp_result()); 277 jobject comp_result_obj = JNIHandles::make_local(comp_result());
278 jint entry_bci = HotSpotCompilationResult::entryBCI(comp_result);
279 initialize_assumptions(JNIHandles::resolve(comp_result_obj)); 278 initialize_assumptions(JNIHandles::resolve(comp_result_obj));
280 279
281 { 280 {
282 No_Safepoint_Verifier no_safepoint; 281 No_Safepoint_Verifier no_safepoint;
283 initialize_fields(JNIHandles::resolve(comp_result_obj)); 282 initialize_fields(JNIHandles::resolve(comp_result_obj), method);
284 initialize_buffer(buffer); 283 initialize_buffer(buffer);
285 process_exception_handlers(); 284 process_exception_handlers();
286 } 285 }
287 286
288 int stack_slots = _total_frame_size / HeapWordSize; // conversion to words 287 int stack_slots = _total_frame_size / HeapWordSize; // conversion to words
289 methodHandle method = getMethodFromHotSpotMethod(HotSpotCompilationResult::method(JNIHandles::resolve(comp_result_obj))); 288
290 289 nm = GraalEnv::register_method(method, -1, &_offsets, _custom_stack_area_offset, &buffer, stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table,
291 nm = GraalEnv::register_method(method, entry_bci, &_offsets, _custom_stack_area_offset, &buffer, stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table, 290 &_implicit_exception_table, GraalCompiler::instance(), _debug_recorder, _dependencies, NULL, -1, true, false, bind_to_method);
292 &_implicit_exception_table, GraalCompiler::instance(), _debug_recorder, _dependencies, NULL, -1, true, false, install_code);
293 291
294 method->clear_queued_for_compilation(); 292 method->clear_queued_for_compilation();
295 } 293 }
296 294
297 // constructor used to create a stub 295 // constructor used to create a stub
299 No_Safepoint_Verifier no_safepoint; 297 No_Safepoint_Verifier no_safepoint;
300 _env = CURRENT_ENV; 298 _env = CURRENT_ENV;
301 299
302 _oop_recorder = new OopRecorder(_env->arena()); 300 _oop_recorder = new OopRecorder(_env->arena());
303 _env->set_oop_recorder(_oop_recorder); 301 _env->set_oop_recorder(_oop_recorder);
304 initialize_fields(target_method()); 302 initialize_fields(target_method(), NULL);
305 assert(_hotspot_method == NULL && _name != NULL, "installMethod needs NON-NULL name and NULL method"); 303 assert(_name != NULL, "installMethod needs NON-NULL name");
306 304
307 // (very) conservative estimate: each site needs a relocation 305 // (very) conservative estimate: each site needs a relocation
308 GraalCompiler::initialize_buffer_blob(); 306 GraalCompiler::initialize_buffer_blob();
309 CodeBuffer buffer(JavaThread::current()->get_buffer_blob()); 307 CodeBuffer buffer(JavaThread::current()->get_buffer_blob());
310 initialize_buffer(buffer); 308 initialize_buffer(buffer);
313 blob = BufferBlob::create(strdup(cname), &buffer); // this is leaking strings... but only a limited number of stubs will be created 311 blob = BufferBlob::create(strdup(cname), &buffer); // this is leaking strings... but only a limited number of stubs will be created
314 IF_TRACE_graal_3 Disassembler::decode((CodeBlob*) blob); 312 IF_TRACE_graal_3 Disassembler::decode((CodeBlob*) blob);
315 id = VmIds::addStub(blob->code_begin()); 313 id = VmIds::addStub(blob->code_begin());
316 } 314 }
317 315
318 void CodeInstaller::initialize_fields(oop comp_result) { 316 void CodeInstaller::initialize_fields(oop comp_result, methodHandle method) {
319 _comp_result = HotSpotCompilationResult::comp(comp_result); 317 _comp_result = HotSpotCompilationResult::comp(comp_result);
320 _hotspot_method = HotSpotCompilationResult::method(comp_result); 318 if (!method.is_null()) {
321 if (_hotspot_method != NULL) {
322 methodOop method = getMethodFromHotSpotMethod(_hotspot_method);
323 _parameter_count = method->size_of_parameters(); 319 _parameter_count = method->size_of_parameters();
324 TRACE_graal_1("installing code for %s", method->name_and_sig_as_C_string()); 320 TRACE_graal_1("installing code for %s", method->name_and_sig_as_C_string());
325 } 321 }
326 _name = HotSpotCompilationResult::name(comp_result); 322 _name = HotSpotCompilationResult::name(comp_result);
327 _sites = (arrayOop) HotSpotCompilationResult::sites(comp_result); 323 _sites = (arrayOop) HotSpotCompilationResult::sites(comp_result);
385 } 381 }
386 382
387 void CodeInstaller::assumption_MethodContents(Handle assumption) { 383 void CodeInstaller::assumption_MethodContents(Handle assumption) {
388 Handle method_handle = Assumptions_MethodContents::method(assumption()); 384 Handle method_handle = Assumptions_MethodContents::method(assumption());
389 methodHandle method = getMethodFromHotSpotMethod(method_handle()); 385 methodHandle method = getMethodFromHotSpotMethod(method_handle());
390 ciMethod* m = (ciMethod*) CURRENT_ENV->get_object(method()); 386 ciMethod* m = (ciMethod*) CURRENT_ENV->get_method(method());
391 387
392 _dependencies->assert_evol_method(m); 388 _dependencies->assert_evol_method(m);
393 } 389 }
394 390
395 void CodeInstaller::assumption_ConcreteSubtype(Handle assumption) { 391 void CodeInstaller::assumption_ConcreteSubtype(Handle assumption) {
396 Handle context_handle = Assumptions_ConcreteSubtype::context(assumption()); 392 Handle context_handle = Assumptions_ConcreteSubtype::context(assumption());
397 ciKlass* context = (ciKlass*) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotResolvedJavaType::javaMirror(context_handle))); 393 ciKlass* context = (ciKlass*) CURRENT_ENV->get_klass(java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(context_handle)));
398 394
399 Handle type_handle = Assumptions_ConcreteSubtype::subtype(assumption()); 395 Handle type_handle = Assumptions_ConcreteSubtype::subtype(assumption());
400 ciKlass* type = (ciKlass*) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotResolvedJavaType::javaMirror(type_handle))); 396 ciKlass* type = (ciKlass*) CURRENT_ENV->get_klass(java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(type_handle)));
401 397
402 _dependencies->assert_leaf_type(type); 398 _dependencies->assert_leaf_type(type);
403 if (context != type) { 399 if (context != type) {
404 assert(context->is_abstract(), ""); 400 assert(context->is_abstract(), "");
405 _dependencies->assert_abstract_with_unique_concrete_subtype(context, type); 401 _dependencies->assert_abstract_with_unique_concrete_subtype(context, type);
407 } 403 }
408 404
409 void CodeInstaller::assumption_ConcreteMethod(Handle assumption) { 405 void CodeInstaller::assumption_ConcreteMethod(Handle assumption) {
410 Handle impl_handle = Assumptions_ConcreteMethod::impl(assumption()); 406 Handle impl_handle = Assumptions_ConcreteMethod::impl(assumption());
411 methodHandle impl = getMethodFromHotSpotMethod(impl_handle()); 407 methodHandle impl = getMethodFromHotSpotMethod(impl_handle());
412 ciMethod* m = (ciMethod*) CURRENT_ENV->get_object(impl()); 408 ciMethod* m = (ciMethod*) CURRENT_ENV->get_method(impl());
413 409
414 Handle context_handle = Assumptions_ConcreteMethod::context(assumption()); 410 Handle context_handle = Assumptions_ConcreteMethod::context(assumption());
415 ciKlass* context = (ciKlass*) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotResolvedJavaType::javaMirror(context_handle))); 411 ciKlass* context = (ciKlass*) CURRENT_ENV->get_klass(java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(context_handle)));
416 _dependencies->assert_unique_concrete_method(context, m); 412 _dependencies->assert_unique_concrete_method(context, m);
417 } 413 }
418 414
419 void CodeInstaller::process_exception_handlers() { 415 void CodeInstaller::process_exception_handlers() {
420 // allocate some arrays for use by the collection code. 416 // allocate some arrays for use by the collection code.
445 if (caller_frame != NULL) { 441 if (caller_frame != NULL) {
446 record_scope(pc_offset, caller_frame, objects); 442 record_scope(pc_offset, caller_frame, objects);
447 } 443 }
448 444
449 oop hotspot_method = BytecodePosition::method(frame); 445 oop hotspot_method = BytecodePosition::method(frame);
450 methodOop method = getMethodFromHotSpotMethod(hotspot_method); 446 Method* method = getMethodFromHotSpotMethod(hotspot_method);
451 jint bci = BytecodePosition::bci(frame); 447 jint bci = BytecodePosition::bci(frame);
452 bool reexecute; 448 bool reexecute;
453 if (bci == -1 || bci == -2){ 449 if (bci == -1 || bci == -2){
454 reexecute = false; 450 reexecute = false;
455 } else { 451 } else {
531 _debug_recorder->end_safepoint(pc_offset); 527 _debug_recorder->end_safepoint(pc_offset);
532 } 528 }
533 529
534 void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, oop site) { 530 void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, oop site) {
535 oop target = CompilationResult_Call::target(site); 531 oop target = CompilationResult_Call::target(site);
536 instanceKlass* target_klass = instanceKlass::cast(target->klass()); 532 InstanceKlass* target_klass = InstanceKlass::cast(target->klass());
537 533
538 oop hotspot_method = NULL; // JavaMethod 534 oop hotspot_method = NULL; // JavaMethod
539 oop global_stub = NULL; 535 oop global_stub = NULL;
540 536
541 if (target_klass->is_subclass_of(SystemDictionary::Long_klass())) { 537 if (target_klass->is_subclass_of(SystemDictionary::Long_klass())) {
568 } else { 564 } else {
569 tty->print_cr("at pc_offset %d", pc_offset); 565 tty->print_cr("at pc_offset %d", pc_offset);
570 fatal("unsupported type of instruction for call site"); 566 fatal("unsupported type of instruction for call site");
571 } 567 }
572 568
573 if (target->is_a(SystemDictionary::HotSpotCompiledMethod_klass())) { 569 if (target->is_a(SystemDictionary::HotSpotInstalledCode_klass())) {
574 assert(inst->is_jump(), "jump expected"); 570 assert(inst->is_jump(), "jump expected");
575 571
576 nmethod* nm = (nmethod*) HotSpotCompiledMethod::nmethod(target); 572 nmethod* nm = (nmethod*) HotSpotInstalledCode::nmethod(target);
577 nativeJump_at((address)inst)->set_jump_destination(nm->verified_entry_point()); 573 nativeJump_at((address)inst)->set_jump_destination(nm->verified_entry_point());
578 _instructions->relocate((address)inst, runtime_call_Relocation::spec(), Assembler::call32_operand); 574 _instructions->relocate((address)inst, runtime_call_Relocation::spec(), Assembler::call32_operand);
579 575
580 return; 576 return;
581 } 577 }
607 TRACE_graal_3("relocating (stub) at %016x", inst); 603 TRACE_graal_3("relocating (stub) at %016x", inst);
608 } else { // method != NULL 604 } else { // method != NULL
609 assert(hotspot_method != NULL, "unexpected JavaMethod"); 605 assert(hotspot_method != NULL, "unexpected JavaMethod");
610 assert(debug_info != NULL, "debug info expected"); 606 assert(debug_info != NULL, "debug info expected");
611 607
612 methodOop method = NULL; 608 Method* method = NULL;
613 // we need to check, this might also be an unresolved method 609 // we need to check, this might also be an unresolved method
614 if (hotspot_method->is_a(HotSpotResolvedJavaMethod::klass())) { 610 if (hotspot_method->is_a(HotSpotResolvedJavaMethod::klass())) {
615 method = getMethodFromHotSpotMethod(hotspot_method); 611 method = getMethodFromHotSpotMethod(hotspot_method);
616 } 612 }
617 613
700 } 696 }
701 case 'a': { 697 case 'a': {
702 address operand = Assembler::locate_operand(instruction, Assembler::imm_operand); 698 address operand = Assembler::locate_operand(instruction, Assembler::imm_operand);
703 Handle obj = Constant::object(constant); 699 Handle obj = Constant::object(constant);
704 700
705 if (obj->is_a(HotSpotKlassOop::klass())) { 701 jobject value = JNIHandles::make_local(obj());
706 assert(!obj.is_null(), ""); 702 *((jobject*) operand) = value;
707 oop type = HotSpotKlassOop::type(obj); 703 _instructions->relocate(instruction, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
708 klassOop klass = java_lang_Class::as_klassOop(HotSpotResolvedJavaType::javaMirror(type)); 704 TRACE_graal_3("relocating (oop constant) at %016x/%016x", instruction, operand);
709 *((jobject*) operand) = JNIHandles::make_local(klass);
710 _instructions->relocate(instruction, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
711 TRACE_graal_3("relocating (HotSpotJavaType) at %016x/%016x", instruction, operand);
712 } else {
713 jobject value = JNIHandles::make_local(obj());
714 *((jobject*) operand) = value;
715 _instructions->relocate(instruction, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
716 TRACE_graal_3("relocating (oop constant) at %016x/%016x", instruction, operand);
717 }
718 break; 705 break;
719 } 706 }
720 default: 707 default:
721 fatal("unexpected Kind in DataPatch"); 708 fatal("unexpected Kind in DataPatch");
722 break; 709 break;
752 case MARK_STATIC_CALL_STUB: { 739 case MARK_STATIC_CALL_STUB: {
753 assert(references->length() == 1, "static call stub needs one reference"); 740 assert(references->length() == 1, "static call stub needs one reference");
754 oop ref = ((oop*) references->base(T_OBJECT))[0]; 741 oop ref = ((oop*) references->base(T_OBJECT))[0];
755 address call_pc = _instructions->start() + CompilationResult_Site::pcOffset(ref); 742 address call_pc = _instructions->start() + CompilationResult_Site::pcOffset(ref);
756 _instructions->relocate(instruction, static_stub_Relocation::spec(call_pc)); 743 _instructions->relocate(instruction, static_stub_Relocation::spec(call_pc));
757 _instructions->relocate(instruction, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
758 break; 744 break;
759 } 745 }
760 case MARK_INVOKEVIRTUAL: 746 case MARK_INVOKEVIRTUAL:
761 case MARK_INVOKEINTERFACE: { 747 case MARK_INVOKEINTERFACE: {
762 // Convert the initial value of the klassOop slot in an inline cache 748 // Convert the initial value of the Klass* slot in an inline cache
763 // from NULL to Universe::non_oop_word(). 749 // from 0L to Universe::non_oop_word().
764 NativeMovConstReg* n_copy = nativeMovConstReg_at(instruction); 750 NativeMovConstReg* n_copy = nativeMovConstReg_at(instruction);
765 assert(n_copy->data() == 0, "inline cache klassOop initial value should be NULL"); 751 assert(n_copy->data() == 0, "inline cache Klass* initial value should be 0L");
766 n_copy->set_data((intptr_t)Universe::non_oop_word()); 752 n_copy->set_data((intptr_t)Universe::non_oop_word());
767 // Add relocation record for the klassOop embedded in the inline cache
768 _instructions->relocate(instruction, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
769 } 753 }
770 case MARK_INLINE_INVOKEVIRTUAL: 754 case MARK_INLINE_INVOKEVIRTUAL:
771 case MARK_INVOKE_INVALID: 755 case MARK_INVOKE_INVALID:
772 case MARK_INVOKESPECIAL: 756 case MARK_INVOKESPECIAL:
773 case MARK_INVOKESTATIC: 757 case MARK_INVOKESTATIC:
809 int i_byte_count = CompilationResult_Site::pcOffset(ref2) - CompilationResult_Site::pcOffset(ref1); 793 int i_byte_count = CompilationResult_Site::pcOffset(ref2) - CompilationResult_Site::pcOffset(ref1);
810 assert(i_byte_count == (unsigned char)i_byte_count, "invalid offset"); 794 assert(i_byte_count == (unsigned char)i_byte_count, "invalid offset");
811 *byte_count = i_byte_count; 795 *byte_count = i_byte_count;
812 *being_initialized_entry_offset = *byte_count + *byte_skip; 796 *being_initialized_entry_offset = *byte_count + *byte_skip;
813 797
814 // we need to correct the offset of a field access - it's created with MAX_INT to ensure the correct size, and hotspot expects 0 798 // we need to correct the offset of a field access - it's created with MAX_INT to ensure the correct size, and HotSpot expects 0
815 if (id == MARK_ACCESS_FIELD_PATCHING) { 799 if (id == MARK_ACCESS_FIELD_PATCHING) {
816 NativeMovRegMem* inst = nativeMovRegMem_at(_instructions->start() + CompilationResult_Site::pcOffset(ref1)); 800 NativeMovRegMem* inst = nativeMovRegMem_at(_instructions->start() + CompilationResult_Site::pcOffset(ref1));
817 assert(inst->offset() == max_jint, "unexpected offset value"); 801 assert(inst->offset() == max_jint, "unexpected offset value");
818 inst->set_offset(0); 802 inst->set_offset(0);
819 } 803 }