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 2369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2380 } | 2380 } |
2381 } | 2381 } |
2382 | 2382 |
2383 | 2383 |
2384 void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, | 2384 void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, |
2385 Register object, | 2385 Register object, |
2386 Handle<Map> type, | 2386 Handle<Map> type, |
2387 Handle<String> name) { | 2387 Handle<String> name) { |
2388 LookupResult lookup(isolate()); | 2388 LookupResult lookup(isolate()); |
2389 type->LookupInDescriptors(NULL, *name, &lookup); | 2389 type->LookupInDescriptors(NULL, *name, &lookup); |
2390 ASSERT(lookup.IsProperty() && | 2390 ASSERT(lookup.IsFound() && |
2391 (lookup.type() == FIELD || lookup.type() == CONSTANT_FUNCTION)); | 2391 (lookup.type() == FIELD || lookup.type() == CONSTANT_FUNCTION)); |
2392 if (lookup.type() == FIELD) { | 2392 if (lookup.type() == FIELD) { |
2393 int index = lookup.GetLocalFieldIndexFromMap(*type); | 2393 int index = lookup.GetLocalFieldIndexFromMap(*type); |
2394 int offset = index * kPointerSize; | 2394 int offset = index * kPointerSize; |
2395 if (index < 0) { | 2395 if (index < 0) { |
2396 // Negative property indices are in-object properties, indexed | 2396 // Negative property indices are in-object properties, indexed |
2397 // from the end of the fixed part of the object. | 2397 // from the end of the fixed part of the object. |
2398 __ ldr(result, FieldMemOperand(object, offset + type->instance_size())); | 2398 __ ldr(result, FieldMemOperand(object, offset + type->instance_size())); |
2399 } else { | 2399 } else { |
2400 // Non-negative property indices are in the properties array. | 2400 // Non-negative property indices are in the properties array. |
(...skipping 2391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4792 ASSERT(osr_pc_offset_ == -1); | 4792 ASSERT(osr_pc_offset_ == -1); |
4793 osr_pc_offset_ = masm()->pc_offset(); | 4793 osr_pc_offset_ = masm()->pc_offset(); |
4794 } | 4794 } |
4795 | 4795 |
4796 | 4796 |
4797 | 4797 |
4798 | 4798 |
4799 #undef __ | 4799 #undef __ |
4800 | 4800 |
4801 } } // namespace v8::internal | 4801 } } // namespace v8::internal |
OLD | NEW |