Mercurial > hg > truffle
comparison src/cpu/x86/vm/sharedRuntime_x86_64.cpp @ 9112:6c33b2076d7c
minor HotSpot deoptimization cleanups
author | Christian Haeubl <haeubl@ssw.jku.at> |
---|---|
date | Mon, 08 Apr 2013 17:48:46 +0200 |
parents | b9a918201d47 |
children | 01958088b87d |
comparison
equal
deleted
inserted
replaced
8892:2c0c708a0ad6 | 9112:6c33b2076d7c |
---|---|
3328 // Normal deoptimization. Save exec mode for unpack_frames. | 3328 // Normal deoptimization. Save exec mode for unpack_frames. |
3329 __ movl(r14, Deoptimization::Unpack_deopt); // callee-saved | 3329 __ movl(r14, Deoptimization::Unpack_deopt); // callee-saved |
3330 __ jmp(cont); | 3330 __ jmp(cont); |
3331 | 3331 |
3332 int reexecute_offset = __ pc() - start; | 3332 int reexecute_offset = __ pc() - start; |
3333 #ifdef GRAALVM | |
3334 // Graal does not use this kind of deoptimization | |
3335 __ should_not_reach_here(); | |
3336 #endif | |
3333 | 3337 |
3334 // Reexecute case | 3338 // Reexecute case |
3335 // return address is the pc describes what bci to do re-execute at | 3339 // return address is the pc describes what bci to do re-execute at |
3336 | 3340 |
3337 // No need to update map as each call to save_live_registers will produce identical oopmap | 3341 // No need to update map as each call to save_live_registers will produce identical oopmap |
3338 (void) RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words); | 3342 (void) RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words); |
3339 | 3343 |
3340 __ movl(r14, Deoptimization::Unpack_reexecute); // callee-saved | 3344 __ movl(r14, Deoptimization::Unpack_reexecute); // callee-saved |
3341 __ jmp(cont); | 3345 __ jmp(cont); |
3346 | |
3347 #ifdef GRAAL | |
3348 int implicit_exception_uncommon_trap_offset = __ pc() - start; | |
3349 // pc where the exception happened is in ScratchA | |
3350 __ pushptr(Address(r15_thread, in_bytes(JavaThread::ScratchA_offset()))); | |
3351 | |
3352 int uncommon_trap_offset = __ pc() - start; | |
3353 | |
3354 // Save everything in sight. | |
3355 RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words); | |
3356 // fetch_unroll_info needs to call last_java_frame() | |
3357 __ set_last_Java_frame(noreg, noreg, NULL); | |
3358 | |
3359 __ movl(c_rarg1, Address(r15_thread, in_bytes(ThreadShadow::pending_deoptimization_offset()))); | |
3360 __ movl(Address(r15_thread, in_bytes(ThreadShadow::pending_deoptimization_offset())), -1); | |
3361 | |
3362 __ movl(r14, (int32_t)Deoptimization::Unpack_reexecute); | |
3363 __ mov(c_rarg0, r15_thread); | |
3364 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap))); | |
3365 oop_maps->add_gc_map( __ pc()-start, map->deep_copy()); | |
3366 | |
3367 __ reset_last_Java_frame(false, false); | |
3368 | |
3369 Label after_fetch_unroll_info_call; | |
3370 __ jmp(after_fetch_unroll_info_call); | |
3371 #endif // GRAAL | |
3342 | 3372 |
3343 int exception_offset = __ pc() - start; | 3373 int exception_offset = __ pc() - start; |
3344 | 3374 |
3345 // Prolog for exception case | 3375 // Prolog for exception case |
3346 | 3376 |
3393 __ testptr(rax, rax); | 3423 __ testptr(rax, rax); |
3394 __ jcc(Assembler::zero, no_pending_exception); | 3424 __ jcc(Assembler::zero, no_pending_exception); |
3395 __ stop("must not have pending exception here"); | 3425 __ stop("must not have pending exception here"); |
3396 __ bind(no_pending_exception); | 3426 __ bind(no_pending_exception); |
3397 #endif | 3427 #endif |
3398 | |
3399 #ifdef GRAAL | |
3400 __ jmp(cont); | |
3401 | |
3402 int implicit_exception_uncommon_trap_offset = __ pc() - start; | |
3403 // pc where the exception happened is in ScratchA | |
3404 __ pushptr(Address(r15_thread, in_bytes(JavaThread::ScratchA_offset()))); | |
3405 | |
3406 int uncommon_trap_offset = __ pc() - start; | |
3407 | |
3408 // Save everything in sight. | |
3409 RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words); | |
3410 // fetch_unroll_info needs to call last_java_frame() | |
3411 __ set_last_Java_frame(noreg, noreg, NULL); | |
3412 | |
3413 __ movl(c_rarg1, Address(r15_thread, in_bytes(ThreadShadow::pending_deoptimization_offset()))); | |
3414 __ movl(Address(r15_thread, in_bytes(ThreadShadow::pending_deoptimization_offset())), -1); | |
3415 | |
3416 __ movl(r14, (int32_t)Deoptimization::Unpack_reexecute); | |
3417 __ mov(c_rarg0, r15_thread); | |
3418 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap))); | |
3419 oop_maps->add_gc_map( __ pc()-start, map->deep_copy()); | |
3420 | |
3421 __ reset_last_Java_frame(false, false); | |
3422 | |
3423 Label after_fetch_unroll_info_call; | |
3424 __ jmp(after_fetch_unroll_info_call); | |
3425 #endif // GRAAL | |
3426 | 3428 |
3427 __ bind(cont); | 3429 __ bind(cont); |
3428 | 3430 |
3429 // Call C code. Need thread and this frame, but NOT official VM entry | 3431 // Call C code. Need thread and this frame, but NOT official VM entry |
3430 // crud. We cannot block on this call, no GC can happen. | 3432 // crud. We cannot block on this call, no GC can happen. |