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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 3266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3277 masm, edi, edx, ecx, ebx, String::TWO_BYTE_ENCODING); | 3277 masm, edi, edx, ecx, ebx, String::TWO_BYTE_ENCODING); |
3278 __ IncrementCounter(counters->sub_string_native(), 1); | 3278 __ IncrementCounter(counters->sub_string_native(), 1); |
3279 __ ret(3 * kPointerSize); | 3279 __ ret(3 * kPointerSize); |
3280 | 3280 |
3281 // Drop pushed values on the stack before tail call. | 3281 // Drop pushed values on the stack before tail call. |
3282 __ bind(&runtime_drop_two); | 3282 __ bind(&runtime_drop_two); |
3283 __ Drop(2); | 3283 __ Drop(2); |
3284 | 3284 |
3285 // Just jump to runtime to create the sub string. | 3285 // Just jump to runtime to create the sub string. |
3286 __ bind(&runtime); | 3286 __ bind(&runtime); |
3287 __ TailCallRuntime(Runtime::kSubString, 3, 1); | 3287 __ TailCallRuntime(Runtime::kSubStringRT, 3, 1); |
3288 | 3288 |
3289 __ bind(&single_char); | 3289 __ bind(&single_char); |
3290 // eax: string | 3290 // eax: string |
3291 // ebx: instance type | 3291 // ebx: instance type |
3292 // ecx: sub string length (smi) | 3292 // ecx: sub string length (smi) |
3293 // edx: from index (smi) | 3293 // edx: from index (smi) |
3294 StringCharAtGenerator generator(eax, edx, ecx, eax, &runtime, &runtime, | 3294 StringCharAtGenerator generator(eax, edx, ecx, eax, &runtime, &runtime, |
3295 &runtime, STRING_INDEX_IS_NUMBER, | 3295 &runtime, STRING_INDEX_IS_NUMBER, |
3296 RECEIVER_IS_STRING); | 3296 RECEIVER_IS_STRING); |
3297 generator.GenerateFast(masm); | 3297 generator.GenerateFast(masm); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3500 // Drop arguments from the stack. | 3500 // Drop arguments from the stack. |
3501 __ pop(ecx); | 3501 __ pop(ecx); |
3502 __ add(esp, Immediate(2 * kPointerSize)); | 3502 __ add(esp, Immediate(2 * kPointerSize)); |
3503 __ push(ecx); | 3503 __ push(ecx); |
3504 StringHelper::GenerateCompareFlatOneByteStrings(masm, edx, eax, ecx, ebx, | 3504 StringHelper::GenerateCompareFlatOneByteStrings(masm, edx, eax, ecx, ebx, |
3505 edi); | 3505 edi); |
3506 | 3506 |
3507 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 3507 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
3508 // tagged as a small integer. | 3508 // tagged as a small integer. |
3509 __ bind(&runtime); | 3509 __ bind(&runtime); |
3510 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 3510 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); |
3511 } | 3511 } |
3512 | 3512 |
3513 | 3513 |
3514 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { | 3514 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { |
3515 // ----------- S t a t e ------------- | 3515 // ----------- S t a t e ------------- |
3516 // -- edx : left | 3516 // -- edx : left |
3517 // -- eax : right | 3517 // -- eax : right |
3518 // -- esp[0] : return address | 3518 // -- esp[0] : return address |
3519 // ----------------------------------- | 3519 // ----------------------------------- |
3520 | 3520 |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3812 | 3812 |
3813 // Handle more complex cases in runtime. | 3813 // Handle more complex cases in runtime. |
3814 __ bind(&runtime); | 3814 __ bind(&runtime); |
3815 __ pop(tmp1); // Return address. | 3815 __ pop(tmp1); // Return address. |
3816 __ push(left); | 3816 __ push(left); |
3817 __ push(right); | 3817 __ push(right); |
3818 __ push(tmp1); | 3818 __ push(tmp1); |
3819 if (equality) { | 3819 if (equality) { |
3820 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); | 3820 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); |
3821 } else { | 3821 } else { |
3822 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 3822 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); |
3823 } | 3823 } |
3824 | 3824 |
3825 __ bind(&miss); | 3825 __ bind(&miss); |
3826 GenerateMiss(masm); | 3826 GenerateMiss(masm); |
3827 } | 3827 } |
3828 | 3828 |
3829 | 3829 |
3830 void CompareICStub::GenerateObjects(MacroAssembler* masm) { | 3830 void CompareICStub::GenerateObjects(MacroAssembler* masm) { |
3831 DCHECK(state() == CompareICState::OBJECT); | 3831 DCHECK(state() == CompareICState::OBJECT); |
3832 Label miss; | 3832 Label miss; |
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5184 ApiParameterOperand(2), kStackSpace, nullptr, | 5184 ApiParameterOperand(2), kStackSpace, nullptr, |
5185 Operand(ebp, 7 * kPointerSize), NULL); | 5185 Operand(ebp, 7 * kPointerSize), NULL); |
5186 } | 5186 } |
5187 | 5187 |
5188 | 5188 |
5189 #undef __ | 5189 #undef __ |
5190 | 5190 |
5191 } } // namespace v8::internal | 5191 } } // namespace v8::internal |
5192 | 5192 |
5193 #endif // V8_TARGET_ARCH_IA32 | 5193 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |