OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 } | 320 } |
321 | 321 |
322 | 322 |
323 // Load a fast property out of a holder object (src). In-object properties | 323 // Load a fast property out of a holder object (src). In-object properties |
324 // are loaded directly otherwise the property is loaded from the properties | 324 // are loaded directly otherwise the property is loaded from the properties |
325 // fixed array. | 325 // fixed array. |
326 void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm, | 326 void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm, |
327 Register dst, | 327 Register dst, |
328 Register src, | 328 Register src, |
329 Handle<JSObject> holder, | 329 Handle<JSObject> holder, |
330 int index) { | 330 PropertyIndex index) { |
331 // Adjust for the number of properties stored in the holder. | 331 if (index.IsHeaderIndex()) { |
332 index -= holder->map()->inobject_properties(); | 332 int offset = index.HeaderIndex() * kPointerSize; |
333 if (index < 0) { | |
334 // Get the property straight out of the holder. | |
335 int offset = holder->map()->instance_size() + (index * kPointerSize); | |
336 __ ldr(dst, FieldMemOperand(src, offset)); | 333 __ ldr(dst, FieldMemOperand(src, offset)); |
337 } else { | 334 } else { |
338 // Calculate the offset into the properties array. | 335 // Adjust for the number of properties stored in the holder. |
339 int offset = index * kPointerSize + FixedArray::kHeaderSize; | 336 int slot = index.FieldIndex() - holder->map()->inobject_properties(); |
340 __ ldr(dst, FieldMemOperand(src, JSObject::kPropertiesOffset)); | 337 if (slot < 0) { |
341 __ ldr(dst, FieldMemOperand(dst, offset)); | 338 // Get the property straight out of the holder. |
| 339 int offset = holder->map()->instance_size() + (slot * kPointerSize); |
| 340 __ ldr(dst, FieldMemOperand(src, offset)); |
| 341 } else { |
| 342 // Calculate the offset into the properties array. |
| 343 int offset = slot * kPointerSize + FixedArray::kHeaderSize; |
| 344 __ ldr(dst, FieldMemOperand(src, JSObject::kPropertiesOffset)); |
| 345 __ ldr(dst, FieldMemOperand(dst, offset)); |
| 346 } |
342 } | 347 } |
343 } | 348 } |
344 | 349 |
345 | 350 |
346 void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm, | 351 void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm, |
347 Register receiver, | 352 Register receiver, |
348 Register scratch, | 353 Register scratch, |
349 Label* miss_label) { | 354 Label* miss_label) { |
350 // Check that the receiver isn't a smi. | 355 // Check that the receiver isn't a smi. |
351 __ JumpIfSmi(receiver, miss_label); | 356 __ JumpIfSmi(receiver, miss_label); |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 return reg; | 1194 return reg; |
1190 } | 1195 } |
1191 | 1196 |
1192 | 1197 |
1193 void StubCompiler::GenerateLoadField(Handle<JSObject> object, | 1198 void StubCompiler::GenerateLoadField(Handle<JSObject> object, |
1194 Handle<JSObject> holder, | 1199 Handle<JSObject> holder, |
1195 Register receiver, | 1200 Register receiver, |
1196 Register scratch1, | 1201 Register scratch1, |
1197 Register scratch2, | 1202 Register scratch2, |
1198 Register scratch3, | 1203 Register scratch3, |
1199 int index, | 1204 PropertyIndex index, |
1200 Handle<String> name, | 1205 Handle<String> name, |
1201 Label* miss) { | 1206 Label* miss) { |
1202 // Check that the receiver isn't a smi. | 1207 // Check that the receiver isn't a smi. |
1203 __ JumpIfSmi(receiver, miss); | 1208 __ JumpIfSmi(receiver, miss); |
1204 | 1209 |
1205 // Check that the maps haven't changed. | 1210 // Check that the maps haven't changed. |
1206 Register reg = CheckPrototypes( | 1211 Register reg = CheckPrototypes( |
1207 object, receiver, holder, scratch1, scratch2, scratch3, name, miss); | 1212 object, receiver, holder, scratch1, scratch2, scratch3, name, miss); |
1208 GenerateFastPropertyLoad(masm(), r0, reg, holder, index); | 1213 GenerateFastPropertyLoad(masm(), r0, reg, holder, index); |
1209 __ Ret(); | 1214 __ Ret(); |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1422 scratch3, | 1427 scratch3, |
1423 name, | 1428 name, |
1424 miss); | 1429 miss); |
1425 } | 1430 } |
1426 | 1431 |
1427 if (lookup->IsField()) { | 1432 if (lookup->IsField()) { |
1428 // We found FIELD property in prototype chain of interceptor's holder. | 1433 // We found FIELD property in prototype chain of interceptor's holder. |
1429 // Retrieve a field from field's holder. | 1434 // Retrieve a field from field's holder. |
1430 GenerateFastPropertyLoad(masm(), r0, holder_reg, | 1435 GenerateFastPropertyLoad(masm(), r0, holder_reg, |
1431 Handle<JSObject>(lookup->holder()), | 1436 Handle<JSObject>(lookup->holder()), |
1432 lookup->GetFieldIndex()); | 1437 lookup->GetFieldIndex().FieldIndex()); |
1433 __ Ret(); | 1438 __ Ret(); |
1434 } else { | 1439 } else { |
1435 // We found CALLBACKS property in prototype chain of interceptor's | 1440 // We found CALLBACKS property in prototype chain of interceptor's |
1436 // holder. | 1441 // holder. |
1437 ASSERT(lookup->type() == CALLBACKS); | 1442 ASSERT(lookup->type() == CALLBACKS); |
1438 Handle<AccessorInfo> callback( | 1443 Handle<AccessorInfo> callback( |
1439 AccessorInfo::cast(lookup->GetCallbackObject())); | 1444 AccessorInfo::cast(lookup->GetCallbackObject())); |
1440 ASSERT(callback->getter() != NULL); | 1445 ASSERT(callback->getter() != NULL); |
1441 | 1446 |
1442 // Tail call to runtime. | 1447 // Tail call to runtime. |
(...skipping 3339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4782 __ Jump(ic_slow, RelocInfo::CODE_TARGET); | 4787 __ Jump(ic_slow, RelocInfo::CODE_TARGET); |
4783 } | 4788 } |
4784 } | 4789 } |
4785 | 4790 |
4786 | 4791 |
4787 #undef __ | 4792 #undef __ |
4788 | 4793 |
4789 } } // namespace v8::internal | 4794 } } // namespace v8::internal |
4790 | 4795 |
4791 #endif // V8_TARGET_ARCH_ARM | 4796 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |