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 2023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2034 __ bind(&no_arguments); | 2034 __ bind(&no_arguments); |
2035 { | 2035 { |
2036 __ LoadRoot(eax, Heap::kempty_stringRootIndex); | 2036 __ LoadRoot(eax, Heap::kempty_stringRootIndex); |
2037 __ ret(1 * kPointerSize); | 2037 __ ret(1 * kPointerSize); |
2038 } | 2038 } |
2039 | 2039 |
2040 // 3a. Convert eax to a string. | 2040 // 3a. Convert eax to a string. |
2041 __ bind(&to_string); | 2041 __ bind(&to_string); |
2042 { | 2042 { |
2043 FrameScope scope(masm, StackFrame::MANUAL); | 2043 FrameScope scope(masm, StackFrame::MANUAL); |
2044 ToStringStub stub(masm->isolate()); | |
2045 __ SmiTag(ebx); | 2044 __ SmiTag(ebx); |
2046 __ EnterBuiltinFrame(esi, edi, ebx); | 2045 __ EnterBuiltinFrame(esi, edi, ebx); |
2047 __ CallStub(&stub); | 2046 __ Call(masm->isolate()->builtins()->ToString(), RelocInfo::CODE_TARGET); |
2048 __ LeaveBuiltinFrame(esi, edi, ebx); | 2047 __ LeaveBuiltinFrame(esi, edi, ebx); |
2049 __ SmiUntag(ebx); | 2048 __ SmiUntag(ebx); |
2050 } | 2049 } |
2051 __ jmp(&drop_frame_and_ret, Label::kNear); | 2050 __ jmp(&drop_frame_and_ret, Label::kNear); |
2052 | 2051 |
2053 // 3b. Convert symbol in eax to a string. | 2052 // 3b. Convert symbol in eax to a string. |
2054 __ bind(&symbol_descriptive_string); | 2053 __ bind(&symbol_descriptive_string); |
2055 { | 2054 { |
2056 __ PopReturnAddressTo(ecx); | 2055 __ PopReturnAddressTo(ecx); |
2057 __ lea(esp, Operand(esp, ebx, times_pointer_size, kPointerSize)); | 2056 __ lea(esp, Operand(esp, ebx, times_pointer_size, kPointerSize)); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2101 | 2100 |
2102 // 3. Make sure eax is a string. | 2101 // 3. Make sure eax is a string. |
2103 { | 2102 { |
2104 Label convert, done_convert; | 2103 Label convert, done_convert; |
2105 __ JumpIfSmi(eax, &convert, Label::kNear); | 2104 __ JumpIfSmi(eax, &convert, Label::kNear); |
2106 __ CmpObjectType(eax, FIRST_NONSTRING_TYPE, ecx); | 2105 __ CmpObjectType(eax, FIRST_NONSTRING_TYPE, ecx); |
2107 __ j(below, &done_convert); | 2106 __ j(below, &done_convert); |
2108 __ bind(&convert); | 2107 __ bind(&convert); |
2109 { | 2108 { |
2110 FrameScope scope(masm, StackFrame::MANUAL); | 2109 FrameScope scope(masm, StackFrame::MANUAL); |
2111 ToStringStub stub(masm->isolate()); | |
2112 __ SmiTag(ebx); | 2110 __ SmiTag(ebx); |
2113 __ EnterBuiltinFrame(esi, edi, ebx); | 2111 __ EnterBuiltinFrame(esi, edi, ebx); |
2114 __ Push(edx); | 2112 __ Push(edx); |
2115 __ CallStub(&stub); | 2113 __ Call(masm->isolate()->builtins()->ToString(), RelocInfo::CODE_TARGET); |
2116 __ Pop(edx); | 2114 __ Pop(edx); |
2117 __ LeaveBuiltinFrame(esi, edi, ebx); | 2115 __ LeaveBuiltinFrame(esi, edi, ebx); |
2118 __ SmiUntag(ebx); | 2116 __ SmiUntag(ebx); |
2119 } | 2117 } |
2120 __ bind(&done_convert); | 2118 __ bind(&done_convert); |
2121 } | 2119 } |
2122 | 2120 |
2123 // 4. Check if new target and constructor differ. | 2121 // 4. Check if new target and constructor differ. |
2124 Label drop_frame_and_ret, done_alloc, new_object; | 2122 Label drop_frame_and_ret, done_alloc, new_object; |
2125 __ cmp(edx, edi); | 2123 __ cmp(edx, edi); |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3144 | 3142 |
3145 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { | 3143 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { |
3146 Generate_OnStackReplacementHelper(masm, true); | 3144 Generate_OnStackReplacementHelper(masm, true); |
3147 } | 3145 } |
3148 | 3146 |
3149 #undef __ | 3147 #undef __ |
3150 } // namespace internal | 3148 } // namespace internal |
3151 } // namespace v8 | 3149 } // namespace v8 |
3152 | 3150 |
3153 #endif // V8_TARGET_ARCH_IA32 | 3151 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |