| 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/ic/ic-compiler.h" | 9 #include "src/ic/ic-compiler.h" |
| 10 | 10 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 namespace internal { | 12 namespace internal { |
| 13 | 13 |
| 14 #define __ ACCESS_MASM(masm) | 14 #define __ ACCESS_MASM(masm) |
| 15 | 15 |
| 16 | 16 |
| 17 void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm, | 17 void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm, |
| 18 StrictMode strict_mode) { | 18 StrictMode strict_mode) { |
| 19 // Return address is on the stack. | 19 // Return address is on the stack. |
| 20 DCHECK(!ebx.is(StoreIC::ReceiverRegister()) && | 20 DCHECK(!ebx.is(StoreConvention::ReceiverRegister()) && |
| 21 !ebx.is(StoreIC::NameRegister()) && !ebx.is(StoreIC::ValueRegister())); | 21 !ebx.is(StoreConvention::NameRegister()) && |
| 22 !ebx.is(StoreConvention::ValueRegister())); |
| 22 __ pop(ebx); | 23 __ pop(ebx); |
| 23 __ push(StoreIC::ReceiverRegister()); | 24 __ push(StoreConvention::ReceiverRegister()); |
| 24 __ push(StoreIC::NameRegister()); | 25 __ push(StoreConvention::NameRegister()); |
| 25 __ push(StoreIC::ValueRegister()); | 26 __ push(StoreConvention::ValueRegister()); |
| 26 __ push(Immediate(Smi::FromInt(strict_mode))); | 27 __ push(Immediate(Smi::FromInt(strict_mode))); |
| 27 __ push(ebx); // return address | 28 __ push(ebx); // return address |
| 28 | 29 |
| 29 // Do tail-call to runtime routine. | 30 // Do tail-call to runtime routine. |
| 30 __ TailCallRuntime(Runtime::kSetProperty, 4, 1); | 31 __ TailCallRuntime(Runtime::kSetProperty, 4, 1); |
| 31 } | 32 } |
| 32 | 33 |
| 33 | 34 |
| 34 #undef __ | 35 #undef __ |
| 35 #define __ ACCESS_MASM(masm()) | 36 #define __ ACCESS_MASM(masm()) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 53 } | 54 } |
| 54 } | 55 } |
| 55 | 56 |
| 56 Label number_case; | 57 Label number_case; |
| 57 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; | 58 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; |
| 58 __ JumpIfSmi(receiver(), smi_target); | 59 __ JumpIfSmi(receiver(), smi_target); |
| 59 | 60 |
| 60 // Polymorphic keyed stores may use the map register | 61 // Polymorphic keyed stores may use the map register |
| 61 Register map_reg = scratch1(); | 62 Register map_reg = scratch1(); |
| 62 DCHECK(kind() != Code::KEYED_STORE_IC || | 63 DCHECK(kind() != Code::KEYED_STORE_IC || |
| 63 map_reg.is(KeyedStoreIC::MapRegister())); | 64 map_reg.is(StoreConvention::MapRegister())); |
| 64 __ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); | 65 __ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); |
| 65 int receiver_count = types->length(); | 66 int receiver_count = types->length(); |
| 66 int number_of_handled_maps = 0; | 67 int number_of_handled_maps = 0; |
| 67 for (int current = 0; current < receiver_count; ++current) { | 68 for (int current = 0; current < receiver_count; ++current) { |
| 68 Handle<HeapType> type = types->at(current); | 69 Handle<HeapType> type = types->at(current); |
| 69 Handle<Map> map = IC::TypeToMap(*type, isolate()); | 70 Handle<Map> map = IC::TypeToMap(*type, isolate()); |
| 70 if (!map->is_deprecated()) { | 71 if (!map->is_deprecated()) { |
| 71 number_of_handled_maps++; | 72 number_of_handled_maps++; |
| 72 __ cmp(map_reg, map); | 73 __ cmp(map_reg, map); |
| 73 if (type->Is(HeapType::Number())) { | 74 if (type->Is(HeapType::Number())) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // Return the generated code. | 114 // Return the generated code. |
| 114 return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); | 115 return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); |
| 115 } | 116 } |
| 116 | 117 |
| 117 | 118 |
| 118 #undef __ | 119 #undef __ |
| 119 } | 120 } |
| 120 } // namespace v8::internal | 121 } // namespace v8::internal |
| 121 | 122 |
| 122 #endif // V8_TARGET_ARCH_X87 | 123 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |