Index: src/type-info.cc |
=================================================================== |
--- src/type-info.cc (revision 9754) |
+++ src/type-info.cc (working copy) |
@@ -504,61 +504,56 @@ |
void TypeFeedbackOracle::ProcessRelocInfos(ZoneList<RelocInfo>* infos) { |
for (int i = 0; i < infos->length(); i++) { |
- Address target_address = (*infos)[i].target_address(); |
+ RelocInfo reloc_entry = (*infos)[i]; |
+ Address target_address = reloc_entry.target_address(); |
unsigned ast_id = static_cast<unsigned>((*infos)[i].data()); |
- ProcessTargetAt(target_address, ast_id); |
- } |
-} |
+ Code* target = Code::GetCodeFromTargetAddress(target_address); |
+ switch (target->kind()) { |
+ case Code::LOAD_IC: |
+ case Code::STORE_IC: |
+ case Code::CALL_IC: |
+ case Code::KEYED_CALL_IC: |
+ if (target->ic_state() == MONOMORPHIC) { |
+ if (target->kind() == Code::CALL_IC && |
+ target->check_type() != RECEIVER_MAP_CHECK) { |
+ SetInfo(ast_id, Smi::FromInt(target->check_type())); |
+ } else { |
+ Object* map = target->FindFirstMap(); |
+ SetInfo(ast_id, map == NULL ? static_cast<Object*>(target) : map); |
+ } |
+ } else if (target->ic_state() == MEGAMORPHIC) { |
+ SetInfo(ast_id, target); |
+ } |
+ break; |
- |
-void TypeFeedbackOracle::ProcessTargetAt(Address target_address, |
- unsigned ast_id) { |
- Code* target = Code::GetCodeFromTargetAddress(target_address); |
- switch (target->kind()) { |
- case Code::LOAD_IC: |
- case Code::STORE_IC: |
- case Code::CALL_IC: |
- case Code::KEYED_CALL_IC: |
- if (target->ic_state() == MONOMORPHIC) { |
- if (target->kind() == Code::CALL_IC && |
- target->check_type() != RECEIVER_MAP_CHECK) { |
- SetInfo(ast_id, Smi::FromInt(target->check_type())); |
- } else { |
- Object* map = target->FindFirstMap(); |
- SetInfo(ast_id, map == NULL ? static_cast<Object*>(target) : map); |
+ case Code::KEYED_LOAD_IC: |
+ case Code::KEYED_STORE_IC: |
+ if (target->ic_state() == MONOMORPHIC || |
+ target->ic_state() == MEGAMORPHIC) { |
+ SetInfo(ast_id, target); |
} |
- } else if (target->ic_state() == MEGAMORPHIC) { |
- SetInfo(ast_id, target); |
- } |
- break; |
+ break; |
- case Code::KEYED_LOAD_IC: |
- case Code::KEYED_STORE_IC: |
- if (target->ic_state() == MONOMORPHIC || |
- target->ic_state() == MEGAMORPHIC) { |
+ case Code::UNARY_OP_IC: |
+ case Code::BINARY_OP_IC: |
+ case Code::COMPARE_IC: |
+ case Code::TO_BOOLEAN_IC: |
SetInfo(ast_id, target); |
- } |
- break; |
+ break; |
- case Code::UNARY_OP_IC: |
- case Code::BINARY_OP_IC: |
- case Code::COMPARE_IC: |
- case Code::TO_BOOLEAN_IC: |
- SetInfo(ast_id, target); |
- break; |
- |
- case Code::STUB: |
- if (target->major_key() == CodeStub::CallFunction && |
- target->has_function_cache()) { |
- Object* value = CallFunctionStub::GetCachedValue(target_address); |
- if (value->IsJSFunction()) { |
- SetInfo(ast_id, value); |
+ case Code::STUB: |
+ if (target->major_key() == CodeStub::CallFunction && |
+ target->has_function_cache()) { |
+ Object* value = CallFunctionStub::GetCachedValue(reloc_entry.pc()); |
+ if (value->IsJSFunction()) { |
+ SetInfo(ast_id, value); |
+ } |
} |
- } |
- break; |
+ break; |
- default: |
- break; |
+ default: |
+ break; |
+ } |
} |
} |