| Index: src/stub-cache.cc
|
| diff --git a/src/stub-cache.cc b/src/stub-cache.cc
|
| index 755f39136d3f9efc085557fc53d401a9ed4bba67..13d547e4b5c68921ee774dbdc38ee5819c31d089 100644
|
| --- a/src/stub-cache.cc
|
| +++ b/src/stub-cache.cc
|
| @@ -301,7 +301,7 @@ Handle<Code> PropertyICCompiler::ComputeLoad(Isolate* isolate,
|
| int entry = cache->FindEntry(isolate, flags);
|
| if (entry != -1) return Handle<Code>(Code::cast(cache->ValueAt(entry)));
|
|
|
| - PropertyICCompiler compiler(isolate, Code::LOAD_IC);
|
| + PropertyICCompiler compiler(isolate, Code::LOAD_IC, extra_state);
|
| Handle<Code> code;
|
| if (ic_state == UNINITIALIZED) {
|
| code = compiler.CompileLoadInitialize(flags);
|
| @@ -317,6 +317,31 @@ Handle<Code> PropertyICCompiler::ComputeLoad(Isolate* isolate,
|
| }
|
|
|
|
|
| +Handle<Code> PropertyICCompiler::ComputeKeyedLoad(Isolate* isolate,
|
| + InlineCacheState ic_state,
|
| + ExtraICState extra_state) {
|
| + Code::Flags flags = Code::ComputeFlags(Code::KEYED_LOAD_IC, ic_state, extra_state);
|
| + Handle<UnseededNumberDictionary> cache =
|
| + isolate->factory()->non_monomorphic_cache();
|
| + int entry = cache->FindEntry(isolate, flags);
|
| + if (entry != -1) return Handle<Code>(Code::cast(cache->ValueAt(entry)));
|
| +
|
| + PropertyICCompiler compiler(isolate, Code::KEYED_LOAD_IC, extra_state);
|
| + Handle<Code> code;
|
| + if (ic_state == UNINITIALIZED) {
|
| + code = compiler.CompileKeyedLoadInitialize(flags);
|
| + } else if (ic_state == PREMONOMORPHIC) {
|
| + code = compiler.CompileKeyedLoadPreMonomorphic(flags);
|
| + } else if (ic_state == GENERIC) {
|
| + code = compiler.CompileKeyedLoadGeneric(flags);
|
| + } else {
|
| + UNREACHABLE();
|
| + }
|
| + FillCache(isolate, code);
|
| + return code;
|
| +}
|
| +
|
| +
|
| Handle<Code> PropertyICCompiler::ComputeStore(Isolate* isolate,
|
| InlineCacheState ic_state,
|
| ExtraICState extra_state) {
|
| @@ -665,9 +690,8 @@ Handle<Code> PropertyICCompiler::CompileLoadPreMonomorphic(Code::Flags flags) {
|
| return code;
|
| }
|
|
|
| -
|
| Handle<Code> PropertyICCompiler::CompileLoadMegamorphic(Code::Flags flags) {
|
| - LoadIC::GenerateMegamorphic(masm());
|
| + LoadIC::GenerateMegamorphic(masm(), extra_ic_state_);
|
| Handle<Code> code = GetCodeWithFlags(flags, "CompileLoadMegamorphic");
|
| PROFILE(isolate(),
|
| CodeCreateEvent(Logger::LOAD_MEGAMORPHIC_TAG, *code, 0));
|
| @@ -675,6 +699,33 @@ Handle<Code> PropertyICCompiler::CompileLoadMegamorphic(Code::Flags flags) {
|
| }
|
|
|
|
|
| +Handle<Code> PropertyICCompiler::CompileKeyedLoadInitialize(Code::Flags flags) {
|
| + KeyedLoadIC::GenerateInitialize(masm());
|
| + Handle<Code> code = GetCodeWithFlags(flags, "CompileKeyedLoadInitialize");
|
| + PROFILE(isolate(),
|
| + CodeCreateEvent(Logger::LOAD_INITIALIZE_TAG, *code, 0)); // todo
|
| + return code;
|
| +}
|
| +
|
| +
|
| +Handle<Code> PropertyICCompiler::CompileKeyedLoadPreMonomorphic(Code::Flags flags) {
|
| + KeyedLoadIC::GeneratePreMonomorphic(masm());
|
| + Handle<Code> code = GetCodeWithFlags(flags, "CompileKeyedLoadPreMonomorphic");
|
| + PROFILE(isolate(),
|
| + CodeCreateEvent(Logger::LOAD_PREMONOMORPHIC_TAG, *code, 0)); // todo
|
| + return code;
|
| +}
|
| +
|
| +
|
| +Handle<Code> PropertyICCompiler::CompileKeyedLoadGeneric(Code::Flags flags) {
|
| + KeyedLoadIC::GenerateGeneric(masm(), extra_ic_state_);
|
| + Handle<Code> code = GetCodeWithFlags(flags, "CompileKeyedGeneric");
|
| + PROFILE(isolate(),
|
| + CodeCreateEvent(Logger::LOAD_MEGAMORPHIC_TAG, *code, 0)); // todo
|
| + return code;
|
| +}
|
| +
|
| +
|
| Handle<Code> PropertyICCompiler::CompileStoreInitialize(Code::Flags flags) {
|
| StoreIC::GenerateInitialize(masm());
|
| Handle<Code> code = GetCodeWithFlags(flags, "CompileStoreInitialize");
|
|
|