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/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 2639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2650 // ----------------------------------- | 2650 // ----------------------------------- |
2651 __ SmiTag(edx); | 2651 __ SmiTag(edx); |
2652 __ PopReturnAddressTo(ecx); | 2652 __ PopReturnAddressTo(ecx); |
2653 __ Push(edx); | 2653 __ Push(edx); |
2654 __ Push(Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); | 2654 __ Push(Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); |
2655 __ PushReturnAddressFrom(ecx); | 2655 __ PushReturnAddressFrom(ecx); |
2656 __ Move(esi, Smi::FromInt(0)); | 2656 __ Move(esi, Smi::FromInt(0)); |
2657 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); | 2657 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); |
2658 } | 2658 } |
2659 | 2659 |
| 2660 // static |
| 2661 void Builtins::Generate_StringToNumber(MacroAssembler* masm) { |
| 2662 // The StringToNumber stub takes one argument in eax. |
| 2663 __ AssertString(eax); |
| 2664 |
| 2665 // Check if string has a cached array index. |
| 2666 Label runtime; |
| 2667 __ test(FieldOperand(eax, String::kHashFieldOffset), |
| 2668 Immediate(String::kContainsCachedArrayIndexMask)); |
| 2669 __ j(not_zero, &runtime, Label::kNear); |
| 2670 __ mov(eax, FieldOperand(eax, String::kHashFieldOffset)); |
| 2671 __ IndexFromHash(eax, eax); |
| 2672 __ Ret(); |
| 2673 |
| 2674 __ bind(&runtime); |
| 2675 __ PopReturnAddressTo(ecx); // Pop return address. |
| 2676 __ Push(eax); // Push argument. |
| 2677 __ PushReturnAddressFrom(ecx); // Push return address. |
| 2678 __ TailCallRuntime(Runtime::kStringToNumber); |
| 2679 } |
| 2680 |
2660 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 2681 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
2661 // ----------- S t a t e ------------- | 2682 // ----------- S t a t e ------------- |
2662 // -- eax : actual number of arguments | 2683 // -- eax : actual number of arguments |
2663 // -- ebx : expected number of arguments | 2684 // -- ebx : expected number of arguments |
2664 // -- edx : new target (passed through to callee) | 2685 // -- edx : new target (passed through to callee) |
2665 // -- edi : function (passed through to callee) | 2686 // -- edi : function (passed through to callee) |
2666 // ----------------------------------- | 2687 // ----------------------------------- |
2667 | 2688 |
2668 Label invoke, dont_adapt_arguments, stack_overflow; | 2689 Label invoke, dont_adapt_arguments, stack_overflow; |
2669 __ IncrementCounter(masm->isolate()->counters()->arguments_adaptors(), 1); | 2690 __ IncrementCounter(masm->isolate()->counters()->arguments_adaptors(), 1); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2909 // And "return" to the OSR entry point of the function. | 2930 // And "return" to the OSR entry point of the function. |
2910 __ ret(0); | 2931 __ ret(0); |
2911 } | 2932 } |
2912 | 2933 |
2913 | 2934 |
2914 #undef __ | 2935 #undef __ |
2915 } // namespace internal | 2936 } // namespace internal |
2916 } // namespace v8 | 2937 } // namespace v8 |
2917 | 2938 |
2918 #endif // V8_TARGET_ARCH_X87 | 2939 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |