Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: src/ic/ic-compiler.cc

Issue 755513003: Hydrogen: fix keyed loads with string keys (Closed) Base URL: gh:v8/v8@master
Patch Set: fixes Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic/ic-compiler.h ('k') | src/type-info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic-compiler.cc
diff --git a/src/ic/ic-compiler.cc b/src/ic/ic-compiler.cc
index 1f6eb4e0794777b90dfc239c930c3519335d3f2b..7d1fa4645a8fc854687a9769a0651297cc12ce5c 100644
--- a/src/ic/ic-compiler.cc
+++ b/src/ic/ic-compiler.cc
@@ -63,6 +63,9 @@ Handle<Code> PropertyICCompiler::ComputeMonomorphic(
KeyedStoreIC::IcCheckTypeField::update(extra_ic_state, PROPERTY);
DCHECK(STANDARD_STORE ==
KeyedStoreIC::GetKeyedAccessStoreMode(extra_ic_state));
+ } else if (kind == Code::KEYED_LOAD_IC) {
+ extra_ic_state = KeyedLoadIC::IcCheckTypeField::update(extra_ic_state,
+ PROPERTY);
}
Handle<Code> ic;
@@ -84,16 +87,20 @@ Handle<Code> PropertyICCompiler::ComputeMonomorphic(
Handle<Code> PropertyICCompiler::ComputeKeyedLoadMonomorphic(
- Handle<Map> receiver_map) {
+ Handle<Map> receiver_map,
+ ExtraICState extra_ic_state) {
Jakob Kummerow 2014/12/12 10:14:27 If you insist on keeping this additional argument,
indutny 2014/12/12 13:05:37 I'd either need to pass this, or StrictMode to be
Jakob Kummerow 2014/12/12 13:34:16 Why do you need StrictMode? Loads don't depend on
Isolate* isolate = receiver_map->GetIsolate();
- Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC);
+ extra_ic_state = KeyedLoadIC::IcCheckTypeField::update(extra_ic_state,
+ ELEMENT);
+ Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC,
+ extra_ic_state);
Handle<Name> name = isolate->factory()->KeyedLoadMonomorphic_string();
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);
+ PropertyICCompiler compiler(isolate, Code::KEYED_LOAD_IC, extra_ic_state);
Handle<Code> code =
compiler.CompileMonomorphic(HeapType::Class(receiver_map, isolate), stub,
isolate->factory()->empty_string(), ELEMENT);
@@ -253,9 +260,14 @@ Handle<Code> PropertyICCompiler::ComputeCompareNil(Handle<Map> receiver_map,
// TODO(verwaest): Change this method so it takes in a TypeHandleList.
Handle<Code> PropertyICCompiler::ComputeKeyedLoadPolymorphic(
- MapHandleList* receiver_maps) {
+ MapHandleList* receiver_maps,
+ ExtraICState extra_ic_state) {
Isolate* isolate = receiver_maps->at(0)->GetIsolate();
- Code::Flags flags = Code::ComputeFlags(Code::KEYED_LOAD_IC, POLYMORPHIC);
+ extra_ic_state = KeyedLoadIC::IcCheckTypeField::update(extra_ic_state,
+ ELEMENT);
+ Code::Flags flags = Code::ComputeFlags(Code::KEYED_LOAD_IC,
+ POLYMORPHIC,
+ extra_ic_state);
Handle<PolymorphicCodeCache> cache =
isolate->factory()->polymorphic_code_cache();
Handle<Object> probe = cache->Lookup(receiver_maps, flags);
@@ -268,7 +280,7 @@ Handle<Code> PropertyICCompiler::ComputeKeyedLoadPolymorphic(
CodeHandleList handlers(receiver_maps->length());
ElementHandlerCompiler compiler(isolate);
compiler.CompileElementHandlers(receiver_maps, &handlers);
- PropertyICCompiler ic_compiler(isolate, Code::KEYED_LOAD_IC);
+ PropertyICCompiler ic_compiler(isolate, Code::KEYED_LOAD_IC, extra_ic_state);
Handle<Code> code = ic_compiler.CompilePolymorphic(
&types, &handlers, isolate->factory()->empty_string(), Code::NORMAL,
ELEMENT);
« no previous file with comments | « src/ic/ic-compiler.h ('k') | src/type-info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698