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 2579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2590 // Non-negative property indices are in the properties array. | 2590 // Non-negative property indices are in the properties array. |
2591 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 2591 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
2592 __ ldr(result, FieldMemOperand(result, offset + FixedArray::kHeaderSize)); | 2592 __ ldr(result, FieldMemOperand(result, offset + FixedArray::kHeaderSize)); |
2593 } | 2593 } |
2594 } else if (lookup.IsFound() && lookup.type() == CONSTANT_FUNCTION) { | 2594 } else if (lookup.IsFound() && lookup.type() == CONSTANT_FUNCTION) { |
2595 Handle<JSFunction> function(lookup.GetConstantFunctionFromMap(*type)); | 2595 Handle<JSFunction> function(lookup.GetConstantFunctionFromMap(*type)); |
2596 __ LoadHeapObject(result, function); | 2596 __ LoadHeapObject(result, function); |
2597 } else { | 2597 } else { |
2598 // Negative lookup. | 2598 // Negative lookup. |
2599 // Check prototypes. | 2599 // Check prototypes. |
2600 HeapObject* current = HeapObject::cast((*type)->prototype()); | 2600 Handle<HeapObject> current(HeapObject::cast((*type)->prototype())); |
2601 Heap* heap = type->GetHeap(); | 2601 Heap* heap = type->GetHeap(); |
2602 while (current != heap->null_value()) { | 2602 while (*current != heap->null_value()) { |
2603 Handle<HeapObject> link(current); | 2603 __ LoadHeapObject(result, current); |
2604 __ LoadHeapObject(result, link); | |
2605 __ ldr(result, FieldMemOperand(result, HeapObject::kMapOffset)); | 2604 __ ldr(result, FieldMemOperand(result, HeapObject::kMapOffset)); |
2606 __ cmp(result, Operand(Handle<Map>(JSObject::cast(current)->map()))); | 2605 __ cmp(result, Operand(Handle<Map>(current->map()))); |
2607 DeoptimizeIf(ne, env); | 2606 DeoptimizeIf(ne, env); |
2608 current = HeapObject::cast(current->map()->prototype()); | 2607 current = |
| 2608 Handle<HeapObject>(HeapObject::cast(current->map()->prototype())); |
2609 } | 2609 } |
2610 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); | 2610 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); |
2611 } | 2611 } |
2612 } | 2612 } |
2613 | 2613 |
2614 | 2614 |
2615 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { | 2615 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { |
2616 Register object = ToRegister(instr->object()); | 2616 Register object = ToRegister(instr->object()); |
2617 Register result = ToRegister(instr->result()); | 2617 Register result = ToRegister(instr->result()); |
2618 Register object_map = scratch0(); | 2618 Register object_map = scratch0(); |
(...skipping 2781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5400 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5400 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
5401 __ ldr(result, FieldMemOperand(scratch, | 5401 __ ldr(result, FieldMemOperand(scratch, |
5402 FixedArray::kHeaderSize - kPointerSize)); | 5402 FixedArray::kHeaderSize - kPointerSize)); |
5403 __ bind(&done); | 5403 __ bind(&done); |
5404 } | 5404 } |
5405 | 5405 |
5406 | 5406 |
5407 #undef __ | 5407 #undef __ |
5408 | 5408 |
5409 } } // namespace v8::internal | 5409 } } // namespace v8::internal |
OLD | NEW |