Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/frame_x86.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 | 957c266d8bc5 da91efe96a93 |
children | 291ffc492eb6 |
comparison
equal
deleted
inserted
replaced
6711:ae13cc658b80 | 6948:e522a00b91aa |
---|---|
24 | 24 |
25 #include "precompiled.hpp" | 25 #include "precompiled.hpp" |
26 #include "interpreter/interpreter.hpp" | 26 #include "interpreter/interpreter.hpp" |
27 #include "memory/resourceArea.hpp" | 27 #include "memory/resourceArea.hpp" |
28 #include "oops/markOop.hpp" | 28 #include "oops/markOop.hpp" |
29 #include "oops/methodOop.hpp" | 29 #include "oops/method.hpp" |
30 #include "oops/oop.inline.hpp" | 30 #include "oops/oop.inline.hpp" |
31 #include "prims/methodHandles.hpp" | 31 #include "prims/methodHandles.hpp" |
32 #include "runtime/frame.inline.hpp" | 32 #include "runtime/frame.inline.hpp" |
33 #include "runtime/handles.inline.hpp" | 33 #include "runtime/handles.inline.hpp" |
34 #include "runtime/javaCalls.hpp" | 34 #include "runtime/javaCalls.hpp" |
497 } | 497 } |
498 | 498 |
499 | 499 |
500 bool frame::interpreter_frame_equals_unpacked_fp(intptr_t* fp) { | 500 bool frame::interpreter_frame_equals_unpacked_fp(intptr_t* fp) { |
501 assert(is_interpreted_frame(), "must be interpreter frame"); | 501 assert(is_interpreted_frame(), "must be interpreter frame"); |
502 methodOop method = interpreter_frame_method(); | 502 Method* method = interpreter_frame_method(); |
503 // When unpacking an optimized frame the frame pointer is | 503 // When unpacking an optimized frame the frame pointer is |
504 // adjusted with: | 504 // adjusted with: |
505 int diff = (method->max_locals() - method->size_of_parameters()) * | 505 int diff = (method->max_locals() - method->size_of_parameters()) * |
506 Interpreter::stackElementWords; | 506 Interpreter::stackElementWords; |
507 return _fp == (fp - diff); | 507 return _fp == (fp - diff); |
534 | 534 |
535 // do some validation of frame elements | 535 // do some validation of frame elements |
536 | 536 |
537 // first the method | 537 // first the method |
538 | 538 |
539 methodOop m = *interpreter_frame_method_addr(); | 539 Method* m = *interpreter_frame_method_addr(); |
540 | 540 |
541 // validate the method we'd find in this potential sender | 541 // validate the method we'd find in this potential sender |
542 if (!Universe::heap()->is_valid_method(m)) return false; | 542 if (!Universe::heap()->is_valid_method(m)) return false; |
543 | 543 |
544 // stack frames shouldn't be much larger than max_stack elements | 544 // stack frames shouldn't be much larger than max_stack elements |
552 intptr_t bcx = interpreter_frame_bcx(); | 552 intptr_t bcx = interpreter_frame_bcx(); |
553 if (m->validate_bci_from_bcx(bcx) < 0) { | 553 if (m->validate_bci_from_bcx(bcx) < 0) { |
554 return false; | 554 return false; |
555 } | 555 } |
556 | 556 |
557 // validate constantPoolCacheOop | 557 // validate ConstantPoolCache* |
558 | 558 ConstantPoolCache* cp = *interpreter_frame_cache_addr(); |
559 constantPoolCacheOop cp = *interpreter_frame_cache_addr(); | 559 if (cp == NULL || !cp->is_metadata()) return false; |
560 | |
561 if (cp == NULL || | |
562 !Space::is_aligned(cp) || | |
563 !Universe::heap()->is_permanent((void*)cp)) return false; | |
564 | 560 |
565 // validate locals | 561 // validate locals |
566 | 562 |
567 address locals = (address) *interpreter_frame_locals_addr(); | 563 address locals = (address) *interpreter_frame_locals_addr(); |
568 | 564 |
579 // Needed for JVMTI. The result should always be in the | 575 // Needed for JVMTI. The result should always be in the |
580 // interpreterState object | 576 // interpreterState object |
581 interpreterState istate = get_interpreterState(); | 577 interpreterState istate = get_interpreterState(); |
582 #endif // CC_INTERP | 578 #endif // CC_INTERP |
583 assert(is_interpreted_frame(), "interpreted frame expected"); | 579 assert(is_interpreted_frame(), "interpreted frame expected"); |
584 methodOop method = interpreter_frame_method(); | 580 Method* method = interpreter_frame_method(); |
585 BasicType type = method->result_type(); | 581 BasicType type = method->result_type(); |
586 | 582 |
587 intptr_t* tos_addr; | 583 intptr_t* tos_addr; |
588 if (method->is_native()) { | 584 if (method->is_native()) { |
589 // Prior to calling into the runtime to report the method_exit the possible | 585 // Prior to calling into the runtime to report the method_exit the possible |