OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |