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 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2228 current = | 2228 current = |
2229 Handle<HeapObject>(HeapObject::cast(current->map()->prototype())); | 2229 Handle<HeapObject>(HeapObject::cast(current->map()->prototype())); |
2230 } | 2230 } |
2231 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); | 2231 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); |
2232 } | 2232 } |
2233 } | 2233 } |
2234 | 2234 |
2235 | 2235 |
2236 // Check for cases where EmitLoadFieldOrConstantFunction needs to walk the | 2236 // Check for cases where EmitLoadFieldOrConstantFunction needs to walk the |
2237 // prototype chain, which causes unbounded code generation. | 2237 // prototype chain, which causes unbounded code generation. |
2238 static bool CompactEmit( | 2238 static bool CompactEmit(SmallMapList* list, |
2239 SmallMapList* list, Handle<String> name, int i, Isolate* isolate) { | 2239 Handle<String> name, |
| 2240 int i, |
| 2241 Isolate* isolate) { |
| 2242 Handle<Map> map = list->at(i); |
| 2243 // If the map has ElementsKind transitions, we will generate map checks |
| 2244 // for each kind in __ CompareMap(..., ALLOW_ELEMENTS_TRANSITION_MAPS). |
| 2245 if (map->elements_transition_map() != NULL) return false; |
2240 LookupResult lookup(isolate); | 2246 LookupResult lookup(isolate); |
2241 Handle<Map> map = list->at(i); | |
2242 map->LookupInDescriptors(NULL, *name, &lookup); | 2247 map->LookupInDescriptors(NULL, *name, &lookup); |
2243 return lookup.IsFound() && | 2248 return lookup.IsFound() && |
2244 (lookup.type() == FIELD || lookup.type() == CONSTANT_FUNCTION); | 2249 (lookup.type() == FIELD || lookup.type() == CONSTANT_FUNCTION); |
2245 } | 2250 } |
2246 | 2251 |
2247 | 2252 |
2248 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { | 2253 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { |
2249 Register object = ToRegister(instr->object()); | 2254 Register object = ToRegister(instr->object()); |
2250 Register result = ToRegister(instr->result()); | 2255 Register result = ToRegister(instr->result()); |
2251 | 2256 |
(...skipping 2693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4945 FixedArray::kHeaderSize - kPointerSize)); | 4950 FixedArray::kHeaderSize - kPointerSize)); |
4946 __ bind(&done); | 4951 __ bind(&done); |
4947 } | 4952 } |
4948 | 4953 |
4949 | 4954 |
4950 #undef __ | 4955 #undef __ |
4951 | 4956 |
4952 } } // namespace v8::internal | 4957 } } // namespace v8::internal |
4953 | 4958 |
4954 #endif // V8_TARGET_ARCH_X64 | 4959 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |