1 /* |
1 /* |
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 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. |
30 #include "interpreter/interpreterRuntime.hpp" |
30 #include "interpreter/interpreterRuntime.hpp" |
31 #include "interpreter/templateTable.hpp" |
31 #include "interpreter/templateTable.hpp" |
32 #include "memory/allocation.inline.hpp" |
32 #include "memory/allocation.inline.hpp" |
33 #include "memory/resourceArea.hpp" |
33 #include "memory/resourceArea.hpp" |
34 #include "oops/arrayOop.hpp" |
34 #include "oops/arrayOop.hpp" |
35 #include "oops/methodDataOop.hpp" |
35 #include "oops/methodData.hpp" |
36 #include "oops/methodOop.hpp" |
36 #include "oops/method.hpp" |
37 #include "oops/oop.inline.hpp" |
37 #include "oops/oop.inline.hpp" |
38 #include "prims/forte.hpp" |
38 #include "prims/forte.hpp" |
39 #include "prims/jvmtiExport.hpp" |
39 #include "prims/jvmtiExport.hpp" |
40 #include "prims/methodHandles.hpp" |
40 #include "prims/methodHandles.hpp" |
41 #include "runtime/handles.inline.hpp" |
41 #include "runtime/handles.inline.hpp" |
310 |
310 |
311 //------------------------------------------------------------------------------------------------------------------------ |
311 //------------------------------------------------------------------------------------------------------------------------ |
312 // Deoptimization support |
312 // Deoptimization support |
313 |
313 |
314 // If deoptimization happens, this function returns the point of next bytecode to continue execution |
314 // If deoptimization happens, this function returns the point of next bytecode to continue execution |
315 address AbstractInterpreter::deopt_continue_after_entry(methodOop method, address bcp, int callee_parameters, bool is_top_frame) { |
315 address AbstractInterpreter::deopt_continue_after_entry(Method* method, address bcp, int callee_parameters, bool is_top_frame) { |
316 assert(method->contains(bcp), "just checkin'"); |
316 assert(method->contains(bcp), "just checkin'"); |
317 Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); |
317 Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); |
318 assert(!Interpreter::bytecode_should_reexecute(code), "should not reexecute"); |
318 assert(!Interpreter::bytecode_should_reexecute(code), "should not reexecute"); |
319 int bci = method->bci_from(bcp); |
319 int bci = method->bci_from(bcp); |
320 int length = -1; // initial value for debugging |
320 int length = -1; // initial value for debugging |
348 type = Bytecode_invoke(mh, bci).result_type(); |
348 type = Bytecode_invoke(mh, bci).result_type(); |
349 // since the cache entry might not be initialized: |
349 // since the cache entry might not be initialized: |
350 // (NOT needed for the old calling convension) |
350 // (NOT needed for the old calling convension) |
351 if (!is_top_frame) { |
351 if (!is_top_frame) { |
352 int index = Bytes::get_native_u4(bcp+1); |
352 int index = Bytes::get_native_u4(bcp+1); |
353 method->constants()->cache()->secondary_entry_at(index)->set_parameter_size(callee_parameters); |
353 method->constants()->invokedynamic_cp_cache_entry_at(index)->set_parameter_size(callee_parameters); |
354 } |
354 } |
355 break; |
355 break; |
356 } |
356 } |
357 |
357 |
358 case Bytecodes::_ldc : |
358 case Bytecodes::_ldc : |
380 |
380 |
381 // If deoptimization happens, this function returns the point where the interpreter reexecutes |
381 // If deoptimization happens, this function returns the point where the interpreter reexecutes |
382 // the bytecode. |
382 // the bytecode. |
383 // Note: Bytecodes::_athrow is a special case in that it does not return |
383 // Note: Bytecodes::_athrow is a special case in that it does not return |
384 // Interpreter::deopt_entry(vtos, 0) like others |
384 // Interpreter::deopt_entry(vtos, 0) like others |
385 address AbstractInterpreter::deopt_reexecute_entry(methodOop method, address bcp) { |
385 address AbstractInterpreter::deopt_reexecute_entry(Method* method, address bcp) { |
386 assert(method->contains(bcp), "just checkin'"); |
386 assert(method->contains(bcp), "just checkin'"); |
387 Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); |
387 Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); |
388 #ifdef COMPILER1 |
388 #ifdef COMPILER1 |
389 if(code == Bytecodes::_athrow ) { |
389 if(code == Bytecodes::_athrow ) { |
390 return Interpreter::rethrow_exception_entry(); |
390 return Interpreter::rethrow_exception_entry(); |