Reviewers: Yang,
Message:
Hi Yang,
PTAL, thx!
--Michael
Description:
PropertyICCompiler: expose monomorphic keyed load handler creation.
Simple refactoring that is useful for upcoming --vector-ic changes.
[email protected]
Please review this at https://codereview.chromium.org/673933005/
Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+17, -7 lines):
M src/ic/ic-compiler.h
M src/ic/ic-compiler.cc
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;
}
Index: src/ic/ic-compiler.h
diff --git a/src/ic/ic-compiler.h b/src/ic/ic-compiler.h
index
97c07d0ecaf65a55c110470cf07caf00a711b764..dd898aeed3c76e7585965fcc8dd0b89e375d5c33
100644
--- a/src/ic/ic-compiler.h
+++ b/src/ic/ic-compiler.h
@@ -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(
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.