| 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 2320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2331 // Non-negative property indices are in the properties array. | 2331 // Non-negative property indices are in the properties array. |
| 2332 __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 2332 __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
| 2333 __ lw(result, FieldMemOperand(result, offset + FixedArray::kHeaderSize)); | 2333 __ lw(result, FieldMemOperand(result, offset + FixedArray::kHeaderSize)); |
| 2334 } | 2334 } |
| 2335 } else if (lookup.IsFound() && lookup.type() == CONSTANT_FUNCTION) { | 2335 } else if (lookup.IsFound() && lookup.type() == CONSTANT_FUNCTION) { |
| 2336 Handle<JSFunction> function(lookup.GetConstantFunctionFromMap(*type)); | 2336 Handle<JSFunction> function(lookup.GetConstantFunctionFromMap(*type)); |
| 2337 __ LoadHeapObject(result, function); | 2337 __ LoadHeapObject(result, function); |
| 2338 } else { | 2338 } else { |
| 2339 // Negative lookup. | 2339 // Negative lookup. |
| 2340 // Check prototypes. | 2340 // Check prototypes. |
| 2341 HeapObject* current = HeapObject::cast((*type)->prototype()); | 2341 Handle<HeapObject> current(HeapObject::cast((*type)->prototype())); |
| 2342 Heap* heap = type->GetHeap(); | 2342 Heap* heap = type->GetHeap(); |
| 2343 while (current != heap->null_value()) { | 2343 while (*current != heap->null_value()) { |
| 2344 Handle<HeapObject> link(current); | 2344 __ LoadHeapObject(result, current); |
| 2345 __ LoadHeapObject(result, link); | |
| 2346 __ lw(result, FieldMemOperand(result, HeapObject::kMapOffset)); | 2345 __ lw(result, FieldMemOperand(result, HeapObject::kMapOffset)); |
| 2347 DeoptimizeIf(ne, env, | 2346 DeoptimizeIf(ne, env, result, Operand(Handle<Map>(current->map()))); |
| 2348 result, Operand(Handle<Map>(JSObject::cast(current)->map()))); | 2347 current = |
| 2349 current = HeapObject::cast(current->map()->prototype()); | 2348 Handle<HeapObject>(HeapObject::cast(current->map()->prototype())); |
| 2350 } | 2349 } |
| 2351 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); | 2350 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); |
| 2352 } | 2351 } |
| 2353 } | 2352 } |
| 2354 | 2353 |
| 2355 | 2354 |
| 2356 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { | 2355 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { |
| 2357 Register object = ToRegister(instr->object()); | 2356 Register object = ToRegister(instr->object()); |
| 2358 Register result = ToRegister(instr->result()); | 2357 Register result = ToRegister(instr->result()); |
| 2359 Register object_map = scratch0(); | 2358 Register object_map = scratch0(); |
| (...skipping 2843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5203 __ Subu(scratch, result, scratch); | 5202 __ Subu(scratch, result, scratch); |
| 5204 __ lw(result, FieldMemOperand(scratch, | 5203 __ lw(result, FieldMemOperand(scratch, |
| 5205 FixedArray::kHeaderSize - kPointerSize)); | 5204 FixedArray::kHeaderSize - kPointerSize)); |
| 5206 __ bind(&done); | 5205 __ bind(&done); |
| 5207 } | 5206 } |
| 5208 | 5207 |
| 5209 | 5208 |
| 5210 #undef __ | 5209 #undef __ |
| 5211 | 5210 |
| 5212 } } // namespace v8::internal | 5211 } } // namespace v8::internal |
| OLD | NEW |