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

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 1086873003: Array() in optimized code can create with wrong ElementsKind in corner cases. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments and test failure. Created 5 years, 8 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/hydrogen-instructions.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 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/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 3959 matching lines...) Expand 10 before | Expand all | Expand 10 after
3970 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); 3970 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
3971 } 3971 }
3972 3972
3973 3973
3974 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { 3974 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
3975 DCHECK(ToRegister(instr->context()).is(esi)); 3975 DCHECK(ToRegister(instr->context()).is(esi));
3976 DCHECK(ToRegister(instr->constructor()).is(edi)); 3976 DCHECK(ToRegister(instr->constructor()).is(edi));
3977 DCHECK(ToRegister(instr->result()).is(eax)); 3977 DCHECK(ToRegister(instr->result()).is(eax));
3978 3978
3979 __ Move(eax, Immediate(instr->arity())); 3979 __ Move(eax, Immediate(instr->arity()));
3980 __ mov(ebx, isolate()->factory()->undefined_value()); 3980 if (instr->arity() == 1) {
3981 // We only need the allocation site for the case we have a length argument.
3982 // The case may bail out to the runtime, which will determine the correct
3983 // elements kind with the site.
3984 __ mov(ebx, instr->hydrogen()->site());
3985 } else {
3986 __ mov(ebx, isolate()->factory()->undefined_value());
3987 }
3988
3981 ElementsKind kind = instr->hydrogen()->elements_kind(); 3989 ElementsKind kind = instr->hydrogen()->elements_kind();
3982 AllocationSiteOverrideMode override_mode = 3990 AllocationSiteOverrideMode override_mode =
3983 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) 3991 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
3984 ? DISABLE_ALLOCATION_SITES 3992 ? DISABLE_ALLOCATION_SITES
3985 : DONT_OVERRIDE; 3993 : DONT_OVERRIDE;
3986 3994
3987 if (instr->arity() == 0) { 3995 if (instr->arity() == 0) {
3988 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); 3996 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode);
3989 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); 3997 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
3990 } else if (instr->arity() == 1) { 3998 } else if (instr->arity() == 1) {
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after
5736 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5744 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5737 RecordSafepoint(Safepoint::kNoLazyDeopt); 5745 RecordSafepoint(Safepoint::kNoLazyDeopt);
5738 } 5746 }
5739 5747
5740 5748
5741 #undef __ 5749 #undef __
5742 5750
5743 } } // namespace v8::internal 5751 } } // namespace v8::internal
5744 5752
5745 #endif // V8_TARGET_ARCH_IA32 5753 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698