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/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
8 #include "src/ast/compile-time-value.h" | 8 #include "src/ast/compile-time-value.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 2694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2705 __ mov(edi, Operand(esp, (argc + 1) * kPointerSize)); | 2705 __ mov(edi, Operand(esp, (argc + 1) * kPointerSize)); |
2706 // Call the target. | 2706 // Call the target. |
2707 __ mov(eax, Immediate(argc)); | 2707 __ mov(eax, Immediate(argc)); |
2708 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 2708 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
2709 OperandStackDepthDecrement(argc + 1); | 2709 OperandStackDepthDecrement(argc + 1); |
2710 RestoreContext(); | 2710 RestoreContext(); |
2711 // Discard the function left on TOS. | 2711 // Discard the function left on TOS. |
2712 context()->DropAndPlug(1, eax); | 2712 context()->DropAndPlug(1, eax); |
2713 } | 2713 } |
2714 | 2714 |
2715 | |
2716 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { | |
2717 ZoneList<Expression*>* args = expr->arguments(); | |
2718 DCHECK(args->length() == 1); | |
2719 | |
2720 VisitForAccumulatorValue(args->at(0)); | |
2721 | |
2722 __ AssertString(eax); | |
2723 | |
2724 Label materialize_true, materialize_false; | |
2725 Label* if_true = NULL; | |
2726 Label* if_false = NULL; | |
2727 Label* fall_through = NULL; | |
2728 context()->PrepareTest(&materialize_true, &materialize_false, | |
2729 &if_true, &if_false, &fall_through); | |
2730 | |
2731 __ test(FieldOperand(eax, String::kHashFieldOffset), | |
2732 Immediate(String::kContainsCachedArrayIndexMask)); | |
2733 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | |
2734 Split(zero, if_true, if_false, fall_through); | |
2735 | |
2736 context()->Plug(if_true, if_false); | |
2737 } | |
2738 | |
2739 | |
2740 void FullCodeGenerator::EmitGetCachedArrayIndex(CallRuntime* expr) { | |
2741 ZoneList<Expression*>* args = expr->arguments(); | |
2742 DCHECK(args->length() == 1); | |
2743 VisitForAccumulatorValue(args->at(0)); | |
2744 | |
2745 __ AssertString(eax); | |
2746 | |
2747 __ mov(eax, FieldOperand(eax, String::kHashFieldOffset)); | |
2748 __ IndexFromHash(eax, eax); | |
2749 | |
2750 context()->Plug(eax); | |
2751 } | |
2752 | |
2753 | |
2754 void FullCodeGenerator::EmitGetSuperConstructor(CallRuntime* expr) { | 2715 void FullCodeGenerator::EmitGetSuperConstructor(CallRuntime* expr) { |
2755 ZoneList<Expression*>* args = expr->arguments(); | 2716 ZoneList<Expression*>* args = expr->arguments(); |
2756 DCHECK_EQ(1, args->length()); | 2717 DCHECK_EQ(1, args->length()); |
2757 VisitForAccumulatorValue(args->at(0)); | 2718 VisitForAccumulatorValue(args->at(0)); |
2758 __ AssertFunction(eax); | 2719 __ AssertFunction(eax); |
2759 __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset)); | 2720 __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset)); |
2760 __ mov(eax, FieldOperand(eax, Map::kPrototypeOffset)); | 2721 __ mov(eax, FieldOperand(eax, Map::kPrototypeOffset)); |
2761 context()->Plug(eax); | 2722 context()->Plug(eax); |
2762 } | 2723 } |
2763 | 2724 |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3552 isolate->builtins()->OnStackReplacement()->entry(), | 3513 isolate->builtins()->OnStackReplacement()->entry(), |
3553 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3514 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3554 return ON_STACK_REPLACEMENT; | 3515 return ON_STACK_REPLACEMENT; |
3555 } | 3516 } |
3556 | 3517 |
3557 | 3518 |
3558 } // namespace internal | 3519 } // namespace internal |
3559 } // namespace v8 | 3520 } // namespace v8 |
3560 | 3521 |
3561 #endif // V8_TARGET_ARCH_X87 | 3522 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |