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_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 // map: key map | 235 // map: key map |
236 __ ldrb(hash, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 236 __ ldrb(hash, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
237 STATIC_ASSERT(kInternalizedTag == 0); | 237 STATIC_ASSERT(kInternalizedTag == 0); |
238 __ tst(hash, Operand(kIsNotInternalizedMask)); | 238 __ tst(hash, Operand(kIsNotInternalizedMask)); |
239 __ b(ne, not_unique); | 239 __ b(ne, not_unique); |
240 | 240 |
241 __ bind(&unique); | 241 __ bind(&unique); |
242 } | 242 } |
243 | 243 |
244 | 244 |
245 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { | |
246 // The return address is in lr. | |
247 Register receiver = LoadDescriptor::ReceiverRegister(); | |
248 Register name = LoadDescriptor::NameRegister(); | |
249 DCHECK(receiver.is(r1)); | |
250 DCHECK(name.is(r2)); | |
251 | |
252 // Probe the stub cache. | |
253 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | |
254 Code::ComputeHandlerFlags(Code::LOAD_IC)); | |
255 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, receiver, name, r3, | |
256 r4, r5, r6); | |
257 | |
258 // Cache miss: Jump to runtime. | |
259 GenerateMiss(masm); | |
260 } | |
261 | |
262 | |
263 void LoadIC::GenerateNormal(MacroAssembler* masm) { | 245 void LoadIC::GenerateNormal(MacroAssembler* masm) { |
264 Register dictionary = r0; | 246 Register dictionary = r0; |
265 DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); | 247 DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); |
266 DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); | 248 DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); |
267 | 249 |
268 Label slow; | 250 Label slow; |
269 | 251 |
270 __ ldr(dictionary, FieldMemOperand(LoadDescriptor::ReceiverRegister(), | 252 __ ldr(dictionary, FieldMemOperand(LoadDescriptor::ReceiverRegister(), |
271 JSObject::kPropertiesOffset)); | 253 JSObject::kPropertiesOffset)); |
272 GenerateDictionaryLoad(masm, &slow, dictionary, | 254 GenerateDictionaryLoad(masm, &slow, dictionary, |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 Register receiver = StoreDescriptor::ReceiverRegister(); | 938 Register receiver = StoreDescriptor::ReceiverRegister(); |
957 Register name = StoreDescriptor::NameRegister(); | 939 Register name = StoreDescriptor::NameRegister(); |
958 DCHECK(receiver.is(r1)); | 940 DCHECK(receiver.is(r1)); |
959 DCHECK(name.is(r2)); | 941 DCHECK(name.is(r2)); |
960 DCHECK(StoreDescriptor::ValueRegister().is(r0)); | 942 DCHECK(StoreDescriptor::ValueRegister().is(r0)); |
961 | 943 |
962 // Get the receiver from the stack and probe the stub cache. | 944 // Get the receiver from the stack and probe the stub cache. |
963 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 945 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
964 Code::ComputeHandlerFlags(Code::STORE_IC)); | 946 Code::ComputeHandlerFlags(Code::STORE_IC)); |
965 | 947 |
966 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, receiver, name, r3, | 948 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, false, receiver, |
967 r4, r5, r6); | 949 name, r3, r4, r5, r6); |
968 | 950 |
969 // Cache miss: Jump to runtime. | 951 // Cache miss: Jump to runtime. |
970 GenerateMiss(masm); | 952 GenerateMiss(masm); |
971 } | 953 } |
972 | 954 |
973 | 955 |
974 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 956 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
975 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | 957 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), |
976 StoreDescriptor::ValueRegister()); | 958 StoreDescriptor::ValueRegister()); |
977 | 959 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 patcher.EmitCondition(ne); | 1078 patcher.EmitCondition(ne); |
1097 } else { | 1079 } else { |
1098 DCHECK(Assembler::GetCondition(branch_instr) == ne); | 1080 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
1099 patcher.EmitCondition(eq); | 1081 patcher.EmitCondition(eq); |
1100 } | 1082 } |
1101 } | 1083 } |
1102 } | 1084 } |
1103 } // namespace v8::internal | 1085 } // namespace v8::internal |
1104 | 1086 |
1105 #endif // V8_TARGET_ARCH_ARM | 1087 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |