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

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

Issue 13886013: Add infrastructure to automatucally generate IC miss stubs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review feedback Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « src/ic.cc ('k') | no next file » | 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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( 130 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
131 Isolate* isolate, 131 Isolate* isolate,
132 CodeStubInterfaceDescriptor* descriptor) { 132 CodeStubInterfaceDescriptor* descriptor) {
133 InitializeArrayConstructorDescriptor(isolate, descriptor); 133 InitializeArrayConstructorDescriptor(isolate, descriptor);
134 } 134 }
135 135
136 136
137 #define __ ACCESS_MASM(masm) 137 #define __ ACCESS_MASM(masm)
138 138
139
140 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
141 // Update the static counter each time a new code stub is generated.
142 Isolate* isolate = masm->isolate();
143 isolate->counters()->code_stubs()->Increment();
144
145 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(isolate);
146 int param_count = descriptor->register_param_count_;
147 {
148 // Call the runtime system in a fresh internal frame.
149 FrameScope scope(masm, StackFrame::INTERNAL);
150 ASSERT(descriptor->register_param_count_ == 0 ||
151 rax.is(descriptor->register_params_[param_count - 1]));
152 // Push arguments
153 for (int i = 0; i < param_count; ++i) {
154 __ push(descriptor->register_params_[i]);
155 }
156 ExternalReference miss = descriptor->miss_handler_;
157 __ CallExternalReference(miss, descriptor->register_param_count_);
158 }
159
160 __ Ret();
161 }
162
163
139 void ToNumberStub::Generate(MacroAssembler* masm) { 164 void ToNumberStub::Generate(MacroAssembler* masm) {
140 // The ToNumber stub takes one argument in eax. 165 // The ToNumber stub takes one argument in eax.
141 Label check_heap_number, call_builtin; 166 Label check_heap_number, call_builtin;
142 __ SmiTest(rax); 167 __ SmiTest(rax);
143 __ j(not_zero, &check_heap_number, Label::kNear); 168 __ j(not_zero, &check_heap_number, Label::kNear);
144 __ Ret(); 169 __ Ret();
145 170
146 __ bind(&check_heap_number); 171 __ bind(&check_heap_number);
147 __ CompareRoot(FieldOperand(rax, HeapObject::kMapOffset), 172 __ CompareRoot(FieldOperand(rax, HeapObject::kMapOffset),
148 Heap::kHeapNumberMapRootIndex); 173 Heap::kHeapNumberMapRootIndex);
(...skipping 6594 matching lines...) Expand 10 before | Expand all | Expand 10 after
6743 #endif 6768 #endif
6744 6769
6745 __ Ret(); 6770 __ Ret();
6746 } 6771 }
6747 6772
6748 #undef __ 6773 #undef __
6749 6774
6750 } } // namespace v8::internal 6775 } } // namespace v8::internal
6751 6776
6752 #endif // V8_TARGET_ARCH_X64 6777 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698