aboutsummaryrefslogtreecommitdiff
path: root/src/ic/ic-inl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ic/ic-inl.h')
-rw-r--r--src/ic/ic-inl.h38
1 files changed, 11 insertions, 27 deletions
diff --git a/src/ic/ic-inl.h b/src/ic/ic-inl.h
index 1b5d0632..aacb6909 100644
--- a/src/ic/ic-inl.h
+++ b/src/ic/ic-inl.h
@@ -7,6 +7,7 @@
#include "src/ic/ic.h"
+#include "src/assembler-inl.h"
#include "src/debug/debug.h"
#include "src/macro-assembler.h"
#include "src/prototype.h"
@@ -45,7 +46,10 @@ Code* IC::GetTargetAtAddress(Address address, Address constant_pool) {
// Convert target address to the code object. Code::GetCodeFromTargetAddress
// is safe for use during GC where the map might be marked.
Code* result = Code::GetCodeFromTargetAddress(target);
- DCHECK(result->is_inline_cache_stub());
+ // The result can be an IC dispatcher (for vector-based ICs), an IC handler
+ // (for old-style patching ICs) or CEntryStub (for IC dispatchers inlined to
+ // bytecode handlers).
+ DCHECK(result->is_inline_cache_stub() || result->is_stub());
return result;
}
@@ -54,25 +58,13 @@ void IC::SetTargetAtAddress(Address address, Code* target,
Address constant_pool) {
if (AddressIsDeoptimizedCode(target->GetIsolate(), address)) return;
- DCHECK(target->is_inline_cache_stub() || target->is_compare_ic_stub());
-
- DCHECK(!target->is_inline_cache_stub() ||
- (target->kind() != Code::LOAD_IC &&
- target->kind() != Code::KEYED_LOAD_IC &&
- target->kind() != Code::CALL_IC && target->kind() != Code::STORE_IC &&
- target->kind() != Code::KEYED_STORE_IC));
+ // Only these three old-style ICs still do code patching.
+ DCHECK(target->is_binary_op_stub() || target->is_compare_ic_stub() ||
+ target->is_to_boolean_ic_stub());
Heap* heap = target->GetHeap();
Code* old_target = GetTargetAtAddress(address, constant_pool);
-#ifdef DEBUG
- // STORE_IC and KEYED_STORE_IC use Code::extra_ic_state() to mark
- // ICs as language mode. The language mode of the IC must be preserved.
- if (old_target->kind() == Code::STORE_IC ||
- old_target->kind() == Code::KEYED_STORE_IC) {
- DCHECK(StoreICState::GetLanguageMode(old_target->extra_ic_state()) ==
- StoreICState::GetLanguageMode(target->extra_ic_state()));
- }
-#endif
+
Assembler::set_target_address_at(heap->isolate(), address, constant_pool,
target->instruction_start());
if (heap->gc_state() == Heap::MARK_COMPACT) {
@@ -93,8 +85,8 @@ Code* IC::target() const {
}
bool IC::IsHandler(Object* object) {
- return (object->IsSmi() && (object != nullptr)) || object->IsTuple3() ||
- object->IsFixedArray() ||
+ return (object->IsSmi() && (object != nullptr)) || object->IsTuple2() ||
+ object->IsTuple3() || object->IsFixedArray() ||
(object->IsCode() && Code::cast(object)->is_handler());
}
@@ -132,14 +124,6 @@ Handle<Map> IC::GetICCacheHolder(Handle<Map> map, Isolate* isolate,
}
-Code* IC::get_host() {
- return isolate()
- ->inner_pointer_to_code_cache()
- ->GetCacheEntry(address())
- ->code;
-}
-
-
bool IC::AddressIsDeoptimizedCode() const {
return AddressIsDeoptimizedCode(isolate(), address());
}