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