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

Side by Side Diff: src/ic/ic-compiler.cc

Issue 892383003: emit premonomorphic ics for loads/stores in optimized code (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « src/ic/ic-compiler.h ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/cpu-profiler.h" 7 #include "src/cpu-profiler.h"
8 #include "src/ic/handler-compiler.h" 8 #include "src/ic/handler-compiler.h"
9 #include "src/ic/ic-inl.h" 9 #include "src/ic/ic-inl.h"
10 #include "src/ic/ic-compiler.h" 10 #include "src/ic/ic-compiler.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 isolate->factory()->non_monomorphic_cache(); 190 isolate->factory()->non_monomorphic_cache();
191 int entry = cache->FindEntry(isolate, flags); 191 int entry = cache->FindEntry(isolate, flags);
192 if (entry != -1) return Handle<Code>(Code::cast(cache->ValueAt(entry))); 192 if (entry != -1) return Handle<Code>(Code::cast(cache->ValueAt(entry)));
193 193
194 PropertyICCompiler compiler(isolate, Code::LOAD_IC); 194 PropertyICCompiler compiler(isolate, Code::LOAD_IC);
195 Handle<Code> code; 195 Handle<Code> code;
196 if (ic_state == UNINITIALIZED) { 196 if (ic_state == UNINITIALIZED) {
197 code = compiler.CompileLoadInitialize(flags); 197 code = compiler.CompileLoadInitialize(flags);
198 } else if (ic_state == PREMONOMORPHIC) { 198 } else if (ic_state == PREMONOMORPHIC) {
199 code = compiler.CompileLoadPreMonomorphic(flags); 199 code = compiler.CompileLoadPreMonomorphic(flags);
200 } else if (ic_state == MEGAMORPHIC) {
201 code = compiler.CompileLoadMegamorphic(flags);
200 } else { 202 } else {
201 UNREACHABLE(); 203 UNREACHABLE();
202 } 204 }
203 FillCache(isolate, code); 205 FillCache(isolate, code);
204 return code; 206 return code;
205 } 207 }
206 208
207 209
208 Handle<Code> PropertyICCompiler::ComputeStore(Isolate* isolate, 210 Handle<Code> PropertyICCompiler::ComputeStore(Isolate* isolate,
209 InlineCacheState ic_state, 211 InlineCacheState ic_state,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 329
328 Handle<Code> PropertyICCompiler::CompileLoadPreMonomorphic(Code::Flags flags) { 330 Handle<Code> PropertyICCompiler::CompileLoadPreMonomorphic(Code::Flags flags) {
329 LoadIC::GeneratePreMonomorphic(masm()); 331 LoadIC::GeneratePreMonomorphic(masm());
330 Handle<Code> code = GetCodeWithFlags(flags, "CompileLoadPreMonomorphic"); 332 Handle<Code> code = GetCodeWithFlags(flags, "CompileLoadPreMonomorphic");
331 PROFILE(isolate(), 333 PROFILE(isolate(),
332 CodeCreateEvent(Logger::LOAD_PREMONOMORPHIC_TAG, *code, 0)); 334 CodeCreateEvent(Logger::LOAD_PREMONOMORPHIC_TAG, *code, 0));
333 return code; 335 return code;
334 } 336 }
335 337
336 338
339 Handle<Code> PropertyICCompiler::CompileLoadMegamorphic(Code::Flags flags) {
340 MegamorphicLoadStub stub(isolate(), LoadICState(extra_ic_state_));
341 auto code = stub.GetCode();
342 PROFILE(isolate(), CodeCreateEvent(Logger::LOAD_MEGAMORPHIC_TAG, *code, 0));
343 return code;
344 }
345
346
337 Handle<Code> PropertyICCompiler::CompileStoreInitialize(Code::Flags flags) { 347 Handle<Code> PropertyICCompiler::CompileStoreInitialize(Code::Flags flags) {
338 StoreIC::GenerateInitialize(masm()); 348 StoreIC::GenerateInitialize(masm());
339 Handle<Code> code = GetCodeWithFlags(flags, "CompileStoreInitialize"); 349 Handle<Code> code = GetCodeWithFlags(flags, "CompileStoreInitialize");
340 PROFILE(isolate(), CodeCreateEvent(Logger::STORE_INITIALIZE_TAG, *code, 0)); 350 PROFILE(isolate(), CodeCreateEvent(Logger::STORE_INITIALIZE_TAG, *code, 0));
341 return code; 351 return code;
342 } 352 }
343 353
344 354
345 Handle<Code> PropertyICCompiler::CompileStorePreMonomorphic(Code::Flags flags) { 355 Handle<Code> PropertyICCompiler::CompileStorePreMonomorphic(Code::Flags flags) {
346 StoreIC::GeneratePreMonomorphic(masm()); 356 StoreIC::GeneratePreMonomorphic(masm());
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 465
456 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss); 466 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss);
457 467
458 return GetCode(kind(), Code::NORMAL, factory()->empty_string()); 468 return GetCode(kind(), Code::NORMAL, factory()->empty_string());
459 } 469 }
460 470
461 471
462 #undef __ 472 #undef __
463 } 473 }
464 } // namespace v8::internal 474 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic/ic-compiler.h ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698