OLD | NEW |
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_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 Register* StoreStubCompiler::registers() { | 1306 Register* StoreStubCompiler::registers() { |
1307 // receiver, name, scratch1, scratch2, scratch3. | 1307 // receiver, name, scratch1, scratch2, scratch3. |
1308 Register receiver = StoreIC::ReceiverRegister(); | 1308 Register receiver = StoreIC::ReceiverRegister(); |
1309 Register name = StoreIC::NameRegister(); | 1309 Register name = StoreIC::NameRegister(); |
1310 static Register registers[] = { receiver, name, ebx, edi, no_reg }; | 1310 static Register registers[] = { receiver, name, ebx, edi, no_reg }; |
1311 return registers; | 1311 return registers; |
1312 } | 1312 } |
1313 | 1313 |
1314 | 1314 |
1315 Register* KeyedStoreStubCompiler::registers() { | 1315 Register* KeyedStoreStubCompiler::registers() { |
1316 // receiver, name, scratch1, scratch2, scratch3. | 1316 // receiver, name, scratch1/map, scratch2, scratch3. |
1317 Register receiver = KeyedStoreIC::ReceiverRegister(); | 1317 Register receiver = KeyedStoreIC::ReceiverRegister(); |
1318 Register name = KeyedStoreIC::NameRegister(); | 1318 Register name = KeyedStoreIC::NameRegister(); |
1319 static Register registers[] = { receiver, name, ebx, edi, no_reg }; | 1319 Register map = KeyedStoreIC::MapRegister(); |
| 1320 static Register registers[] = { receiver, name, map, edi, no_reg }; |
1320 return registers; | 1321 return registers; |
1321 } | 1322 } |
1322 | 1323 |
1323 | 1324 |
1324 #undef __ | 1325 #undef __ |
1325 #define __ ACCESS_MASM(masm) | 1326 #define __ ACCESS_MASM(masm) |
1326 | 1327 |
1327 | 1328 |
1328 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, | 1329 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, |
1329 Handle<HeapType> type, | 1330 Handle<HeapType> type, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1410 if (check == PROPERTY && | 1411 if (check == PROPERTY && |
1411 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) { | 1412 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) { |
1412 __ cmp(this->name(), Immediate(name)); | 1413 __ cmp(this->name(), Immediate(name)); |
1413 __ j(not_equal, &miss); | 1414 __ j(not_equal, &miss); |
1414 } | 1415 } |
1415 | 1416 |
1416 Label number_case; | 1417 Label number_case; |
1417 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; | 1418 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; |
1418 __ JumpIfSmi(receiver(), smi_target); | 1419 __ JumpIfSmi(receiver(), smi_target); |
1419 | 1420 |
| 1421 // Polymorphic keyed stores may use the map register |
1420 Register map_reg = scratch1(); | 1422 Register map_reg = scratch1(); |
| 1423 ASSERT(kind() != Code::KEYED_STORE_IC || |
| 1424 map_reg.is(KeyedStoreIC::MapRegister())); |
1421 __ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); | 1425 __ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); |
1422 int receiver_count = types->length(); | 1426 int receiver_count = types->length(); |
1423 int number_of_handled_maps = 0; | 1427 int number_of_handled_maps = 0; |
1424 for (int current = 0; current < receiver_count; ++current) { | 1428 for (int current = 0; current < receiver_count; ++current) { |
1425 Handle<HeapType> type = types->at(current); | 1429 Handle<HeapType> type = types->at(current); |
1426 Handle<Map> map = IC::TypeToMap(*type, isolate()); | 1430 Handle<Map> map = IC::TypeToMap(*type, isolate()); |
1427 if (!map->is_deprecated()) { | 1431 if (!map->is_deprecated()) { |
1428 number_of_handled_maps++; | 1432 number_of_handled_maps++; |
1429 __ cmp(map_reg, map); | 1433 __ cmp(map_reg, map); |
1430 if (type->Is(HeapType::Number())) { | 1434 if (type->Is(HeapType::Number())) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1494 // ----------------------------------- | 1498 // ----------------------------------- |
1495 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1499 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1496 } | 1500 } |
1497 | 1501 |
1498 | 1502 |
1499 #undef __ | 1503 #undef __ |
1500 | 1504 |
1501 } } // namespace v8::internal | 1505 } } // namespace v8::internal |
1502 | 1506 |
1503 #endif // V8_TARGET_ARCH_X87 | 1507 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |