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

Side by Side Diff: src/arm/code-stubs-arm.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 | « no previous file | src/code-stubs.h » ('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 // 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 static void EmitCheckForHeapNumber(MacroAssembler* masm, Register operand, 154 static void EmitCheckForHeapNumber(MacroAssembler* masm, Register operand,
155 Register scratch1, Register scratch2, 155 Register scratch1, Register scratch2,
156 Label* not_a_heap_number) { 156 Label* not_a_heap_number) {
157 __ ldr(scratch1, FieldMemOperand(operand, HeapObject::kMapOffset)); 157 __ ldr(scratch1, FieldMemOperand(operand, HeapObject::kMapOffset));
158 __ LoadRoot(scratch2, Heap::kHeapNumberMapRootIndex); 158 __ LoadRoot(scratch2, Heap::kHeapNumberMapRootIndex);
159 __ cmp(scratch1, scratch2); 159 __ cmp(scratch1, scratch2);
160 __ b(ne, not_a_heap_number); 160 __ b(ne, not_a_heap_number);
161 } 161 }
162 162
163 163
164 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
165 // Update the static counter each time a new code stub is generated.
166 Isolate* isolate = masm->isolate();
167 isolate->counters()->code_stubs()->Increment();
168
169 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(isolate);
170 int param_count = descriptor->register_param_count_;
171 {
172 // Call the runtime system in a fresh internal frame.
173 FrameScope scope(masm, StackFrame::INTERNAL);
174 ASSERT(descriptor->register_param_count_ == 0 ||
175 r0.is(descriptor->register_params_[param_count - 1]));
176 // Push arguments
177 for (int i = 0; i < param_count; ++i) {
178 __ push(descriptor->register_params_[i]);
179 }
180 ExternalReference miss = descriptor->miss_handler_;
181 __ CallExternalReference(miss, descriptor->register_param_count_);
182 }
183
184 __ Ret();
185 }
186
187
164 void ToNumberStub::Generate(MacroAssembler* masm) { 188 void ToNumberStub::Generate(MacroAssembler* masm) {
165 // The ToNumber stub takes one argument in eax. 189 // The ToNumber stub takes one argument in eax.
166 Label check_heap_number, call_builtin; 190 Label check_heap_number, call_builtin;
167 __ JumpIfNotSmi(r0, &check_heap_number); 191 __ JumpIfNotSmi(r0, &check_heap_number);
168 __ Ret(); 192 __ Ret();
169 193
170 __ bind(&check_heap_number); 194 __ bind(&check_heap_number);
171 EmitCheckForHeapNumber(masm, r0, r1, ip, &call_builtin); 195 EmitCheckForHeapNumber(masm, r0, r1, ip, &call_builtin);
172 __ Ret(); 196 __ Ret();
173 197
(...skipping 7352 matching lines...) Expand 10 before | Expand all | Expand 10 after
7526 7550
7527 __ Pop(lr, r5, r1); 7551 __ Pop(lr, r5, r1);
7528 __ Ret(); 7552 __ Ret();
7529 } 7553 }
7530 7554
7531 #undef __ 7555 #undef __
7532 7556
7533 } } // namespace v8::internal 7557 } } // namespace v8::internal
7534 7558
7535 #endif // V8_TARGET_ARCH_ARM 7559 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698