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

Side by Side Diff: src/arm64/stub-cache-arm64.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/arm64/ic-arm64.cc ('k') | 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 7 #if V8_TARGET_ARCH_ARM64
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 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 Register* StoreStubCompiler::registers() { 1269 Register* StoreStubCompiler::registers() {
1270 // receiver, value, scratch1, scratch2, scratch3. 1270 // receiver, value, scratch1, scratch2, scratch3.
1271 Register receiver = StoreIC::ReceiverRegister(); 1271 Register receiver = StoreIC::ReceiverRegister();
1272 Register name = StoreIC::NameRegister(); 1272 Register name = StoreIC::NameRegister();
1273 static Register registers[] = { receiver, name, x3, x4, x5 }; 1273 static Register registers[] = { receiver, name, x3, x4, x5 };
1274 return registers; 1274 return registers;
1275 } 1275 }
1276 1276
1277 1277
1278 Register* KeyedStoreStubCompiler::registers() { 1278 Register* KeyedStoreStubCompiler::registers() {
1279 // receiver, name, scratch1, scratch2, scratch3. 1279 // receiver, name, scratch1/map, scratch2, scratch3.
1280 Register receiver = KeyedStoreIC::ReceiverRegister(); 1280 Register receiver = KeyedStoreIC::ReceiverRegister();
1281 Register name = KeyedStoreIC::NameRegister(); 1281 Register name = KeyedStoreIC::NameRegister();
1282 static Register registers[] = { receiver, name, x3, x4, x5 }; 1282 Register map = KeyedStoreIC::MapRegister();
1283 static Register registers[] = { receiver, name, map, x4, x5 };
1283 return registers; 1284 return registers;
1284 } 1285 }
1285 1286
1286 1287
1287 #undef __ 1288 #undef __
1288 #define __ ACCESS_MASM(masm) 1289 #define __ ACCESS_MASM(masm)
1289 1290
1290 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, 1291 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
1291 Handle<HeapType> type, 1292 Handle<HeapType> type,
1292 Register receiver, 1293 Register receiver,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 1364
1364 if (check == PROPERTY && 1365 if (check == PROPERTY &&
1365 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) { 1366 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
1366 __ CompareAndBranch(this->name(), Operand(name), ne, &miss); 1367 __ CompareAndBranch(this->name(), Operand(name), ne, &miss);
1367 } 1368 }
1368 1369
1369 Label number_case; 1370 Label number_case;
1370 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; 1371 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
1371 __ JumpIfSmi(receiver(), smi_target); 1372 __ JumpIfSmi(receiver(), smi_target);
1372 1373
1374 // Polymorphic keyed stores may use the map register
1373 Register map_reg = scratch1(); 1375 Register map_reg = scratch1();
1376 ASSERT(kind() != Code::KEYED_STORE_IC ||
1377 map_reg.is(KeyedStoreIC::MapRegister()));
1374 __ Ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); 1378 __ Ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset));
1375 int receiver_count = types->length(); 1379 int receiver_count = types->length();
1376 int number_of_handled_maps = 0; 1380 int number_of_handled_maps = 0;
1377 for (int current = 0; current < receiver_count; ++current) { 1381 for (int current = 0; current < receiver_count; ++current) {
1378 Handle<HeapType> type = types->at(current); 1382 Handle<HeapType> type = types->at(current);
1379 Handle<Map> map = IC::TypeToMap(*type, isolate()); 1383 Handle<Map> map = IC::TypeToMap(*type, isolate());
1380 if (!map->is_deprecated()) { 1384 if (!map->is_deprecated()) {
1381 number_of_handled_maps++; 1385 number_of_handled_maps++;
1382 Label try_next; 1386 Label try_next;
1383 __ Cmp(map_reg, Operand(map)); 1387 __ Cmp(map_reg, Operand(map));
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 1477
1474 // Miss case, call the runtime. 1478 // Miss case, call the runtime.
1475 __ Bind(&miss); 1479 __ Bind(&miss);
1476 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1480 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1477 } 1481 }
1478 1482
1479 1483
1480 } } // namespace v8::internal 1484 } } // namespace v8::internal
1481 1485
1482 #endif // V8_TARGET_ARCH_ARM64 1486 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm64/ic-arm64.cc ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698