Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/field-index.h" | 7 #include "src/field-index.h" |
| 8 #include "src/lookup.h" | |
| 8 #include "src/objects.h" | 9 #include "src/objects.h" |
| 9 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
| 10 | 11 |
| 11 namespace v8 { | 12 namespace v8 { |
| 12 namespace internal { | 13 namespace internal { |
| 13 | 14 |
| 14 | 15 |
| 15 FieldIndex FieldIndex::ForLookupResult(const LookupResult* lookup_result) { | 16 FieldIndex FieldIndex::ForLookupResult(const LookupResult* lookup_result) { |
| 16 Map* map = lookup_result->holder()->map(); | 17 Map* map = lookup_result->holder()->map(); |
| 17 return ForPropertyIndex(map, | 18 return ForPropertyIndex(map, |
| 18 lookup_result->GetFieldIndexFromMap(map), | 19 lookup_result->GetFieldIndexFromMap(map), |
| 19 lookup_result->representation().IsDouble()); | 20 lookup_result->representation().IsDouble()); |
| 20 } | 21 } |
| 21 | 22 |
| 22 | 23 |
| 24 FieldIndex FieldIndex::ForLookupIterator(const LookupIterator* lookup) { | |
|
Toon Verwaest
2014/07/30 16:54:52
Let the LookupIterator calculate the FieldIndex in
Jakob Kummerow
2014/07/31 13:55:50
Done.
| |
| 25 Handle<Map> map = lookup->holder_map(); | |
| 26 int index = | |
| 27 map->instance_descriptors()->GetFieldIndex(lookup->descriptor_number()); | |
| 28 return ForPropertyIndex(*map, index, lookup->representation().IsDouble()); | |
| 29 } | |
| 23 } } // namespace v8::internal | 30 } } // namespace v8::internal |
| OLD | NEW |