Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 1269323003: Cleanup unnecessary duplication of runtime functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Adapt test case. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/hydrogen.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 __ neg(edx); 780 __ neg(edx);
781 __ mov(eax, Operand(ebx, edx, times_2, kDisplacement)); 781 __ mov(eax, Operand(ebx, edx, times_2, kDisplacement));
782 __ ret(0); 782 __ ret(0);
783 783
784 // Slow-case: Handle non-smi or out-of-bounds access to arguments 784 // Slow-case: Handle non-smi or out-of-bounds access to arguments
785 // by calling the runtime system. 785 // by calling the runtime system.
786 __ bind(&slow); 786 __ bind(&slow);
787 __ pop(ebx); // Return address. 787 __ pop(ebx); // Return address.
788 __ push(edx); 788 __ push(edx);
789 __ push(ebx); 789 __ push(ebx);
790 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); 790 __ TailCallRuntime(Runtime::kArguments, 1, 1);
791 } 791 }
792 792
793 793
794 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { 794 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) {
795 // esp[0] : return address 795 // esp[0] : return address
796 // esp[4] : number of parameters 796 // esp[4] : number of parameters
797 // esp[8] : receiver displacement 797 // esp[8] : receiver displacement
798 // esp[12] : function 798 // esp[12] : function
799 799
800 // Check if the calling frame is an arguments adaptor frame. 800 // Check if the calling frame is an arguments adaptor frame.
(...skipping 2527 matching lines...) Expand 10 before | Expand all | Expand 10 after
3328 masm, edi, edx, ecx, ebx, String::TWO_BYTE_ENCODING); 3328 masm, edi, edx, ecx, ebx, String::TWO_BYTE_ENCODING);
3329 __ IncrementCounter(counters->sub_string_native(), 1); 3329 __ IncrementCounter(counters->sub_string_native(), 1);
3330 __ ret(3 * kPointerSize); 3330 __ ret(3 * kPointerSize);
3331 3331
3332 // Drop pushed values on the stack before tail call. 3332 // Drop pushed values on the stack before tail call.
3333 __ bind(&runtime_drop_two); 3333 __ bind(&runtime_drop_two);
3334 __ Drop(2); 3334 __ Drop(2);
3335 3335
3336 // Just jump to runtime to create the sub string. 3336 // Just jump to runtime to create the sub string.
3337 __ bind(&runtime); 3337 __ bind(&runtime);
3338 __ TailCallRuntime(Runtime::kSubStringRT, 3, 1); 3338 __ TailCallRuntime(Runtime::kSubString, 3, 1);
3339 3339
3340 __ bind(&single_char); 3340 __ bind(&single_char);
3341 // eax: string 3341 // eax: string
3342 // ebx: instance type 3342 // ebx: instance type
3343 // ecx: sub string length (smi) 3343 // ecx: sub string length (smi)
3344 // edx: from index (smi) 3344 // edx: from index (smi)
3345 StringCharAtGenerator generator(eax, edx, ecx, eax, &runtime, &runtime, 3345 StringCharAtGenerator generator(eax, edx, ecx, eax, &runtime, &runtime,
3346 &runtime, STRING_INDEX_IS_NUMBER, 3346 &runtime, STRING_INDEX_IS_NUMBER,
3347 RECEIVER_IS_STRING); 3347 RECEIVER_IS_STRING);
3348 generator.GenerateFast(masm); 3348 generator.GenerateFast(masm);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
3551 // Drop arguments from the stack. 3551 // Drop arguments from the stack.
3552 __ pop(ecx); 3552 __ pop(ecx);
3553 __ add(esp, Immediate(2 * kPointerSize)); 3553 __ add(esp, Immediate(2 * kPointerSize));
3554 __ push(ecx); 3554 __ push(ecx);
3555 StringHelper::GenerateCompareFlatOneByteStrings(masm, edx, eax, ecx, ebx, 3555 StringHelper::GenerateCompareFlatOneByteStrings(masm, edx, eax, ecx, ebx,
3556 edi); 3556 edi);
3557 3557
3558 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) 3558 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
3559 // tagged as a small integer. 3559 // tagged as a small integer.
3560 __ bind(&runtime); 3560 __ bind(&runtime);
3561 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); 3561 __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
3562 } 3562 }
3563 3563
3564 3564
3565 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { 3565 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) {
3566 // ----------- S t a t e ------------- 3566 // ----------- S t a t e -------------
3567 // -- edx : left 3567 // -- edx : left
3568 // -- eax : right 3568 // -- eax : right
3569 // -- esp[0] : return address 3569 // -- esp[0] : return address
3570 // ----------------------------------- 3570 // -----------------------------------
3571 3571
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
3863 3863
3864 // Handle more complex cases in runtime. 3864 // Handle more complex cases in runtime.
3865 __ bind(&runtime); 3865 __ bind(&runtime);
3866 __ pop(tmp1); // Return address. 3866 __ pop(tmp1); // Return address.
3867 __ push(left); 3867 __ push(left);
3868 __ push(right); 3868 __ push(right);
3869 __ push(tmp1); 3869 __ push(tmp1);
3870 if (equality) { 3870 if (equality) {
3871 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); 3871 __ TailCallRuntime(Runtime::kStringEquals, 2, 1);
3872 } else { 3872 } else {
3873 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); 3873 __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
3874 } 3874 }
3875 3875
3876 __ bind(&miss); 3876 __ bind(&miss);
3877 GenerateMiss(masm); 3877 GenerateMiss(masm);
3878 } 3878 }
3879 3879
3880 3880
3881 void CompareICStub::GenerateObjects(MacroAssembler* masm) { 3881 void CompareICStub::GenerateObjects(MacroAssembler* masm) {
3882 DCHECK(state() == CompareICState::OBJECT); 3882 DCHECK(state() == CompareICState::OBJECT);
3883 Label miss; 3883 Label miss;
(...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after
5658 Operand(ebp, 7 * kPointerSize), NULL); 5658 Operand(ebp, 7 * kPointerSize), NULL);
5659 } 5659 }
5660 5660
5661 5661
5662 #undef __ 5662 #undef __
5663 5663
5664 } // namespace internal 5664 } // namespace internal
5665 } // namespace v8 5665 } // namespace v8
5666 5666
5667 #endif // V8_TARGET_ARCH_IA32 5667 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698