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

Unified Diff: src/ia32/lithium-codegen-ia32.cc

Issue 282093009: Emit mementos in crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
index 57190d75d8c5032e0dbce9008a5de2cd63f3da2d..0fb5370ec5355ce9fd2d1ef9d0ec18e441300b24 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -3875,8 +3875,13 @@ void LCodeGen::DoCallNew(LCallNew* instr) {
ASSERT(ToRegister(instr->constructor()).is(edi));
ASSERT(ToRegister(instr->result()).is(eax));
- // No cell in ebx for construct type feedback in optimized code
- __ mov(ebx, isolate()->factory()->undefined_value());
+ HAllocationMode* mode = instr->hydrogen()->allocation_mode();
+ bool create_mementos = mode->CreateAllocationMementos();
+ if (create_mementos) {
+ __ mov(ebx, mode->feedback_site());
+ } else {
+ __ mov(ebx, isolate()->factory()->undefined_value());
+ }
CallConstructStub stub(isolate(), NO_CALL_CONSTRUCTOR_FLAGS);
__ Move(eax, Immediate(instr->arity()));
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
@@ -3889,10 +3894,17 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
ASSERT(ToRegister(instr->result()).is(eax));
__ Move(eax, Immediate(instr->arity()));
- __ mov(ebx, isolate()->factory()->undefined_value());
+ HAllocationMode* mode = instr->hydrogen()->allocation_mode();
+ bool create_mementos = mode->CreateAllocationMementos();
+ if (create_mementos) {
+ __ mov(ebx, mode->feedback_site());
+ } else {
+ __ mov(ebx, isolate()->factory()->undefined_value());
+ }
ElementsKind kind = instr->hydrogen()->elements_kind();
AllocationSiteOverrideMode override_mode =
- (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
+ (!create_mementos &&
+ AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
? DISABLE_ALLOCATION_SITES
: DONT_OVERRIDE;
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698