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

Side by Side Diff: src/arm/lithium-codegen-arm.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 | « no previous file | src/arm64/lithium-codegen-arm64.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 #include "src/arm/lithium-codegen-arm.h" 7 #include "src/arm/lithium-codegen-arm.h"
8 #include "src/arm/lithium-gap-resolver-arm.h" 8 #include "src/arm/lithium-gap-resolver-arm.h"
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 4074 matching lines...) Expand 10 before | Expand all | Expand 10 after
4085 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); 4085 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
4086 } 4086 }
4087 4087
4088 4088
4089 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { 4089 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
4090 DCHECK(ToRegister(instr->context()).is(cp)); 4090 DCHECK(ToRegister(instr->context()).is(cp));
4091 DCHECK(ToRegister(instr->constructor()).is(r1)); 4091 DCHECK(ToRegister(instr->constructor()).is(r1));
4092 DCHECK(ToRegister(instr->result()).is(r0)); 4092 DCHECK(ToRegister(instr->result()).is(r0));
4093 4093
4094 __ mov(r0, Operand(instr->arity())); 4094 __ mov(r0, Operand(instr->arity()));
4095 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); 4095 if (instr->arity() == 1) {
4096 // We only need the allocation site for the case we have a length argument.
4097 // The case may bail out to the runtime, which will determine the correct
4098 // elements kind with the site.
4099 __ Move(r2, instr->hydrogen()->site());
4100 } else {
4101 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
4102 }
4096 ElementsKind kind = instr->hydrogen()->elements_kind(); 4103 ElementsKind kind = instr->hydrogen()->elements_kind();
4097 AllocationSiteOverrideMode override_mode = 4104 AllocationSiteOverrideMode override_mode =
4098 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) 4105 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
4099 ? DISABLE_ALLOCATION_SITES 4106 ? DISABLE_ALLOCATION_SITES
4100 : DONT_OVERRIDE; 4107 : DONT_OVERRIDE;
4101 4108
4102 if (instr->arity() == 0) { 4109 if (instr->arity() == 0) {
4103 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); 4110 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode);
4104 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); 4111 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
4105 } else if (instr->arity() == 1) { 4112 } else if (instr->arity() == 1) {
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after
5910 __ Push(scope_info); 5917 __ Push(scope_info);
5911 __ push(ToRegister(instr->function())); 5918 __ push(ToRegister(instr->function()));
5912 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5919 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5913 RecordSafepoint(Safepoint::kNoLazyDeopt); 5920 RecordSafepoint(Safepoint::kNoLazyDeopt);
5914 } 5921 }
5915 5922
5916 5923
5917 #undef __ 5924 #undef __
5918 5925
5919 } } // namespace v8::internal 5926 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698