5 #ifndef V8_IC_IC_INL_H_ 6 #define V8_IC_IC_INL_H_ 10 #include "src/assembler-inl.h" 11 #include "src/debug/debug.h" 12 #include "src/frames-inl.h" 13 #include "src/handles-inl.h" 14 #include "src/prototype.h" 20 Address IC::address()
const {
22 return Assembler::target_address_from_return_address(pc());
26 Address IC::constant_pool()
const {
27 if (FLAG_enable_embedded_constant_pool) {
28 return raw_constant_pool();
35 Address IC::raw_constant_pool()
const {
36 if (FLAG_enable_embedded_constant_pool) {
37 return *constant_pool_address_;
43 void IC::update_receiver_map(Handle<Object> receiver) {
44 if (receiver->IsSmi()) {
45 receiver_map_ = isolate_->factory()->heap_number_map();
47 receiver_map_ = handle(HeapObject::cast(*receiver)->map(), isolate_);
51 bool IC::IsHandler(MaybeObject
object) {
52 HeapObject* heap_object;
53 return (object->IsSmi() && (
object.ptr() != kNullAddress)) ||
54 (
object->GetHeapObjectIfWeak(&heap_object) &&
55 (heap_object->IsMap() || heap_object->IsPropertyCell())) ||
56 (
object->GetHeapObjectIfStrong(&heap_object) &&
57 (heap_object->IsDataHandler() || heap_object->IsCode()));
60 bool IC::AddressIsDeoptimizedCode()
const {
61 return AddressIsDeoptimizedCode(isolate(), address());
65 bool IC::AddressIsDeoptimizedCode(Isolate* isolate, Address address) {
67 isolate->inner_pointer_to_code_cache()->GetCacheEntry(address)->code;
68 return (host->kind() == Code::OPTIMIZED_FUNCTION &&
69 host->marked_for_deoptimization());
72 bool IC::vector_needs_update() {
73 return (!vector_set_ &&
74 (state() != MEGAMORPHIC ||
75 nexus()->GetFeedbackExtra().ToSmi().value() != ELEMENT));
81 #endif // V8_IC_IC_INL_H_