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 2266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2277 } | 2277 } |
2278 } | 2278 } |
2279 | 2279 |
2280 | 2280 |
2281 void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, | 2281 void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, |
2282 Register object, | 2282 Register object, |
2283 Handle<Map> type, | 2283 Handle<Map> type, |
2284 Handle<String> name, | 2284 Handle<String> name, |
2285 LEnvironment* env) { | 2285 LEnvironment* env) { |
2286 LookupResult lookup(isolate()); | 2286 LookupResult lookup(isolate()); |
2287 type->LookupInDescriptors(NULL, *name, &lookup); | 2287 type->LookupDescriptor(NULL, *name, &lookup); |
2288 ASSERT(lookup.IsFound() || lookup.IsCacheable()); | 2288 ASSERT(lookup.IsFound() || lookup.IsCacheable()); |
2289 if (lookup.IsField()) { | 2289 if (lookup.IsField()) { |
2290 int index = lookup.GetLocalFieldIndexFromMap(*type); | 2290 int index = lookup.GetLocalFieldIndexFromMap(*type); |
2291 int offset = index * kPointerSize; | 2291 int offset = index * kPointerSize; |
2292 if (index < 0) { | 2292 if (index < 0) { |
2293 // Negative property indices are in-object properties, indexed | 2293 // Negative property indices are in-object properties, indexed |
2294 // from the end of the fixed part of the object. | 2294 // from the end of the fixed part of the object. |
2295 __ movq(result, FieldOperand(object, offset + type->instance_size())); | 2295 __ movq(result, FieldOperand(object, offset + type->instance_size())); |
2296 } else { | 2296 } else { |
2297 // Non-negative property indices are in the properties array. | 2297 // Non-negative property indices are in the properties array. |
(...skipping 23 matching lines...) Expand all Loading... |
2321 | 2321 |
2322 // Check for cases where EmitLoadFieldOrConstantFunction needs to walk the | 2322 // Check for cases where EmitLoadFieldOrConstantFunction needs to walk the |
2323 // prototype chain, which causes unbounded code generation. | 2323 // prototype chain, which causes unbounded code generation. |
2324 static bool CompactEmit(SmallMapList* list, | 2324 static bool CompactEmit(SmallMapList* list, |
2325 Handle<String> name, | 2325 Handle<String> name, |
2326 int i, | 2326 int i, |
2327 Isolate* isolate) { | 2327 Isolate* isolate) { |
2328 Handle<Map> map = list->at(i); | 2328 Handle<Map> map = list->at(i); |
2329 // If the map has ElementsKind transitions, we will generate map checks | 2329 // If the map has ElementsKind transitions, we will generate map checks |
2330 // for each kind in __ CompareMap(..., ALLOW_ELEMENTS_TRANSITION_MAPS). | 2330 // for each kind in __ CompareMap(..., ALLOW_ELEMENTS_TRANSITION_MAPS). |
2331 if (map->elements_transition_map() != NULL) return false; | 2331 if (map->HasElementsTransition()) return false; |
2332 LookupResult lookup(isolate); | 2332 LookupResult lookup(isolate); |
2333 map->LookupInDescriptors(NULL, *name, &lookup); | 2333 map->LookupDescriptor(NULL, *name, &lookup); |
2334 return lookup.IsField() || lookup.IsConstantFunction(); | 2334 return lookup.IsField() || lookup.IsConstantFunction(); |
2335 } | 2335 } |
2336 | 2336 |
2337 | 2337 |
2338 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { | 2338 void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { |
2339 Register object = ToRegister(instr->object()); | 2339 Register object = ToRegister(instr->object()); |
2340 Register result = ToRegister(instr->result()); | 2340 Register result = ToRegister(instr->result()); |
2341 | 2341 |
2342 int map_count = instr->hydrogen()->types()->length(); | 2342 int map_count = instr->hydrogen()->types()->length(); |
2343 bool need_generic = instr->hydrogen()->need_generic(); | 2343 bool need_generic = instr->hydrogen()->need_generic(); |
(...skipping 2701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5045 FixedArray::kHeaderSize - kPointerSize)); | 5045 FixedArray::kHeaderSize - kPointerSize)); |
5046 __ bind(&done); | 5046 __ bind(&done); |
5047 } | 5047 } |
5048 | 5048 |
5049 | 5049 |
5050 #undef __ | 5050 #undef __ |
5051 | 5051 |
5052 } } // namespace v8::internal | 5052 } } // namespace v8::internal |
5053 | 5053 |
5054 #endif // V8_TARGET_ARCH_X64 | 5054 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |