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 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2214 // Non-negative property indices are in the properties array. | 2214 // Non-negative property indices are in the properties array. |
2215 __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset)); | 2215 __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset)); |
2216 __ movq(result, FieldOperand(result, offset + FixedArray::kHeaderSize)); | 2216 __ movq(result, FieldOperand(result, offset + FixedArray::kHeaderSize)); |
2217 } | 2217 } |
2218 } else if (lookup.IsFound() && lookup.type() == CONSTANT_FUNCTION) { | 2218 } else if (lookup.IsFound() && lookup.type() == CONSTANT_FUNCTION) { |
2219 Handle<JSFunction> function(lookup.GetConstantFunctionFromMap(*type)); | 2219 Handle<JSFunction> function(lookup.GetConstantFunctionFromMap(*type)); |
2220 __ LoadHeapObject(result, function); | 2220 __ LoadHeapObject(result, function); |
2221 } else { | 2221 } else { |
2222 // Negative lookup. | 2222 // Negative lookup. |
2223 // Check prototypes. | 2223 // Check prototypes. |
2224 HeapObject* current = HeapObject::cast((*type)->prototype()); | 2224 Handle<HeapObject> current(HeapObject::cast((*type)->prototype())); |
2225 Heap* heap = type->GetHeap(); | 2225 Heap* heap = type->GetHeap(); |
2226 while (current != heap->null_value()) { | 2226 while (*current != heap->null_value()) { |
2227 Handle<HeapObject> link(current); | 2227 __ LoadHeapObject(result, current); |
2228 __ LoadHeapObject(result, link); | |
2229 __ Cmp(FieldOperand(result, HeapObject::kMapOffset), | 2228 __ Cmp(FieldOperand(result, HeapObject::kMapOffset), |
2230 Handle<Map>(JSObject::cast(current)->map())); | 2229 Handle<Map>(current->map())); |
2231 DeoptimizeIf(not_equal, env); | 2230 DeoptimizeIf(not_equal, env); |
2232 current = HeapObject::cast(current->map()->prototype()); | 2231 current = |
| 2232 Handle<HeapObject>(HeapObject::cast(current->map()->prototype())); |
2233 } | 2233 } |
2234 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); | 2234 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); |
2235 } | 2235 } |
2236 } | 2236 } |
2237 | 2237 |
2238 | 2238 |
2239 // Check for cases where EmitLoadFieldOrConstantFunction needs to walk the | 2239 // Check for cases where EmitLoadFieldOrConstantFunction needs to walk the |
2240 // prototype chain, which causes unbounded code generation. | 2240 // prototype chain, which causes unbounded code generation. |
2241 static bool CompactEmit( | 2241 static bool CompactEmit( |
2242 SmallMapList* list, Handle<String> name, int i, Isolate* isolate) { | 2242 SmallMapList* list, Handle<String> name, int i, Isolate* isolate) { |
(...skipping 2705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4948 FixedArray::kHeaderSize - kPointerSize)); | 4948 FixedArray::kHeaderSize - kPointerSize)); |
4949 __ bind(&done); | 4949 __ bind(&done); |
4950 } | 4950 } |
4951 | 4951 |
4952 | 4952 |
4953 #undef __ | 4953 #undef __ |
4954 | 4954 |
4955 } } // namespace v8::internal | 4955 } } // namespace v8::internal |
4956 | 4956 |
4957 #endif // V8_TARGET_ARCH_X64 | 4957 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |