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

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

Issue 390013002: Use the same registers for StoreIC and KeyedStoreIC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/stub-cache-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 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_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include "src/arm/assembler-arm.h" 9 #include "src/arm/assembler-arm.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 __ Ret(); 493 __ Ret();
494 __ bind(&slow); 494 __ bind(&slow);
495 GenerateMiss(masm); 495 GenerateMiss(masm);
496 } 496 }
497 497
498 498
499 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { 499 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) {
500 Register receiver = ReceiverRegister(); 500 Register receiver = ReceiverRegister();
501 Register key = NameRegister(); 501 Register key = NameRegister();
502 Register value = ValueRegister(); 502 Register value = ValueRegister();
503 ASSERT(receiver.is(r2)); 503 ASSERT(receiver.is(r1));
504 ASSERT(key.is(r1)); 504 ASSERT(key.is(r2));
505 ASSERT(value.is(r0)); 505 ASSERT(value.is(r0));
506 506
507 Label slow, notin; 507 Label slow, notin;
508 MemOperand mapped_location = GenerateMappedArgumentsLookup( 508 MemOperand mapped_location = GenerateMappedArgumentsLookup(
509 masm, receiver, key, r3, r4, r5, &notin, &slow); 509 masm, receiver, key, r3, r4, r5, &notin, &slow);
510 __ str(value, mapped_location); 510 __ str(value, mapped_location);
511 __ add(r6, r3, r5); 511 __ add(r6, r3, r5);
512 __ mov(r9, value); 512 __ mov(r9, value);
513 __ RecordWrite(r3, r6, r9, kLRHasNotBeenSaved, kDontSaveFPRegs); 513 __ RecordWrite(r3, r6, r9, kLRHasNotBeenSaved, kDontSaveFPRegs);
514 __ Ret(); 514 __ Ret();
(...skipping 30 matching lines...) Expand all
545 // IC register specifications 545 // IC register specifications
546 const Register LoadIC::ReceiverRegister() { return r1; } 546 const Register LoadIC::ReceiverRegister() { return r1; }
547 const Register LoadIC::NameRegister() { return r2; } 547 const Register LoadIC::NameRegister() { return r2; }
548 548
549 549
550 const Register StoreIC::ReceiverRegister() { return r1; } 550 const Register StoreIC::ReceiverRegister() { return r1; }
551 const Register StoreIC::NameRegister() { return r2; } 551 const Register StoreIC::NameRegister() { return r2; }
552 const Register StoreIC::ValueRegister() { return r0; } 552 const Register StoreIC::ValueRegister() { return r0; }
553 553
554 554
555 const Register KeyedStoreIC::ReceiverRegister() { return r2; } 555 const Register KeyedStoreIC::ReceiverRegister() {
556 const Register KeyedStoreIC::NameRegister() { return r1; } 556 return StoreIC::ReceiverRegister();
557 const Register KeyedStoreIC::ValueRegister() { return r0; } 557 }
558
559
560 const Register KeyedStoreIC::NameRegister() {
561 return StoreIC::NameRegister();
562 }
563
564
565 const Register KeyedStoreIC::ValueRegister() {
566 return StoreIC::ValueRegister();
567 }
568
569
570 const Register KeyedStoreIC::MapRegister() {
571 return r3;
572 }
558 573
559 574
560 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { 575 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
561 // The return address is in lr. 576 // The return address is in lr.
562 577
563 __ Push(ReceiverRegister(), NameRegister()); 578 __ Push(ReceiverRegister(), NameRegister());
564 579
565 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); 580 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1);
566 } 581 }
567 582
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 // -- lr : return address 1035 // -- lr : return address
1021 // ----------------------------------- 1036 // -----------------------------------
1022 Label slow, fast_object, fast_object_grow; 1037 Label slow, fast_object, fast_object_grow;
1023 Label fast_double, fast_double_grow; 1038 Label fast_double, fast_double_grow;
1024 Label array, extra, check_if_double_array; 1039 Label array, extra, check_if_double_array;
1025 1040
1026 // Register usage. 1041 // Register usage.
1027 Register value = ValueRegister(); 1042 Register value = ValueRegister();
1028 Register key = NameRegister(); 1043 Register key = NameRegister();
1029 Register receiver = ReceiverRegister(); 1044 Register receiver = ReceiverRegister();
1030 ASSERT(receiver.is(r2)); 1045 ASSERT(receiver.is(r1));
1031 ASSERT(key.is(r1)); 1046 ASSERT(key.is(r2));
1032 ASSERT(value.is(r0)); 1047 ASSERT(value.is(r0));
1033 Register receiver_map = r3; 1048 Register receiver_map = r3;
1034 Register elements_map = r6; 1049 Register elements_map = r6;
1035 Register elements = r9; // Elements array of the receiver. 1050 Register elements = r9; // Elements array of the receiver.
1036 // r4 and r5 are used as general scratch registers. 1051 // r4 and r5 are used as general scratch registers.
1037 1052
1038 // Check that the key is a smi. 1053 // Check that the key is a smi.
1039 __ JumpIfNotSmi(key, &slow); 1054 __ JumpIfNotSmi(key, &slow);
1040 // Check that the object isn't a smi. 1055 // Check that the object isn't a smi.
1041 __ JumpIfSmi(receiver, &slow); 1056 __ JumpIfSmi(receiver, &slow);
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 } else { 1285 } else {
1271 ASSERT(Assembler::GetCondition(branch_instr) == ne); 1286 ASSERT(Assembler::GetCondition(branch_instr) == ne);
1272 patcher.EmitCondition(eq); 1287 patcher.EmitCondition(eq);
1273 } 1288 }
1274 } 1289 }
1275 1290
1276 1291
1277 } } // namespace v8::internal 1292 } } // namespace v8::internal
1278 1293
1279 #endif // V8_TARGET_ARCH_ARM 1294 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698