Mercurial > hg > graal-jvmci-8
comparison src/share/vm/interpreter/interpreter.cpp @ 7066:7d815d842ee0
Merge.
author | Christian Haeubl <haeubl@ssw.jku.at> |
---|---|
date | Fri, 23 Nov 2012 11:50:27 +0100 |
parents | 8c5333c80cfd e522a00b91aa |
children | 1baf7f1e3f23 |
comparison
equal
deleted
inserted
replaced
7065:cfacf5d5bade | 7066:7d815d842ee0 |
---|---|
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" |
58 void InterpreterCodelet::verify() { | 58 void InterpreterCodelet::verify() { |
59 } | 59 } |
60 | 60 |
61 | 61 |
62 void InterpreterCodelet::print_on(outputStream* st) const { | 62 void InterpreterCodelet::print_on(outputStream* st) const { |
63 ttyLocker ttyl; | |
63 if (PrintInterpreter || PrintMachineCodeToFile) { | 64 if (PrintInterpreter || PrintMachineCodeToFile) { |
65 | |
64 st->print_cr("----------------------------------------------------------------------"); | 66 st->print_cr("----------------------------------------------------------------------"); |
65 } | 67 } |
66 | 68 |
67 if (description() != NULL) st->print("%s ", description()); | 69 if (description() != NULL) st->print("%s ", description()); |
68 if (bytecode() >= 0 ) st->print("%d %s ", bytecode(), Bytecodes::name(bytecode())); | 70 if (bytecode() >= 0 ) st->print("%d %s ", bytecode(), Bytecodes::name(bytecode())); |
69 st->print_cr("[" INTPTR_FORMAT ", " INTPTR_FORMAT "] %d bytes", | 71 st->print_cr("[" INTPTR_FORMAT ", " INTPTR_FORMAT "] %d bytes", |
70 code_begin(), code_end(), code_size()); | 72 code_begin(), code_end(), code_size()); |
71 | 73 |
72 if (PrintInterpreter || PrintMachineCodeToFile) { | 74 if (PrintInterpreter || PrintMachineCodeToFile) { |
73 Disassembler::decode(code_begin(), code_end(), st); | 75 Disassembler::decode(code_begin(), code_end(), st, DEBUG_ONLY(_comments) NOT_DEBUG(CodeComments())); |
74 } | 76 } |
75 } | 77 } |
76 | 78 |
77 | 79 |
78 //------------------------------------------------------------------------------------------------------------------------ | 80 //------------------------------------------------------------------------------------------------------------------------ |
308 | 310 |
309 //------------------------------------------------------------------------------------------------------------------------ | 311 //------------------------------------------------------------------------------------------------------------------------ |
310 // Deoptimization support | 312 // Deoptimization support |
311 | 313 |
312 // 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 |
313 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) { |
314 assert(method->contains(bcp), "just checkin'"); | 316 assert(method->contains(bcp), "just checkin'"); |
315 Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); | 317 Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); |
316 assert(!Interpreter::bytecode_should_reexecute(code), "should not reexecute"); | 318 assert(!Interpreter::bytecode_should_reexecute(code), "should not reexecute"); |
317 int bci = method->bci_from(bcp); | 319 int bci = method->bci_from(bcp); |
318 int length = -1; // initial value for debugging | 320 int length = -1; // initial value for debugging |
346 type = Bytecode_invoke(mh, bci).result_type(); | 348 type = Bytecode_invoke(mh, bci).result_type(); |
347 // since the cache entry might not be initialized: | 349 // since the cache entry might not be initialized: |
348 // (NOT needed for the old calling convension) | 350 // (NOT needed for the old calling convension) |
349 if (!is_top_frame) { | 351 if (!is_top_frame) { |
350 int index = Bytes::get_native_u4(bcp+1); | 352 int index = Bytes::get_native_u4(bcp+1); |
351 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); |
352 } | 354 } |
353 break; | 355 break; |
354 } | 356 } |
355 | 357 |
356 case Bytecodes::_ldc : | 358 case Bytecodes::_ldc : |
378 | 380 |
379 // 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 |
380 // the bytecode. | 382 // the bytecode. |
381 // 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 |
382 // Interpreter::deopt_entry(vtos, 0) like others | 384 // Interpreter::deopt_entry(vtos, 0) like others |
383 address AbstractInterpreter::deopt_reexecute_entry(methodOop method, address bcp) { | 385 address AbstractInterpreter::deopt_reexecute_entry(Method* method, address bcp) { |
384 assert(method->contains(bcp), "just checkin'"); | 386 assert(method->contains(bcp), "just checkin'"); |
385 Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); | 387 Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); |
386 #ifdef COMPILER1 | 388 #ifdef COMPILER1 |
387 if(code == Bytecodes::_athrow ) { | 389 if(code == Bytecodes::_athrow ) { |
388 return Interpreter::rethrow_exception_entry(); | 390 return Interpreter::rethrow_exception_entry(); |
479 for (int pages = start_page; pages <= StackShadowPages ; pages++) { | 481 for (int pages = start_page; pages <= StackShadowPages ; pages++) { |
480 __ bang_stack_with_offset(pages*page_size); | 482 __ bang_stack_with_offset(pages*page_size); |
481 } | 483 } |
482 } | 484 } |
483 } | 485 } |
486 | |
487 void AbstractInterpreterGenerator::initialize_method_handle_entries() { | |
488 // method handle entry kinds are generated later in MethodHandlesAdapterGenerator::generate: | |
489 for (int i = Interpreter::method_handle_invoke_FIRST; i <= Interpreter::method_handle_invoke_LAST; i++) { | |
490 Interpreter::MethodKind kind = (Interpreter::MethodKind) i; | |
491 Interpreter::_entry_table[kind] = Interpreter::_entry_table[Interpreter::abstract]; | |
492 } | |
493 } |