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

Side by Side Diff: src/mips64/lithium-codegen-mips64.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/mips/lithium-codegen-mips.cc ('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 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/cpu-profiler.h" 9 #include "src/cpu-profiler.h"
10 #include "src/hydrogen-osr.h" 10 #include "src/hydrogen-osr.h"
(...skipping 4111 matching lines...) Expand 10 before | Expand all | Expand 10 after
4122 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); 4122 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
4123 } 4123 }
4124 4124
4125 4125
4126 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { 4126 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
4127 DCHECK(ToRegister(instr->context()).is(cp)); 4127 DCHECK(ToRegister(instr->context()).is(cp));
4128 DCHECK(ToRegister(instr->constructor()).is(a1)); 4128 DCHECK(ToRegister(instr->constructor()).is(a1));
4129 DCHECK(ToRegister(instr->result()).is(v0)); 4129 DCHECK(ToRegister(instr->result()).is(v0));
4130 4130
4131 __ li(a0, Operand(instr->arity())); 4131 __ li(a0, Operand(instr->arity()));
4132 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); 4132 if (instr->arity() == 1) {
4133 // We only need the allocation site for the case we have a length argument.
4134 // The case may bail out to the runtime, which will determine the correct
4135 // elements kind with the site.
4136 __ li(a2, instr->hydrogen()->site());
4137 } else {
4138 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex);
4139 }
4133 ElementsKind kind = instr->hydrogen()->elements_kind(); 4140 ElementsKind kind = instr->hydrogen()->elements_kind();
4134 AllocationSiteOverrideMode override_mode = 4141 AllocationSiteOverrideMode override_mode =
4135 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) 4142 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
4136 ? DISABLE_ALLOCATION_SITES 4143 ? DISABLE_ALLOCATION_SITES
4137 : DONT_OVERRIDE; 4144 : DONT_OVERRIDE;
4138 4145
4139 if (instr->arity() == 0) { 4146 if (instr->arity() == 0) {
4140 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); 4147 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode);
4141 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); 4148 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
4142 } else if (instr->arity() == 1) { 4149 } else if (instr->arity() == 1) {
(...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after
6022 __ li(at, scope_info); 6029 __ li(at, scope_info);
6023 __ Push(at, ToRegister(instr->function())); 6030 __ Push(at, ToRegister(instr->function()));
6024 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6031 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6025 RecordSafepoint(Safepoint::kNoLazyDeopt); 6032 RecordSafepoint(Safepoint::kNoLazyDeopt);
6026 } 6033 }
6027 6034
6028 6035
6029 #undef __ 6036 #undef __
6030 6037
6031 } } // namespace v8::internal 6038 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698