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

Side by Side Diff: src/ia32/stub-cache-ia32.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/ia32/ic-ia32.cc ('k') | src/ic.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 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_IA32 7 #if V8_TARGET_ARCH_IA32
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 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 Register* StoreStubCompiler::registers() { 1307 Register* StoreStubCompiler::registers() {
1308 // receiver, name, scratch1, scratch2, scratch3. 1308 // receiver, name, scratch1, scratch2, scratch3.
1309 Register receiver = StoreIC::ReceiverRegister(); 1309 Register receiver = StoreIC::ReceiverRegister();
1310 Register name = StoreIC::NameRegister(); 1310 Register name = StoreIC::NameRegister();
1311 static Register registers[] = { receiver, name, ebx, edi, no_reg }; 1311 static Register registers[] = { receiver, name, ebx, edi, no_reg };
1312 return registers; 1312 return registers;
1313 } 1313 }
1314 1314
1315 1315
1316 Register* KeyedStoreStubCompiler::registers() { 1316 Register* KeyedStoreStubCompiler::registers() {
1317 // receiver, name, scratch1, scratch2, scratch3. 1317 // receiver, name, scratch1/map, scratch2, scratch3.
1318 Register receiver = KeyedStoreIC::ReceiverRegister(); 1318 Register receiver = KeyedStoreIC::ReceiverRegister();
1319 Register name = KeyedStoreIC::NameRegister(); 1319 Register name = KeyedStoreIC::NameRegister();
1320 static Register registers[] = { receiver, name, ebx, edi, no_reg }; 1320 Register map = KeyedStoreIC::MapRegister();
1321 static Register registers[] = { receiver, name, map, edi, no_reg };
1321 return registers; 1322 return registers;
1322 } 1323 }
1323 1324
1324 1325
1325 #undef __ 1326 #undef __
1326 #define __ ACCESS_MASM(masm) 1327 #define __ ACCESS_MASM(masm)
1327 1328
1328 1329
1329 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, 1330 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
1330 Handle<HeapType> type, 1331 Handle<HeapType> type,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 if (check == PROPERTY && 1412 if (check == PROPERTY &&
1412 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) { 1413 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
1413 __ cmp(this->name(), Immediate(name)); 1414 __ cmp(this->name(), Immediate(name));
1414 __ j(not_equal, &miss); 1415 __ j(not_equal, &miss);
1415 } 1416 }
1416 1417
1417 Label number_case; 1418 Label number_case;
1418 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; 1419 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
1419 __ JumpIfSmi(receiver(), smi_target); 1420 __ JumpIfSmi(receiver(), smi_target);
1420 1421
1422 // Polymorphic keyed stores may use the map register
1421 Register map_reg = scratch1(); 1423 Register map_reg = scratch1();
1424 ASSERT(kind() != Code::KEYED_STORE_IC ||
1425 map_reg.is(KeyedStoreIC::MapRegister()));
1422 __ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); 1426 __ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset));
1423 int receiver_count = types->length(); 1427 int receiver_count = types->length();
1424 int number_of_handled_maps = 0; 1428 int number_of_handled_maps = 0;
1425 for (int current = 0; current < receiver_count; ++current) { 1429 for (int current = 0; current < receiver_count; ++current) {
1426 Handle<HeapType> type = types->at(current); 1430 Handle<HeapType> type = types->at(current);
1427 Handle<Map> map = IC::TypeToMap(*type, isolate()); 1431 Handle<Map> map = IC::TypeToMap(*type, isolate());
1428 if (!map->is_deprecated()) { 1432 if (!map->is_deprecated()) {
1429 number_of_handled_maps++; 1433 number_of_handled_maps++;
1430 __ cmp(map_reg, map); 1434 __ cmp(map_reg, map);
1431 if (type->Is(HeapType::Number())) { 1435 if (type->Is(HeapType::Number())) {
(...skipping 63 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_IA32 1508 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/ic-ia32.cc ('k') | src/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698