Use hydrogenized KeyedLoadGeneric stub for generic named loads too (with...

Use hydrogenized KeyedLoadGeneric stub for generic named loads too (with --compiled-keyed-generic-loads).

R=danno@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22271 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ac8b6367
......@@ -607,9 +607,11 @@ MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<String> name) {
} else if (state() == PREMONOMORPHIC) {
FunctionPrototypeStub function_prototype_stub(isolate(), kind());
stub = function_prototype_stub.GetCode();
} else if (state() != MEGAMORPHIC) {
} else if (!FLAG_compiled_keyed_generic_loads && state() != MEGAMORPHIC) {
ASSERT(state() != GENERIC);
stub = megamorphic_stub();
} else if (FLAG_compiled_keyed_generic_loads && state() != GENERIC) {
stub = generic_stub();
}
if (!stub.is_null()) {
set_target(*stub);
......@@ -834,6 +836,10 @@ void IC::PatchCache(Handle<HeapType> type,
if (UpdatePolymorphicIC(type, name, code)) break;
CopyICToMegamorphicCache(name);
}
if (FLAG_compiled_keyed_generic_loads && (kind() == Code::LOAD_IC)) {
set_target(*generic_stub());
break;
}
set_target(*megamorphic_stub());
// Fall through.
case MEGAMORPHIC:
......@@ -865,6 +871,11 @@ Handle<Code> LoadIC::megamorphic_stub() {
}
Handle<Code> LoadIC::generic_stub() const {
return KeyedLoadGenericElementStub(isolate()).GetCode();
}
Handle<Code> LoadIC::SimpleFieldLoad(FieldIndex index) {
if (kind() == Code::LOAD_IC) {
LoadFieldStub stub(isolate(), index);
......
......@@ -464,6 +464,7 @@ class LoadIC: public IC {
}
virtual Handle<Code> megamorphic_stub();
virtual Handle<Code> generic_stub() const;
// Update the inline cache and the global stub cache based on the
// lookup result.
......
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