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

Side by Side Diff: src/mips64/stub-cache-mips64.cc

Issue 390263002: MIPS: 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/mips64/ic-mips64.cc ('k') | no next file » | 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_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
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 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 Register* StoreStubCompiler::registers() { 1277 Register* StoreStubCompiler::registers() {
1278 // receiver, name, scratch1, scratch2, scratch3. 1278 // receiver, name, scratch1, scratch2, scratch3.
1279 Register receiver = StoreIC::ReceiverRegister(); 1279 Register receiver = StoreIC::ReceiverRegister();
1280 Register name = StoreIC::NameRegister(); 1280 Register name = StoreIC::NameRegister();
1281 static Register registers[] = { receiver, name, a3, a4, a5 }; 1281 static Register registers[] = { receiver, name, a3, a4, a5 };
1282 return registers; 1282 return registers;
1283 } 1283 }
1284 1284
1285 1285
1286 Register* KeyedStoreStubCompiler::registers() { 1286 Register* KeyedStoreStubCompiler::registers() {
1287 // receiver, name, scratch1, scratch2, scratch3. 1287 // receiver, name, scratch1/map, scratch2, scratch3.
1288 Register receiver = KeyedStoreIC::ReceiverRegister(); 1288 Register receiver = KeyedStoreIC::ReceiverRegister();
1289 Register name = KeyedStoreIC::NameRegister(); 1289 Register name = KeyedStoreIC::NameRegister();
1290 static Register registers[] = { receiver, name, a3, a4, a5 }; 1290 Register map = KeyedStoreIC::MapRegister();
1291 static Register registers[] = { receiver, name, map, a4, a5 };
1291 return registers; 1292 return registers;
1292 } 1293 }
1293 1294
1294 1295
1295 #undef __ 1296 #undef __
1296 #define __ ACCESS_MASM(masm) 1297 #define __ ACCESS_MASM(masm)
1297 1298
1298 1299
1299 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, 1300 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
1300 Handle<HeapType> type, 1301 Handle<HeapType> type,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 if (check == PROPERTY && 1381 if (check == PROPERTY &&
1381 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) { 1382 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
1382 __ Branch(&miss, ne, this->name(), Operand(name)); 1383 __ Branch(&miss, ne, this->name(), Operand(name));
1383 } 1384 }
1384 1385
1385 Label number_case; 1386 Label number_case;
1386 Register match = scratch1(); 1387 Register match = scratch1();
1387 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; 1388 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
1388 __ JumpIfSmi(receiver(), smi_target, match); // Reg match is 0 if Smi. 1389 __ JumpIfSmi(receiver(), smi_target, match); // Reg match is 0 if Smi.
1389 1390
1391 // Polymorphic keyed stores may use the map register
1390 Register map_reg = scratch2(); 1392 Register map_reg = scratch2();
1393 ASSERT(kind() != Code::KEYED_STORE_IC ||
1394 map_reg.is(KeyedStoreIC::MapRegister()));
1391 1395
1392 int receiver_count = types->length(); 1396 int receiver_count = types->length();
1393 int number_of_handled_maps = 0; 1397 int number_of_handled_maps = 0;
1394 __ ld(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); 1398 __ ld(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset));
1395 for (int current = 0; current < receiver_count; ++current) { 1399 for (int current = 0; current < receiver_count; ++current) {
1396 Handle<HeapType> type = types->at(current); 1400 Handle<HeapType> type = types->at(current);
1397 Handle<Map> map = IC::TypeToMap(*type, isolate()); 1401 Handle<Map> map = IC::TypeToMap(*type, isolate());
1398 if (!map->is_deprecated()) { 1402 if (!map->is_deprecated()) {
1399 number_of_handled_maps++; 1403 number_of_handled_maps++;
1400 // Check map and tail call if there's a match. 1404 // Check map and tail call if there's a match.
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1495 1499
1496 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1500 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1497 } 1501 }
1498 1502
1499 1503
1500 #undef __ 1504 #undef __
1501 1505
1502 } } // namespace v8::internal 1506 } } // namespace v8::internal
1503 1507
1504 #endif // V8_TARGET_ARCH_MIPS64 1508 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/ic-mips64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698