| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // |
| 3 // Copyright IBM Corp. 2012, 2013. All rights reserved. |
| 4 // |
| 2 // Use of this source code is governed by a BSD-style license that can be | 5 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 6 // found in the LICENSE file. |
| 4 | 7 |
| 5 #include "src/v8.h" | 8 #include "src/v8.h" |
| 6 | 9 |
| 7 #if V8_TARGET_ARCH_ARM | 10 #if V8_TARGET_ARCH_PPC |
| 8 | 11 |
| 12 #include "src/ic/ic.h" |
| 9 #include "src/ic/ic-compiler.h" | 13 #include "src/ic/ic-compiler.h" |
| 10 | 14 |
| 11 namespace v8 { | 15 namespace v8 { |
| 12 namespace internal { | 16 namespace internal { |
| 13 | 17 |
| 14 #define __ ACCESS_MASM(masm) | 18 #define __ ACCESS_MASM(masm) |
| 15 | 19 |
| 16 | 20 |
| 17 void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm, | 21 void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm, |
| 18 StrictMode strict_mode) { | 22 StrictMode strict_mode) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 38 IcCheckType check) { | 42 IcCheckType check) { |
| 39 Label miss; | 43 Label miss; |
| 40 | 44 |
| 41 if (check == PROPERTY && | 45 if (check == PROPERTY && |
| 42 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) { | 46 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) { |
| 43 // In case we are compiling an IC for dictionary loads and stores, just | 47 // In case we are compiling an IC for dictionary loads and stores, just |
| 44 // check whether the name is unique. | 48 // check whether the name is unique. |
| 45 if (name.is_identical_to(isolate()->factory()->normal_ic_symbol())) { | 49 if (name.is_identical_to(isolate()->factory()->normal_ic_symbol())) { |
| 46 __ JumpIfNotUniqueName(this->name(), &miss); | 50 __ JumpIfNotUniqueName(this->name(), &miss); |
| 47 } else { | 51 } else { |
| 48 __ cmp(this->name(), Operand(name)); | 52 __ Cmpi(this->name(), Operand(name), r0); |
| 49 __ b(ne, &miss); | 53 __ bne(&miss); |
| 50 } | 54 } |
| 51 } | 55 } |
| 52 | 56 |
| 53 Label number_case; | 57 Label number_case; |
| 54 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; | 58 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; |
| 55 __ JumpIfSmi(receiver(), smi_target); | 59 __ JumpIfSmi(receiver(), smi_target); |
| 56 | 60 |
| 57 // Polymorphic keyed stores may use the map register | 61 // Polymorphic keyed stores may use the map register |
| 58 Register map_reg = scratch1(); | 62 Register map_reg = scratch1(); |
| 59 DCHECK(kind() != Code::KEYED_STORE_IC || | 63 DCHECK(kind() != Code::KEYED_STORE_IC || |
| 60 map_reg.is(ElementTransitionAndStoreDescriptor::MapRegister())); | 64 map_reg.is(ElementTransitionAndStoreDescriptor::MapRegister())); |
| 61 | 65 |
| 62 int receiver_count = types->length(); | 66 int receiver_count = types->length(); |
| 63 int number_of_handled_maps = 0; | 67 int number_of_handled_maps = 0; |
| 64 __ ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); | 68 __ LoadP(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); |
| 65 for (int current = 0; current < receiver_count; ++current) { | 69 for (int current = 0; current < receiver_count; ++current) { |
| 66 Handle<HeapType> type = types->at(current); | 70 Handle<HeapType> type = types->at(current); |
| 67 Handle<Map> map = IC::TypeToMap(*type, isolate()); | 71 Handle<Map> map = IC::TypeToMap(*type, isolate()); |
| 68 if (!map->is_deprecated()) { | 72 if (!map->is_deprecated()) { |
| 69 number_of_handled_maps++; | 73 number_of_handled_maps++; |
| 70 __ mov(ip, Operand(map)); | 74 __ mov(ip, Operand(map)); |
| 71 __ cmp(map_reg, ip); | 75 __ cmp(map_reg, ip); |
| 72 if (type->Is(HeapType::Number())) { | 76 if (type->Is(HeapType::Number())) { |
| 73 DCHECK(!number_case.is_unused()); | 77 DCHECK(!number_case.is_unused()); |
| 74 __ bind(&number_case); | 78 __ bind(&number_case); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 88 } | 92 } |
| 89 | 93 |
| 90 | 94 |
| 91 Handle<Code> PropertyICCompiler::CompileKeyedStorePolymorphic( | 95 Handle<Code> PropertyICCompiler::CompileKeyedStorePolymorphic( |
| 92 MapHandleList* receiver_maps, CodeHandleList* handler_stubs, | 96 MapHandleList* receiver_maps, CodeHandleList* handler_stubs, |
| 93 MapHandleList* transitioned_maps) { | 97 MapHandleList* transitioned_maps) { |
| 94 Label miss; | 98 Label miss; |
| 95 __ JumpIfSmi(receiver(), &miss); | 99 __ JumpIfSmi(receiver(), &miss); |
| 96 | 100 |
| 97 int receiver_count = receiver_maps->length(); | 101 int receiver_count = receiver_maps->length(); |
| 98 __ ldr(scratch1(), FieldMemOperand(receiver(), HeapObject::kMapOffset)); | 102 __ LoadP(scratch1(), FieldMemOperand(receiver(), HeapObject::kMapOffset)); |
| 99 for (int i = 0; i < receiver_count; ++i) { | 103 for (int i = 0; i < receiver_count; ++i) { |
| 100 __ mov(ip, Operand(receiver_maps->at(i))); | 104 __ mov(ip, Operand(receiver_maps->at(i))); |
| 101 __ cmp(scratch1(), ip); | 105 __ cmp(scratch1(), ip); |
| 102 if (transitioned_maps->at(i).is_null()) { | 106 if (transitioned_maps->at(i).is_null()) { |
| 103 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET, eq); | 107 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET, eq); |
| 104 } else { | 108 } else { |
| 105 Label next_map; | 109 Label next_map; |
| 106 __ b(ne, &next_map); | 110 __ bne(&next_map); |
| 107 __ mov(transition_map(), Operand(transitioned_maps->at(i))); | 111 __ mov(transition_map(), Operand(transitioned_maps->at(i))); |
| 108 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET, al); | 112 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET, al); |
| 109 __ bind(&next_map); | 113 __ bind(&next_map); |
| 110 } | 114 } |
| 111 } | 115 } |
| 112 | 116 |
| 113 __ bind(&miss); | 117 __ bind(&miss); |
| 114 TailCallBuiltin(masm(), MissBuiltin(kind())); | 118 TailCallBuiltin(masm(), MissBuiltin(kind())); |
| 115 | 119 |
| 116 // Return the generated code. | 120 // Return the generated code. |
| 117 return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); | 121 return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); |
| 118 } | 122 } |
| 119 | 123 |
| 120 | 124 |
| 121 #undef __ | 125 #undef __ |
| 122 } | 126 } |
| 123 } // namespace v8::internal | 127 } // namespace v8::internal |
| 124 | 128 |
| 125 #endif // V8_TARGET_ARCH_ARM | 129 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |