Index: src/ic/ic-compiler.cc |
diff --git a/src/ic/ic-compiler.cc b/src/ic/ic-compiler.cc |
index 9ba566364bcaa0498ce915fa6bcfc7357f4d29d8..1f6eb4e0794777b90dfc239c930c3519335d3f2b 100644 |
--- a/src/ic/ic-compiler.cc |
+++ b/src/ic/ic-compiler.cc |
@@ -92,6 +92,20 @@ Handle<Code> PropertyICCompiler::ComputeKeyedLoadMonomorphic( |
Handle<Object> probe(receiver_map->FindInCodeCache(*name, flags), isolate); |
if (probe->IsCode()) return Handle<Code>::cast(probe); |
+ Handle<Code> stub = ComputeKeyedLoadMonomorphicHandler(receiver_map); |
+ PropertyICCompiler compiler(isolate, Code::KEYED_LOAD_IC); |
+ Handle<Code> code = |
+ compiler.CompileMonomorphic(HeapType::Class(receiver_map, isolate), stub, |
+ isolate->factory()->empty_string(), ELEMENT); |
+ |
+ Map::UpdateCodeCache(receiver_map, name, code); |
+ return code; |
+} |
+ |
+ |
+Handle<Code> PropertyICCompiler::ComputeKeyedLoadMonomorphicHandler( |
+ Handle<Map> receiver_map) { |
+ Isolate* isolate = receiver_map->GetIsolate(); |
ElementsKind elements_kind = receiver_map->elements_kind(); |
Handle<Code> stub; |
if (receiver_map->has_indexed_interceptor()) { |
@@ -110,13 +124,7 @@ Handle<Code> PropertyICCompiler::ComputeKeyedLoadMonomorphic( |
} else { |
stub = LoadDictionaryElementStub(isolate).GetCode(); |
} |
- PropertyICCompiler compiler(isolate, Code::KEYED_LOAD_IC); |
- Handle<Code> code = |
- compiler.CompileMonomorphic(HeapType::Class(receiver_map, isolate), stub, |
- isolate->factory()->empty_string(), ELEMENT); |
- |
- Map::UpdateCodeCache(receiver_map, name, code); |
- return code; |
+ return stub; |
} |