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

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

Issue 1248303002: Unify runtime-style IC functions with Runtime intrinsics (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make mips work Created 5 years, 5 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/debug.cc ('k') | src/ia32/debug-ia32.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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 __ test(key, Immediate(kSmiTagMask | kSmiSignMask)); 681 __ test(key, Immediate(kSmiTagMask | kSmiSignMask));
682 __ j(not_zero, &slow); 682 __ j(not_zero, &slow);
683 683
684 // Everything is fine, call runtime. 684 // Everything is fine, call runtime.
685 __ pop(scratch); 685 __ pop(scratch);
686 __ push(receiver); // receiver 686 __ push(receiver); // receiver
687 __ push(key); // key 687 __ push(key); // key
688 __ push(scratch); // return address 688 __ push(scratch); // return address
689 689
690 // Perform tail call to the entry. 690 // Perform tail call to the entry.
691 ExternalReference ref = ExternalReference( 691 __ TailCallRuntime(Runtime::kLoadElementWithInterceptor, 2, 1);
692 IC_Utility(IC::kLoadElementWithInterceptor), masm->isolate());
693 __ TailCallExternalReference(ref, 2, 1);
694 692
695 __ bind(&slow); 693 __ bind(&slow);
696 PropertyAccessCompiler::TailCallBuiltin( 694 PropertyAccessCompiler::TailCallBuiltin(
697 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); 695 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC));
698 } 696 }
699 697
700 698
701 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { 699 void LoadIndexedStringStub::Generate(MacroAssembler* masm) {
702 // Return address is on the stack. 700 // Return address is on the stack.
703 Label miss; 701 Label miss;
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after
2439 2437
2440 void CallICStub::GenerateMiss(MacroAssembler* masm) { 2438 void CallICStub::GenerateMiss(MacroAssembler* masm) {
2441 FrameScope scope(masm, StackFrame::INTERNAL); 2439 FrameScope scope(masm, StackFrame::INTERNAL);
2442 2440
2443 // Push the function and feedback info. 2441 // Push the function and feedback info.
2444 __ push(edi); 2442 __ push(edi);
2445 __ push(ebx); 2443 __ push(ebx);
2446 __ push(edx); 2444 __ push(edx);
2447 2445
2448 // Call the entry. 2446 // Call the entry.
2449 IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss 2447 Runtime::FunctionId id = GetICState() == DEFAULT
2450 : IC::kCallIC_Customization_Miss; 2448 ? Runtime::kCallIC_Miss
2451 2449 : Runtime::kCallIC_Customization_Miss;
2452 ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate()); 2450 __ CallRuntime(id, 3);
2453 __ CallExternalReference(miss, 3);
2454 2451
2455 // Move result to edi and exit the internal frame. 2452 // Move result to edi and exit the internal frame.
2456 __ mov(edi, eax); 2453 __ mov(edi, eax);
2457 } 2454 }
2458 2455
2459 2456
2460 bool CEntryStub::NeedsImmovableCode() { 2457 bool CEntryStub::NeedsImmovableCode() {
2461 return false; 2458 return false;
2462 } 2459 }
2463 2460
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after
3898 __ ret(0); 3895 __ ret(0);
3899 3896
3900 __ bind(&miss); 3897 __ bind(&miss);
3901 GenerateMiss(masm); 3898 GenerateMiss(masm);
3902 } 3899 }
3903 3900
3904 3901
3905 void CompareICStub::GenerateMiss(MacroAssembler* masm) { 3902 void CompareICStub::GenerateMiss(MacroAssembler* masm) {
3906 { 3903 {
3907 // Call the runtime system in a fresh internal frame. 3904 // Call the runtime system in a fresh internal frame.
3908 ExternalReference miss = ExternalReference(IC_Utility(IC::kCompareIC_Miss),
3909 isolate());
3910 FrameScope scope(masm, StackFrame::INTERNAL); 3905 FrameScope scope(masm, StackFrame::INTERNAL);
3911 __ push(edx); // Preserve edx and eax. 3906 __ push(edx); // Preserve edx and eax.
3912 __ push(eax); 3907 __ push(eax);
3913 __ push(edx); // And also use them as the arguments. 3908 __ push(edx); // And also use them as the arguments.
3914 __ push(eax); 3909 __ push(eax);
3915 __ push(Immediate(Smi::FromInt(op()))); 3910 __ push(Immediate(Smi::FromInt(op())));
3916 __ CallExternalReference(miss, 3); 3911 __ CallRuntime(Runtime::kCompareIC_Miss, 3);
3917 // Compute the entry point of the rewritten stub. 3912 // Compute the entry point of the rewritten stub.
3918 __ lea(edi, FieldOperand(eax, Code::kHeaderSize)); 3913 __ lea(edi, FieldOperand(eax, Code::kHeaderSize));
3919 __ pop(eax); 3914 __ pop(eax);
3920 __ pop(edx); 3915 __ pop(edx);
3921 } 3916 }
3922 3917
3923 // Do a tail call to the rewritten stub. 3918 // Do a tail call to the rewritten stub.
3924 __ jmp(edi); 3919 __ jmp(edi);
3925 } 3920 }
3926 3921
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after
5485 Operand(ebp, 7 * kPointerSize), NULL); 5480 Operand(ebp, 7 * kPointerSize), NULL);
5486 } 5481 }
5487 5482
5488 5483
5489 #undef __ 5484 #undef __
5490 5485
5491 } // namespace internal 5486 } // namespace internal
5492 } // namespace v8 5487 } // namespace v8
5493 5488
5494 #endif // V8_TARGET_ARCH_IA32 5489 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | src/ia32/debug-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698