| 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 2303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2314 } | 2314 } |
| 2315 } | 2315 } |
| 2316 | 2316 |
| 2317 | 2317 |
| 2318 void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, | 2318 void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, |
| 2319 Register object, | 2319 Register object, |
| 2320 Handle<Map> type, | 2320 Handle<Map> type, |
| 2321 Handle<String> name, | 2321 Handle<String> name, |
| 2322 LEnvironment* env) { | 2322 LEnvironment* env) { |
| 2323 LookupResult lookup(isolate()); | 2323 LookupResult lookup(isolate()); |
| 2324 type->LookupInDescriptors(NULL, *name, &lookup); | 2324 type->LookupDescriptor(NULL, *name, &lookup); |
| 2325 ASSERT(lookup.IsFound() || lookup.IsCacheable()); | 2325 ASSERT(lookup.IsFound() || lookup.IsCacheable()); |
| 2326 if (lookup.IsField()) { | 2326 if (lookup.IsField()) { |
| 2327 int index = lookup.GetLocalFieldIndexFromMap(*type); | 2327 int index = lookup.GetLocalFieldIndexFromMap(*type); |
| 2328 int offset = index * kPointerSize; | 2328 int offset = index * kPointerSize; |
| 2329 if (index < 0) { | 2329 if (index < 0) { |
| 2330 // Negative property indices are in-object properties, indexed | 2330 // Negative property indices are in-object properties, indexed |
| 2331 // from the end of the fixed part of the object. | 2331 // from the end of the fixed part of the object. |
| 2332 __ lw(result, FieldMemOperand(object, offset + type->instance_size())); | 2332 __ lw(result, FieldMemOperand(object, offset + type->instance_size())); |
| 2333 } else { | 2333 } else { |
| 2334 // Non-negative property indices are in the properties array. | 2334 // Non-negative property indices are in the properties array. |
| (...skipping 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5204 __ Subu(scratch, result, scratch); | 5204 __ Subu(scratch, result, scratch); |
| 5205 __ lw(result, FieldMemOperand(scratch, | 5205 __ lw(result, FieldMemOperand(scratch, |
| 5206 FixedArray::kHeaderSize - kPointerSize)); | 5206 FixedArray::kHeaderSize - kPointerSize)); |
| 5207 __ bind(&done); | 5207 __ bind(&done); |
| 5208 } | 5208 } |
| 5209 | 5209 |
| 5210 | 5210 |
| 5211 #undef __ | 5211 #undef __ |
| 5212 | 5212 |
| 5213 } } // namespace v8::internal | 5213 } } // namespace v8::internal |
| OLD | NEW |