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

Side by Side Diff: src/arm/stub-cache-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/ic-arm.cc ('k') | src/arm64/code-stubs-arm64.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/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic-inl.h" 10 #include "src/ic-inl.h"
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 Register* StoreStubCompiler::registers() { 1287 Register* StoreStubCompiler::registers() {
1288 // receiver, name, scratch1, scratch2, scratch3. 1288 // receiver, name, scratch1, scratch2, scratch3.
1289 Register receiver = StoreIC::ReceiverRegister(); 1289 Register receiver = StoreIC::ReceiverRegister();
1290 Register name = StoreIC::NameRegister(); 1290 Register name = StoreIC::NameRegister();
1291 static Register registers[] = { receiver, name, r3, r4, r5 }; 1291 static Register registers[] = { receiver, name, r3, r4, r5 };
1292 return registers; 1292 return registers;
1293 } 1293 }
1294 1294
1295 1295
1296 Register* KeyedStoreStubCompiler::registers() { 1296 Register* KeyedStoreStubCompiler::registers() {
1297 // receiver, name, scratch1, scratch2, scratch3. 1297 // receiver, name, scratch1/map, scratch2, scratch3.
1298 Register receiver = KeyedStoreIC::ReceiverRegister(); 1298 Register receiver = KeyedStoreIC::ReceiverRegister();
1299 Register name = KeyedStoreIC::NameRegister(); 1299 Register name = KeyedStoreIC::NameRegister();
1300 static Register registers[] = { receiver, name, r3, r4, r5 }; 1300 Register map = KeyedStoreIC::MapRegister();
1301 static Register registers[] = { receiver, name, map, r4, r5 };
1301 return registers; 1302 return registers;
1302 } 1303 }
1303 1304
1304 1305
1305 #undef __ 1306 #undef __
1306 #define __ ACCESS_MASM(masm) 1307 #define __ ACCESS_MASM(masm)
1307 1308
1308 1309
1309 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, 1310 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
1310 Handle<HeapType> type, 1311 Handle<HeapType> type,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 if (check == PROPERTY && 1391 if (check == PROPERTY &&
1391 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) { 1392 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
1392 __ cmp(this->name(), Operand(name)); 1393 __ cmp(this->name(), Operand(name));
1393 __ b(ne, &miss); 1394 __ b(ne, &miss);
1394 } 1395 }
1395 1396
1396 Label number_case; 1397 Label number_case;
1397 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; 1398 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
1398 __ JumpIfSmi(receiver(), smi_target); 1399 __ JumpIfSmi(receiver(), smi_target);
1399 1400
1401 // Polymorphic keyed stores may use the map register
1400 Register map_reg = scratch1(); 1402 Register map_reg = scratch1();
1403 ASSERT(kind() != Code::KEYED_STORE_IC ||
1404 map_reg.is(KeyedStoreIC::MapRegister()));
1401 1405
1402 int receiver_count = types->length(); 1406 int receiver_count = types->length();
1403 int number_of_handled_maps = 0; 1407 int number_of_handled_maps = 0;
1404 __ ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); 1408 __ ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset));
1405 for (int current = 0; current < receiver_count; ++current) { 1409 for (int current = 0; current < receiver_count; ++current) {
1406 Handle<HeapType> type = types->at(current); 1410 Handle<HeapType> type = types->at(current);
1407 Handle<Map> map = IC::TypeToMap(*type, isolate()); 1411 Handle<Map> map = IC::TypeToMap(*type, isolate());
1408 if (!map->is_deprecated()) { 1412 if (!map->is_deprecated()) {
1409 number_of_handled_maps++; 1413 number_of_handled_maps++;
1410 __ mov(ip, Operand(map)); 1414 __ mov(ip, Operand(map));
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 1506
1503 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1507 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1504 } 1508 }
1505 1509
1506 1510
1507 #undef __ 1511 #undef __
1508 1512
1509 } } // namespace v8::internal 1513 } } // namespace v8::internal
1510 1514
1511 #endif // V8_TARGET_ARCH_ARM 1515 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/ic-arm.cc ('k') | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698