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/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 2630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2641 // ----------------------------------- | 2641 // ----------------------------------- |
2642 __ SmiTag(edx); | 2642 __ SmiTag(edx); |
2643 __ PopReturnAddressTo(ecx); | 2643 __ PopReturnAddressTo(ecx); |
2644 __ Push(edx); | 2644 __ Push(edx); |
2645 __ Push(Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); | 2645 __ Push(Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); |
2646 __ PushReturnAddressFrom(ecx); | 2646 __ PushReturnAddressFrom(ecx); |
2647 __ Move(esi, Smi::FromInt(0)); | 2647 __ Move(esi, Smi::FromInt(0)); |
2648 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); | 2648 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); |
2649 } | 2649 } |
2650 | 2650 |
| 2651 // static |
| 2652 void Builtins::Generate_StringToNumber(MacroAssembler* masm) { |
| 2653 // The StringToNumber stub takes one argument in eax. |
| 2654 __ AssertString(eax); |
| 2655 |
| 2656 // Check if string has a cached array index. |
| 2657 Label runtime; |
| 2658 __ test(FieldOperand(eax, String::kHashFieldOffset), |
| 2659 Immediate(String::kContainsCachedArrayIndexMask)); |
| 2660 __ j(not_zero, &runtime, Label::kNear); |
| 2661 __ mov(eax, FieldOperand(eax, String::kHashFieldOffset)); |
| 2662 __ IndexFromHash(eax, eax); |
| 2663 __ Ret(); |
| 2664 |
| 2665 __ bind(&runtime); |
| 2666 __ PopReturnAddressTo(ecx); // Pop return address. |
| 2667 __ Push(eax); // Push argument. |
| 2668 __ PushReturnAddressFrom(ecx); // Push return address. |
| 2669 __ TailCallRuntime(Runtime::kStringToNumber); |
| 2670 } |
| 2671 |
2651 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 2672 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
2652 // ----------- S t a t e ------------- | 2673 // ----------- S t a t e ------------- |
2653 // -- eax : actual number of arguments | 2674 // -- eax : actual number of arguments |
2654 // -- ebx : expected number of arguments | 2675 // -- ebx : expected number of arguments |
2655 // -- edx : new target (passed through to callee) | 2676 // -- edx : new target (passed through to callee) |
2656 // -- edi : function (passed through to callee) | 2677 // -- edi : function (passed through to callee) |
2657 // ----------------------------------- | 2678 // ----------------------------------- |
2658 | 2679 |
2659 Label invoke, dont_adapt_arguments, stack_overflow; | 2680 Label invoke, dont_adapt_arguments, stack_overflow; |
2660 __ IncrementCounter(masm->isolate()->counters()->arguments_adaptors(), 1); | 2681 __ IncrementCounter(masm->isolate()->counters()->arguments_adaptors(), 1); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2899 // And "return" to the OSR entry point of the function. | 2920 // And "return" to the OSR entry point of the function. |
2900 __ ret(0); | 2921 __ ret(0); |
2901 } | 2922 } |
2902 | 2923 |
2903 | 2924 |
2904 #undef __ | 2925 #undef __ |
2905 } // namespace internal | 2926 } // namespace internal |
2906 } // namespace v8 | 2927 } // namespace v8 |
2907 | 2928 |
2908 #endif // V8_TARGET_ARCH_IA32 | 2929 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |