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