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

Side by Side Diff: src/compiler/access-info.cc

Issue 1704353002: [runtime] Force internalize names used before lookup in in DescriptorArray and TransitionArray (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « src/accessors.cc ('k') | src/crankshaft/hydrogen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 <ostream> 5 #include <ostream>
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/compilation-dependencies.h" 8 #include "src/compilation-dependencies.h"
9 #include "src/compiler/access-info.h" 9 #include "src/compiler/access-info.h"
10 #include "src/field-index-inl.h" 10 #include "src/field-index-inl.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 225
226 bool AccessInfoFactory::ComputePropertyAccessInfo( 226 bool AccessInfoFactory::ComputePropertyAccessInfo(
227 Handle<Map> map, Handle<Name> name, AccessMode access_mode, 227 Handle<Map> map, Handle<Name> name, AccessMode access_mode,
228 PropertyAccessInfo* access_info) { 228 PropertyAccessInfo* access_info) {
229 // Check if it is safe to inline property access for the {map}. 229 // Check if it is safe to inline property access for the {map}.
230 if (!CanInlinePropertyAccess(map)) return false; 230 if (!CanInlinePropertyAccess(map)) return false;
231 231
232 // Compute the receiver type. 232 // Compute the receiver type.
233 Handle<Map> receiver_map = map; 233 Handle<Map> receiver_map = map;
234 234
235 // Property lookups require the name to be internalized.
236 name = isolate()->factory()->InternalizeName(name);
237
235 // We support fast inline cases for certain JSObject getters. 238 // We support fast inline cases for certain JSObject getters.
236 if (access_mode == AccessMode::kLoad && 239 if (access_mode == AccessMode::kLoad &&
237 LookupSpecialFieldAccessor(map, name, access_info)) { 240 LookupSpecialFieldAccessor(map, name, access_info)) {
238 return true; 241 return true;
239 } 242 }
240 243
241 MaybeHandle<JSObject> holder; 244 MaybeHandle<JSObject> holder;
242 do { 245 do {
243 // Lookup the named property on the {map}. 246 // Lookup the named property on the {map}.
244 Handle<DescriptorArray> descriptors(map->instance_descriptors(), isolate()); 247 Handle<DescriptorArray> descriptors(map->instance_descriptors(), isolate());
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 } 478 }
476 return false; 479 return false;
477 } 480 }
478 481
479 482
480 Factory* AccessInfoFactory::factory() const { return isolate()->factory(); } 483 Factory* AccessInfoFactory::factory() const { return isolate()->factory(); }
481 484
482 } // namespace compiler 485 } // namespace compiler
483 } // namespace internal 486 } // namespace internal
484 } // namespace v8 487 } // namespace v8
OLDNEW
« no previous file with comments | « src/accessors.cc ('k') | src/crankshaft/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698