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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 2702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2713 __ mov(edi, Operand(esp, (argc + 1) * kPointerSize)); | 2713 __ mov(edi, Operand(esp, (argc + 1) * kPointerSize)); |
2714 // Call the target. | 2714 // Call the target. |
2715 __ mov(eax, Immediate(argc)); | 2715 __ mov(eax, Immediate(argc)); |
2716 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 2716 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
2717 OperandStackDepthDecrement(argc + 1); | 2717 OperandStackDepthDecrement(argc + 1); |
2718 RestoreContext(); | 2718 RestoreContext(); |
2719 // Discard the function left on TOS. | 2719 // Discard the function left on TOS. |
2720 context()->DropAndPlug(1, eax); | 2720 context()->DropAndPlug(1, eax); |
2721 } | 2721 } |
2722 | 2722 |
2723 | |
2724 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { | |
2725 ZoneList<Expression*>* args = expr->arguments(); | |
2726 DCHECK(args->length() == 1); | |
2727 | |
2728 VisitForAccumulatorValue(args->at(0)); | |
2729 | |
2730 __ AssertString(eax); | |
2731 | |
2732 Label materialize_true, materialize_false; | |
2733 Label* if_true = NULL; | |
2734 Label* if_false = NULL; | |
2735 Label* fall_through = NULL; | |
2736 context()->PrepareTest(&materialize_true, &materialize_false, | |
2737 &if_true, &if_false, &fall_through); | |
2738 | |
2739 __ test(FieldOperand(eax, String::kHashFieldOffset), | |
2740 Immediate(String::kContainsCachedArrayIndexMask)); | |
2741 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | |
2742 Split(zero, if_true, if_false, fall_through); | |
2743 | |
2744 context()->Plug(if_true, if_false); | |
2745 } | |
2746 | |
2747 | |
2748 void FullCodeGenerator::EmitGetCachedArrayIndex(CallRuntime* expr) { | |
2749 ZoneList<Expression*>* args = expr->arguments(); | |
2750 DCHECK(args->length() == 1); | |
2751 VisitForAccumulatorValue(args->at(0)); | |
2752 | |
2753 __ AssertString(eax); | |
2754 | |
2755 __ mov(eax, FieldOperand(eax, String::kHashFieldOffset)); | |
2756 __ IndexFromHash(eax, eax); | |
2757 | |
2758 context()->Plug(eax); | |
2759 } | |
2760 | |
2761 | |
2762 void FullCodeGenerator::EmitGetSuperConstructor(CallRuntime* expr) { | 2723 void FullCodeGenerator::EmitGetSuperConstructor(CallRuntime* expr) { |
2763 ZoneList<Expression*>* args = expr->arguments(); | 2724 ZoneList<Expression*>* args = expr->arguments(); |
2764 DCHECK_EQ(1, args->length()); | 2725 DCHECK_EQ(1, args->length()); |
2765 VisitForAccumulatorValue(args->at(0)); | 2726 VisitForAccumulatorValue(args->at(0)); |
2766 __ AssertFunction(eax); | 2727 __ AssertFunction(eax); |
2767 __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset)); | 2728 __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset)); |
2768 __ mov(eax, FieldOperand(eax, Map::kPrototypeOffset)); | 2729 __ mov(eax, FieldOperand(eax, Map::kPrototypeOffset)); |
2769 context()->Plug(eax); | 2730 context()->Plug(eax); |
2770 } | 2731 } |
2771 | 2732 |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3560 isolate->builtins()->OnStackReplacement()->entry(), | 3521 isolate->builtins()->OnStackReplacement()->entry(), |
3561 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3522 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3562 return ON_STACK_REPLACEMENT; | 3523 return ON_STACK_REPLACEMENT; |
3563 } | 3524 } |
3564 | 3525 |
3565 | 3526 |
3566 } // namespace internal | 3527 } // namespace internal |
3567 } // namespace v8 | 3528 } // namespace v8 |
3568 | 3529 |
3569 #endif // V8_TARGET_ARCH_IA32 | 3530 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |