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

Side by Side Diff: src/ic/arm/handler-compiler-arm.cc

Issue 486213003: Move register conventions out of the IC classes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. Created 6 years, 3 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/arm/access-compiler-arm.cc ('k') | src/ic/arm/ic-arm.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include "src/ic/call-optimization.h" 9 #include "src/ic/call-optimization.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 CallApiFunctionStub stub(isolate, is_store, call_data_undefined, argc); 284 CallApiFunctionStub stub(isolate, is_store, call_data_undefined, argc);
285 __ TailCallStub(&stub); 285 __ TailCallStub(&stub);
286 } 286 }
287 287
288 288
289 void ElementHandlerCompiler::GenerateLoadDictionaryElement( 289 void ElementHandlerCompiler::GenerateLoadDictionaryElement(
290 MacroAssembler* masm) { 290 MacroAssembler* masm) {
291 // The return address is in lr. 291 // The return address is in lr.
292 Label slow, miss; 292 Label slow, miss;
293 293
294 Register key = LoadIC::NameRegister(); 294 Register key = LoadConvention::NameRegister();
295 Register receiver = LoadIC::ReceiverRegister(); 295 Register receiver = LoadConvention::ReceiverRegister();
296 DCHECK(receiver.is(r1)); 296 DCHECK(receiver.is(r1));
297 DCHECK(key.is(r2)); 297 DCHECK(key.is(r2));
298 298
299 __ UntagAndJumpIfNotSmi(r6, key, &miss); 299 __ UntagAndJumpIfNotSmi(r6, key, &miss);
300 __ ldr(r4, FieldMemOperand(receiver, JSObject::kElementsOffset)); 300 __ ldr(r4, FieldMemOperand(receiver, JSObject::kElementsOffset));
301 __ LoadFromNumberDictionary(&slow, r4, key, r0, r6, r3, r5); 301 __ LoadFromNumberDictionary(&slow, r4, key, r0, r6, r3, r5);
302 __ Ret(); 302 __ Ret();
303 303
304 __ bind(&slow); 304 __ bind(&slow);
305 __ IncrementCounter( 305 __ IncrementCounter(
306 masm->isolate()->counters()->keyed_load_external_array_slow(), 1, r2, r3); 306 masm->isolate()->counters()->keyed_load_external_array_slow(), 1, r2, r3);
307 307
308 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow); 308 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow);
309 309
310 // Miss case, call the runtime. 310 // Miss case, call the runtime.
311 __ bind(&miss); 311 __ bind(&miss);
312 312
313 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 313 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
314 } 314 }
315 315
316 316
317 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { 317 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
318 // Push receiver, key and value for runtime call. 318 // Push receiver, key and value for runtime call.
319 __ Push(StoreIC::ReceiverRegister(), StoreIC::NameRegister(), 319 __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(),
320 StoreIC::ValueRegister()); 320 StoreConvention::ValueRegister());
321 321
322 // The slow case calls into the runtime to complete the store without causing 322 // The slow case calls into the runtime to complete the store without causing
323 // an IC miss that would otherwise cause a transition to the generic stub. 323 // an IC miss that would otherwise cause a transition to the generic stub.
324 ExternalReference ref = 324 ExternalReference ref =
325 ExternalReference(IC_Utility(IC::kStoreIC_Slow), masm->isolate()); 325 ExternalReference(IC_Utility(IC::kStoreIC_Slow), masm->isolate());
326 __ TailCallExternalReference(ref, 3, 1); 326 __ TailCallExternalReference(ref, 3, 1);
327 } 327 }
328 328
329 329
330 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { 330 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
331 // Push receiver, key and value for runtime call. 331 // Push receiver, key and value for runtime call.
332 __ Push(StoreIC::ReceiverRegister(), StoreIC::NameRegister(), 332 __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(),
333 StoreIC::ValueRegister()); 333 StoreConvention::ValueRegister());
334 334
335 // The slow case calls into the runtime to complete the store without causing 335 // The slow case calls into the runtime to complete the store without causing
336 // an IC miss that would otherwise cause a transition to the generic stub. 336 // an IC miss that would otherwise cause a transition to the generic stub.
337 ExternalReference ref = 337 ExternalReference ref =
338 ExternalReference(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate()); 338 ExternalReference(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate());
339 __ TailCallExternalReference(ref, 3, 1); 339 __ TailCallExternalReference(ref, 3, 1);
340 } 340 }
341 341
342 342
343 #undef __ 343 #undef __
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 // Do tail-call to the runtime system. 821 // Do tail-call to the runtime system.
822 ExternalReference store_ic_property = ExternalReference( 822 ExternalReference store_ic_property = ExternalReference(
823 IC_Utility(IC::kStorePropertyWithInterceptor), isolate()); 823 IC_Utility(IC::kStorePropertyWithInterceptor), isolate());
824 __ TailCallExternalReference(store_ic_property, 3, 1); 824 __ TailCallExternalReference(store_ic_property, 3, 1);
825 825
826 // Return the generated code. 826 // Return the generated code.
827 return GetCode(kind(), Code::FAST, name); 827 return GetCode(kind(), Code::FAST, name);
828 } 828 }
829 829
830 830
831 Register NamedStoreHandlerCompiler::value() { return StoreIC::ValueRegister(); } 831 Register NamedStoreHandlerCompiler::value() {
832 return StoreConvention::ValueRegister();
833 }
832 834
833 835
834 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( 836 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal(
835 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { 837 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) {
836 Label miss; 838 Label miss;
837 FrontendHeader(receiver(), name, &miss); 839 FrontendHeader(receiver(), name, &miss);
838 840
839 // Get the value from the cell. 841 // Get the value from the cell.
840 Register result = StoreIC::ValueRegister(); 842 Register result = StoreConvention::ValueRegister();
841 __ mov(result, Operand(cell)); 843 __ mov(result, Operand(cell));
842 __ ldr(result, FieldMemOperand(result, Cell::kValueOffset)); 844 __ ldr(result, FieldMemOperand(result, Cell::kValueOffset));
843 845
844 // Check for deleted property if property can actually be deleted. 846 // Check for deleted property if property can actually be deleted.
845 if (is_configurable) { 847 if (is_configurable) {
846 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); 848 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
847 __ cmp(result, ip); 849 __ cmp(result, ip);
848 __ b(eq, &miss); 850 __ b(eq, &miss);
849 } 851 }
850 852
851 Counters* counters = isolate()->counters(); 853 Counters* counters = isolate()->counters();
852 __ IncrementCounter(counters->named_load_global_stub(), 1, r1, r3); 854 __ IncrementCounter(counters->named_load_global_stub(), 1, r1, r3);
853 __ Ret(); 855 __ Ret();
854 856
855 FrontendFooter(name, &miss); 857 FrontendFooter(name, &miss);
856 858
857 // Return the generated code. 859 // Return the generated code.
858 return GetCode(kind(), Code::NORMAL, name); 860 return GetCode(kind(), Code::NORMAL, name);
859 } 861 }
860 862
861 863
862 #undef __ 864 #undef __
863 } 865 }
864 } // namespace v8::internal 866 } // namespace v8::internal
865 867
866 #endif // V8_TARGET_ARCH_ARM 868 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/ic/arm/access-compiler-arm.cc ('k') | src/ic/arm/ic-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698