| 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;
|
|
|
|
|