PropertyICCompiler: expose monomorphic keyed load handler creation.

Simple refactoring that is useful for upcoming --vector-ic changes.

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/673933005

Cr-Commit-Position: refs/heads/master@{#24866}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24866 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 87f52869
......@@ -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;
}
......
......@@ -34,6 +34,8 @@ class PropertyICCompiler : public PropertyAccessCompiler {
ExtraICState extra_ic_state);
// Keyed
static Handle<Code> ComputeKeyedLoadMonomorphicHandler(
Handle<Map> receiver_map);
static Handle<Code> ComputeKeyedLoadMonomorphic(Handle<Map> receiver_map);
static Handle<Code> ComputeKeyedStoreMonomorphic(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment