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

Side by Side Diff: src/lookup.cc

Issue 1714753003: Don't internalize names that are array indexes since they aren't used for lookup (the index is) (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/lookup.h ('k') | no next file » | no next file with comments »
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/lookup.h" 5 #include "src/lookup.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/deoptimizer.h" 8 #include "src/deoptimizer.h"
9 #include "src/elements.h" 9 #include "src/elements.h"
10 #include "src/field-type.h" 10 #include "src/field-type.h"
(...skipping 20 matching lines...) Expand all
31 if (!*success) { 31 if (!*success) {
32 DCHECK(isolate->has_pending_exception()); 32 DCHECK(isolate->has_pending_exception());
33 // Return an unusable dummy. 33 // Return an unusable dummy.
34 return LookupIterator(receiver, isolate->factory()->empty_string()); 34 return LookupIterator(receiver, isolate->factory()->empty_string());
35 } 35 }
36 36
37 if (name->AsArrayIndex(&index)) { 37 if (name->AsArrayIndex(&index)) {
38 LookupIterator it(isolate, receiver, index, configuration); 38 LookupIterator it(isolate, receiver, index, configuration);
39 // Here we try to avoid having to rebuild the string later 39 // Here we try to avoid having to rebuild the string later
40 // by storing it on the indexed LookupIterator. 40 // by storing it on the indexed LookupIterator.
41 it.name_ = isolate->factory()->InternalizeName(name); 41 it.name_ = name;
42 return it; 42 return it;
43 } 43 }
44 44
45 return LookupIterator(receiver, name, configuration); 45 return LookupIterator(receiver, name, configuration);
46 } 46 }
47 47
48 48
49 void LookupIterator::Next() { 49 void LookupIterator::Next() {
50 DCHECK_NE(JSPROXY, state_); 50 DCHECK_NE(JSPROXY, state_);
51 DCHECK_NE(TRANSITION, state_); 51 DCHECK_NE(TRANSITION, state_);
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 // Fall through. 674 // Fall through.
675 default: 675 default:
676 return NOT_FOUND; 676 return NOT_FOUND;
677 } 677 }
678 UNREACHABLE(); 678 UNREACHABLE();
679 return state_; 679 return state_;
680 } 680 }
681 681
682 } // namespace internal 682 } // namespace internal
683 } // namespace v8 683 } // namespace v8
OLDNEW
« no previous file with comments | « src/lookup.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698