| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/crankshaft/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
| (...skipping 4065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4076 __ LoadRoot(r5, Heap::kUndefinedValueRootIndex); | 4076 __ LoadRoot(r5, Heap::kUndefinedValueRootIndex); |
| 4077 } | 4077 } |
| 4078 ElementsKind kind = instr->hydrogen()->elements_kind(); | 4078 ElementsKind kind = instr->hydrogen()->elements_kind(); |
| 4079 AllocationSiteOverrideMode override_mode = | 4079 AllocationSiteOverrideMode override_mode = |
| 4080 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) | 4080 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) |
| 4081 ? DISABLE_ALLOCATION_SITES | 4081 ? DISABLE_ALLOCATION_SITES |
| 4082 : DONT_OVERRIDE; | 4082 : DONT_OVERRIDE; |
| 4083 | 4083 |
| 4084 if (instr->arity() == 0) { | 4084 if (instr->arity() == 0) { |
| 4085 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); | 4085 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); |
| 4086 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 4086 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 4087 } else if (instr->arity() == 1) { | 4087 } else if (instr->arity() == 1) { |
| 4088 Label done; | 4088 Label done; |
| 4089 if (IsFastPackedElementsKind(kind)) { | 4089 if (IsFastPackedElementsKind(kind)) { |
| 4090 Label packed_case; | 4090 Label packed_case; |
| 4091 // We might need a change here | 4091 // We might need a change here |
| 4092 // look at the first argument | 4092 // look at the first argument |
| 4093 __ LoadP(r8, MemOperand(sp, 0)); | 4093 __ LoadP(r8, MemOperand(sp, 0)); |
| 4094 __ cmpi(r8, Operand::Zero()); | 4094 __ cmpi(r8, Operand::Zero()); |
| 4095 __ beq(&packed_case); | 4095 __ beq(&packed_case); |
| 4096 | 4096 |
| 4097 ElementsKind holey_kind = GetHoleyElementsKind(kind); | 4097 ElementsKind holey_kind = GetHoleyElementsKind(kind); |
| 4098 ArraySingleArgumentConstructorStub stub(isolate(), holey_kind, | 4098 ArraySingleArgumentConstructorStub stub(isolate(), holey_kind, |
| 4099 override_mode); | 4099 override_mode); |
| 4100 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 4100 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 4101 __ b(&done); | 4101 __ b(&done); |
| 4102 __ bind(&packed_case); | 4102 __ bind(&packed_case); |
| 4103 } | 4103 } |
| 4104 | 4104 |
| 4105 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); | 4105 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); |
| 4106 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 4106 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 4107 __ bind(&done); | 4107 __ bind(&done); |
| 4108 } else { | 4108 } else { |
| 4109 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); | 4109 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); |
| 4110 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 4110 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 4111 } | 4111 } |
| 4112 } | 4112 } |
| 4113 | 4113 |
| 4114 | 4114 |
| 4115 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 4115 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
| 4116 CallRuntime(instr->function(), instr->arity(), instr); | 4116 CallRuntime(instr->function(), instr->arity(), instr); |
| 4117 } | 4117 } |
| 4118 | 4118 |
| 4119 | 4119 |
| 4120 void LCodeGen::DoStoreCodeEntry(LStoreCodeEntry* instr) { | 4120 void LCodeGen::DoStoreCodeEntry(LStoreCodeEntry* instr) { |
| (...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5992 __ Push(scope_info); | 5992 __ Push(scope_info); |
| 5993 __ push(ToRegister(instr->function())); | 5993 __ push(ToRegister(instr->function())); |
| 5994 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5994 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5995 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5995 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5996 } | 5996 } |
| 5997 | 5997 |
| 5998 | 5998 |
| 5999 #undef __ | 5999 #undef __ |
| 6000 } // namespace internal | 6000 } // namespace internal |
| 6001 } // namespace v8 | 6001 } // namespace v8 |
| OLD | NEW |