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

Side by Side Diff: src/x64/code-stubs-x64.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/snapshot/serialize.cc ('k') | src/x64/debug-x64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 STATIC_ASSERT(kSmiValueSize <= 32); 881 STATIC_ASSERT(kSmiValueSize <= 32);
882 __ JumpUnlessNonNegativeSmi(key, &slow); 882 __ JumpUnlessNonNegativeSmi(key, &slow);
883 883
884 // Everything is fine, call runtime. 884 // Everything is fine, call runtime.
885 __ PopReturnAddressTo(scratch); 885 __ PopReturnAddressTo(scratch);
886 __ Push(receiver); // receiver 886 __ Push(receiver); // receiver
887 __ Push(key); // key 887 __ Push(key); // key
888 __ PushReturnAddressFrom(scratch); 888 __ PushReturnAddressFrom(scratch);
889 889
890 // Perform tail call to the entry. 890 // Perform tail call to the entry.
891 __ TailCallExternalReference( 891 __ TailCallRuntime(Runtime::kLoadElementWithInterceptor, 2, 1);
892 ExternalReference(IC_Utility(IC::kLoadElementWithInterceptor),
893 masm->isolate()),
894 2, 1);
895 892
896 __ bind(&slow); 893 __ bind(&slow);
897 PropertyAccessCompiler::TailCallBuiltin( 894 PropertyAccessCompiler::TailCallBuiltin(
898 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); 895 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC));
899 } 896 }
900 897
901 898
902 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { 899 void LoadIndexedStringStub::Generate(MacroAssembler* masm) {
903 // Return address is on the stack. 900 // Return address is on the stack.
904 Label miss; 901 Label miss;
(...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after
2323 void CallICStub::GenerateMiss(MacroAssembler* masm) { 2320 void CallICStub::GenerateMiss(MacroAssembler* masm) {
2324 FrameScope scope(masm, StackFrame::INTERNAL); 2321 FrameScope scope(masm, StackFrame::INTERNAL);
2325 2322
2326 // Push the receiver and the function and feedback info. 2323 // Push the receiver and the function and feedback info.
2327 __ Push(rdi); 2324 __ Push(rdi);
2328 __ Push(rbx); 2325 __ Push(rbx);
2329 __ Integer32ToSmi(rdx, rdx); 2326 __ Integer32ToSmi(rdx, rdx);
2330 __ Push(rdx); 2327 __ Push(rdx);
2331 2328
2332 // Call the entry. 2329 // Call the entry.
2333 IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss 2330 Runtime::FunctionId id = GetICState() == DEFAULT
2334 : IC::kCallIC_Customization_Miss; 2331 ? Runtime::kCallIC_Miss
2335 2332 : Runtime::kCallIC_Customization_Miss;
2336 ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate()); 2333 __ CallRuntime(id, 3);
2337 __ CallExternalReference(miss, 3);
2338 2334
2339 // Move result to edi and exit the internal frame. 2335 // Move result to edi and exit the internal frame.
2340 __ movp(rdi, rax); 2336 __ movp(rdi, rax);
2341 } 2337 }
2342 2338
2343 2339
2344 bool CEntryStub::NeedsImmovableCode() { 2340 bool CEntryStub::NeedsImmovableCode() {
2345 return false; 2341 return false;
2346 } 2342 }
2347 2343
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after
3853 __ ret(0); 3849 __ ret(0);
3854 3850
3855 __ bind(&miss); 3851 __ bind(&miss);
3856 GenerateMiss(masm); 3852 GenerateMiss(masm);
3857 } 3853 }
3858 3854
3859 3855
3860 void CompareICStub::GenerateMiss(MacroAssembler* masm) { 3856 void CompareICStub::GenerateMiss(MacroAssembler* masm) {
3861 { 3857 {
3862 // Call the runtime system in a fresh internal frame. 3858 // Call the runtime system in a fresh internal frame.
3863 ExternalReference miss =
3864 ExternalReference(IC_Utility(IC::kCompareIC_Miss), isolate());
3865
3866 FrameScope scope(masm, StackFrame::INTERNAL); 3859 FrameScope scope(masm, StackFrame::INTERNAL);
3867 __ Push(rdx); 3860 __ Push(rdx);
3868 __ Push(rax); 3861 __ Push(rax);
3869 __ Push(rdx); 3862 __ Push(rdx);
3870 __ Push(rax); 3863 __ Push(rax);
3871 __ Push(Smi::FromInt(op())); 3864 __ Push(Smi::FromInt(op()));
3872 __ CallExternalReference(miss, 3); 3865 __ CallRuntime(Runtime::kCompareIC_Miss, 3);
3873 3866
3874 // Compute the entry point of the rewritten stub. 3867 // Compute the entry point of the rewritten stub.
3875 __ leap(rdi, FieldOperand(rax, Code::kHeaderSize)); 3868 __ leap(rdi, FieldOperand(rax, Code::kHeaderSize));
3876 __ Pop(rax); 3869 __ Pop(rax);
3877 __ Pop(rdx); 3870 __ Pop(rdx);
3878 } 3871 }
3879 3872
3880 // Do a tail call to the rewritten stub. 3873 // Do a tail call to the rewritten stub.
3881 __ jmp(rdi); 3874 __ jmp(rdi);
3882 } 3875 }
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after
5432 kStackSpace, nullptr, return_value_operand, NULL); 5425 kStackSpace, nullptr, return_value_operand, NULL);
5433 } 5426 }
5434 5427
5435 5428
5436 #undef __ 5429 #undef __
5437 5430
5438 } // namespace internal 5431 } // namespace internal
5439 } // namespace v8 5432 } // namespace v8
5440 5433
5441 #endif // V8_TARGET_ARCH_X64 5434 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/snapshot/serialize.cc ('k') | src/x64/debug-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698