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