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 3447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3458 Register target = ToRegister(instr->target()); | 3458 Register target = ToRegister(instr->target()); |
3459 generator.BeforeCall(__ CallSize(Operand(target))); | 3459 generator.BeforeCall(__ CallSize(Operand(target))); |
3460 __ add(target, Immediate(Code::kHeaderSize - kHeapObjectTag)); | 3460 __ add(target, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
3461 __ call(target); | 3461 __ call(target); |
3462 } | 3462 } |
3463 generator.AfterCall(); | 3463 generator.AfterCall(); |
3464 } | 3464 } |
3465 } | 3465 } |
3466 | 3466 |
3467 | 3467 |
3468 void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) { | |
3469 DCHECK(ToRegister(instr->function()).is(edi)); | |
3470 DCHECK(ToRegister(instr->result()).is(eax)); | |
3471 | |
3472 // Change context. | |
3473 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); | |
3474 | |
3475 // Always initialize new target and number of actual arguments. | |
3476 __ mov(edx, factory()->undefined_value()); | |
3477 __ mov(eax, instr->arity()); | |
3478 | |
3479 bool is_self_call = false; | |
3480 if (instr->hydrogen()->function()->IsConstant()) { | |
3481 HConstant* fun_const = HConstant::cast(instr->hydrogen()->function()); | |
3482 Handle<JSFunction> jsfun = | |
3483 Handle<JSFunction>::cast(fun_const->handle(isolate())); | |
3484 is_self_call = jsfun.is_identical_to(info()->closure()); | |
3485 } | |
3486 | |
3487 if (is_self_call) { | |
3488 __ CallSelf(); | |
3489 } else { | |
3490 __ call(FieldOperand(edi, JSFunction::kCodeEntryOffset)); | |
3491 } | |
3492 | |
3493 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | |
3494 } | |
3495 | |
3496 | |
3497 void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) { | 3468 void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) { |
3498 Register input_reg = ToRegister(instr->value()); | 3469 Register input_reg = ToRegister(instr->value()); |
3499 __ cmp(FieldOperand(input_reg, HeapObject::kMapOffset), | 3470 __ cmp(FieldOperand(input_reg, HeapObject::kMapOffset), |
3500 factory()->heap_number_map()); | 3471 factory()->heap_number_map()); |
3501 DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumber); | 3472 DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumber); |
3502 | 3473 |
3503 Label slow, allocated, done; | 3474 Label slow, allocated, done; |
3504 Register tmp = input_reg.is(eax) ? ecx : eax; | 3475 Register tmp = input_reg.is(eax) ? ecx : eax; |
3505 Register tmp2 = tmp.is(ecx) ? edx : input_reg.is(ecx) ? edx : ecx; | 3476 Register tmp2 = tmp.is(ecx) ? edx : input_reg.is(ecx) ? edx : ecx; |
3506 | 3477 |
(...skipping 2414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5921 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), context); | 5892 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), context); |
5922 } | 5893 } |
5923 | 5894 |
5924 | 5895 |
5925 #undef __ | 5896 #undef __ |
5926 | 5897 |
5927 } // namespace internal | 5898 } // namespace internal |
5928 } // namespace v8 | 5899 } // namespace v8 |
5929 | 5900 |
5930 #endif // V8_TARGET_ARCH_X87 | 5901 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |