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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/objects.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/ia32/lithium-codegen-ia32.h" 9 #include "src/ia32/lithium-codegen-ia32.h"
10 #include "src/ic.h" 10 #include "src/ic.h"
(...skipping 3857 matching lines...) Expand 10 before | Expand all | Expand 10 after
3868 CallFunctionStub stub(isolate(), arity, instr->hydrogen()->function_flags()); 3868 CallFunctionStub stub(isolate(), arity, instr->hydrogen()->function_flags());
3869 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 3869 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
3870 } 3870 }
3871 3871
3872 3872
3873 void LCodeGen::DoCallNew(LCallNew* instr) { 3873 void LCodeGen::DoCallNew(LCallNew* instr) {
3874 ASSERT(ToRegister(instr->context()).is(esi)); 3874 ASSERT(ToRegister(instr->context()).is(esi));
3875 ASSERT(ToRegister(instr->constructor()).is(edi)); 3875 ASSERT(ToRegister(instr->constructor()).is(edi));
3876 ASSERT(ToRegister(instr->result()).is(eax)); 3876 ASSERT(ToRegister(instr->result()).is(eax));
3877 3877
3878 // No cell in ebx for construct type feedback in optimized code 3878 HAllocationMode* mode = instr->hydrogen()->allocation_mode();
3879 __ mov(ebx, isolate()->factory()->undefined_value()); 3879 bool create_mementos = mode->CreateAllocationMementos();
3880 if (create_mementos) {
3881 __ mov(ebx, mode->feedback_site());
3882 } else {
3883 __ mov(ebx, isolate()->factory()->undefined_value());
3884 }
3880 CallConstructStub stub(isolate(), NO_CALL_CONSTRUCTOR_FLAGS); 3885 CallConstructStub stub(isolate(), NO_CALL_CONSTRUCTOR_FLAGS);
3881 __ Move(eax, Immediate(instr->arity())); 3886 __ Move(eax, Immediate(instr->arity()));
3882 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); 3887 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
3883 } 3888 }
3884 3889
3885 3890
3886 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { 3891 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
3887 ASSERT(ToRegister(instr->context()).is(esi)); 3892 ASSERT(ToRegister(instr->context()).is(esi));
3888 ASSERT(ToRegister(instr->constructor()).is(edi)); 3893 ASSERT(ToRegister(instr->constructor()).is(edi));
3889 ASSERT(ToRegister(instr->result()).is(eax)); 3894 ASSERT(ToRegister(instr->result()).is(eax));
3890 3895
3891 __ Move(eax, Immediate(instr->arity())); 3896 __ Move(eax, Immediate(instr->arity()));
3892 __ mov(ebx, isolate()->factory()->undefined_value()); 3897 HAllocationMode* mode = instr->hydrogen()->allocation_mode();
3898 bool create_mementos = mode->CreateAllocationMementos();
3899 if (create_mementos) {
3900 __ mov(ebx, mode->feedback_site());
3901 } else {
3902 __ mov(ebx, isolate()->factory()->undefined_value());
3903 }
3893 ElementsKind kind = instr->hydrogen()->elements_kind(); 3904 ElementsKind kind = instr->hydrogen()->elements_kind();
3894 AllocationSiteOverrideMode override_mode = 3905 AllocationSiteOverrideMode override_mode =
3895 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) 3906 (!create_mementos &&
3907 AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
3896 ? DISABLE_ALLOCATION_SITES 3908 ? DISABLE_ALLOCATION_SITES
3897 : DONT_OVERRIDE; 3909 : DONT_OVERRIDE;
3898 3910
3899 if (instr->arity() == 0) { 3911 if (instr->arity() == 0) {
3900 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); 3912 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode);
3901 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); 3913 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
3902 } else if (instr->arity() == 1) { 3914 } else if (instr->arity() == 1) {
3903 Label done; 3915 Label done;
3904 if (IsFastPackedElementsKind(kind)) { 3916 if (IsFastPackedElementsKind(kind)) {
3905 Label packed_case; 3917 Label packed_case;
(...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after
5642 __ bind(deferred->exit()); 5654 __ bind(deferred->exit());
5643 __ bind(&done); 5655 __ bind(&done);
5644 } 5656 }
5645 5657
5646 5658
5647 #undef __ 5659 #undef __
5648 5660
5649 } } // namespace v8::internal 5661 } } // namespace v8::internal
5650 5662
5651 #endif // V8_TARGET_ARCH_IA32 5663 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« 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