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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" |
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 4138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4149 } | 4149 } |
4150 | 4150 |
4151 ElementsKind kind = instr->hydrogen()->elements_kind(); | 4151 ElementsKind kind = instr->hydrogen()->elements_kind(); |
4152 AllocationSiteOverrideMode override_mode = | 4152 AllocationSiteOverrideMode override_mode = |
4153 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) | 4153 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) |
4154 ? DISABLE_ALLOCATION_SITES | 4154 ? DISABLE_ALLOCATION_SITES |
4155 : DONT_OVERRIDE; | 4155 : DONT_OVERRIDE; |
4156 | 4156 |
4157 if (instr->arity() == 0) { | 4157 if (instr->arity() == 0) { |
4158 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); | 4158 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); |
4159 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 4159 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
4160 } else if (instr->arity() == 1) { | 4160 } else if (instr->arity() == 1) { |
4161 Label done; | 4161 Label done; |
4162 if (IsFastPackedElementsKind(kind)) { | 4162 if (IsFastPackedElementsKind(kind)) { |
4163 Label packed_case; | 4163 Label packed_case; |
4164 // We might need a change here | 4164 // We might need a change here |
4165 // look at the first argument | 4165 // look at the first argument |
4166 __ mov(ecx, Operand(esp, 0)); | 4166 __ mov(ecx, Operand(esp, 0)); |
4167 __ test(ecx, ecx); | 4167 __ test(ecx, ecx); |
4168 __ j(zero, &packed_case, Label::kNear); | 4168 __ j(zero, &packed_case, Label::kNear); |
4169 | 4169 |
4170 ElementsKind holey_kind = GetHoleyElementsKind(kind); | 4170 ElementsKind holey_kind = GetHoleyElementsKind(kind); |
4171 ArraySingleArgumentConstructorStub stub(isolate(), | 4171 ArraySingleArgumentConstructorStub stub(isolate(), |
4172 holey_kind, | 4172 holey_kind, |
4173 override_mode); | 4173 override_mode); |
4174 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 4174 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
4175 __ jmp(&done, Label::kNear); | 4175 __ jmp(&done, Label::kNear); |
4176 __ bind(&packed_case); | 4176 __ bind(&packed_case); |
4177 } | 4177 } |
4178 | 4178 |
4179 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); | 4179 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); |
4180 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 4180 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
4181 __ bind(&done); | 4181 __ bind(&done); |
4182 } else { | 4182 } else { |
4183 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); | 4183 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); |
4184 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 4184 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
4185 } | 4185 } |
4186 } | 4186 } |
4187 | 4187 |
4188 | 4188 |
4189 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 4189 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
4190 DCHECK(ToRegister(instr->context()).is(esi)); | 4190 DCHECK(ToRegister(instr->context()).is(esi)); |
4191 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles()); | 4191 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles()); |
4192 } | 4192 } |
4193 | 4193 |
4194 | 4194 |
(...skipping 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6149 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6149 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6150 } | 6150 } |
6151 | 6151 |
6152 | 6152 |
6153 #undef __ | 6153 #undef __ |
6154 | 6154 |
6155 } // namespace internal | 6155 } // namespace internal |
6156 } // namespace v8 | 6156 } // namespace v8 |
6157 | 6157 |
6158 #endif // V8_TARGET_ARCH_X87 | 6158 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |