Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/field-index.cc

Issue 429053005: Avoid one repeated property lookup when computing load ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/field-index.h ('k') | src/ic.h » ('j') | src/ic.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « src/field-index.h ('k') | src/ic.h » ('j') | src/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698