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

Side by Side Diff: src/x87/code-stubs-x87.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/x64/code-stubs-x64.cc ('k') | test/mjsunit/regress/string-compare-memcmp.js » ('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_X87 7 #if V8_TARGET_ARCH_X87
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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 __ neg(edx); 481 __ neg(edx);
482 __ mov(eax, Operand(ebx, edx, times_2, kDisplacement)); 482 __ mov(eax, Operand(ebx, edx, times_2, kDisplacement));
483 __ ret(0); 483 __ ret(0);
484 484
485 // Slow-case: Handle non-smi or out-of-bounds access to arguments 485 // Slow-case: Handle non-smi or out-of-bounds access to arguments
486 // by calling the runtime system. 486 // by calling the runtime system.
487 __ bind(&slow); 487 __ bind(&slow);
488 __ pop(ebx); // Return address. 488 __ pop(ebx); // Return address.
489 __ push(edx); 489 __ push(edx);
490 __ push(ebx); 490 __ push(ebx);
491 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); 491 __ TailCallRuntime(Runtime::kArguments, 1, 1);
492 } 492 }
493 493
494 494
495 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { 495 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) {
496 // esp[0] : return address 496 // esp[0] : return address
497 // esp[4] : number of parameters 497 // esp[4] : number of parameters
498 // esp[8] : receiver displacement 498 // esp[8] : receiver displacement
499 // esp[12] : function 499 // esp[12] : function
500 500
501 // Check if the calling frame is an arguments adaptor frame. 501 // Check if the calling frame is an arguments adaptor frame.
(...skipping 2536 matching lines...) Expand 10 before | Expand all | Expand 10 after
3038 masm, edi, edx, ecx, ebx, String::TWO_BYTE_ENCODING); 3038 masm, edi, edx, ecx, ebx, String::TWO_BYTE_ENCODING);
3039 __ IncrementCounter(counters->sub_string_native(), 1); 3039 __ IncrementCounter(counters->sub_string_native(), 1);
3040 __ ret(3 * kPointerSize); 3040 __ ret(3 * kPointerSize);
3041 3041
3042 // Drop pushed values on the stack before tail call. 3042 // Drop pushed values on the stack before tail call.
3043 __ bind(&runtime_drop_two); 3043 __ bind(&runtime_drop_two);
3044 __ Drop(2); 3044 __ Drop(2);
3045 3045
3046 // Just jump to runtime to create the sub string. 3046 // Just jump to runtime to create the sub string.
3047 __ bind(&runtime); 3047 __ bind(&runtime);
3048 __ TailCallRuntime(Runtime::kSubStringRT, 3, 1); 3048 __ TailCallRuntime(Runtime::kSubString, 3, 1);
3049 3049
3050 __ bind(&single_char); 3050 __ bind(&single_char);
3051 // eax: string 3051 // eax: string
3052 // ebx: instance type 3052 // ebx: instance type
3053 // ecx: sub string length (smi) 3053 // ecx: sub string length (smi)
3054 // edx: from index (smi) 3054 // edx: from index (smi)
3055 StringCharAtGenerator generator(eax, edx, ecx, eax, &runtime, &runtime, 3055 StringCharAtGenerator generator(eax, edx, ecx, eax, &runtime, &runtime,
3056 &runtime, STRING_INDEX_IS_NUMBER, 3056 &runtime, STRING_INDEX_IS_NUMBER,
3057 RECEIVER_IS_STRING); 3057 RECEIVER_IS_STRING);
3058 generator.GenerateFast(masm); 3058 generator.GenerateFast(masm);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
3261 // Drop arguments from the stack. 3261 // Drop arguments from the stack.
3262 __ pop(ecx); 3262 __ pop(ecx);
3263 __ add(esp, Immediate(2 * kPointerSize)); 3263 __ add(esp, Immediate(2 * kPointerSize));
3264 __ push(ecx); 3264 __ push(ecx);
3265 StringHelper::GenerateCompareFlatOneByteStrings(masm, edx, eax, ecx, ebx, 3265 StringHelper::GenerateCompareFlatOneByteStrings(masm, edx, eax, ecx, ebx,
3266 edi); 3266 edi);
3267 3267
3268 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) 3268 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
3269 // tagged as a small integer. 3269 // tagged as a small integer.
3270 __ bind(&runtime); 3270 __ bind(&runtime);
3271 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); 3271 __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
3272 } 3272 }
3273 3273
3274 3274
3275 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { 3275 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) {
3276 // ----------- S t a t e ------------- 3276 // ----------- S t a t e -------------
3277 // -- edx : left 3277 // -- edx : left
3278 // -- eax : right 3278 // -- eax : right
3279 // -- esp[0] : return address 3279 // -- esp[0] : return address
3280 // ----------------------------------- 3280 // -----------------------------------
3281 3281
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
3545 3545
3546 // Handle more complex cases in runtime. 3546 // Handle more complex cases in runtime.
3547 __ bind(&runtime); 3547 __ bind(&runtime);
3548 __ pop(tmp1); // Return address. 3548 __ pop(tmp1); // Return address.
3549 __ push(left); 3549 __ push(left);
3550 __ push(right); 3550 __ push(right);
3551 __ push(tmp1); 3551 __ push(tmp1);
3552 if (equality) { 3552 if (equality) {
3553 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); 3553 __ TailCallRuntime(Runtime::kStringEquals, 2, 1);
3554 } else { 3554 } else {
3555 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); 3555 __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
3556 } 3556 }
3557 3557
3558 __ bind(&miss); 3558 __ bind(&miss);
3559 GenerateMiss(masm); 3559 GenerateMiss(masm);
3560 } 3560 }
3561 3561
3562 3562
3563 void CompareICStub::GenerateObjects(MacroAssembler* masm) { 3563 void CompareICStub::GenerateObjects(MacroAssembler* masm) {
3564 DCHECK(state() == CompareICState::OBJECT); 3564 DCHECK(state() == CompareICState::OBJECT);
3565 Label miss; 3565 Label miss;
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after
5338 Operand(ebp, 7 * kPointerSize), NULL); 5338 Operand(ebp, 7 * kPointerSize), NULL);
5339 } 5339 }
5340 5340
5341 5341
5342 #undef __ 5342 #undef __
5343 5343
5344 } // namespace internal 5344 } // namespace internal
5345 } // namespace v8 5345 } // namespace v8
5346 5346
5347 #endif // V8_TARGET_ARCH_X87 5347 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | test/mjsunit/regress/string-compare-memcmp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698