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

Side by Side Diff: src/objects.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
« src/ic.cc ('K') | « src/objects.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/accessors.h" 7 #include "src/accessors.h"
8 #include "src/allocation-site-scopes.h" 8 #include "src/allocation-site-scopes.h"
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 15148 matching lines...) Expand 10 before | Expand all | Expand 10 after
15159 } 15159 }
15160 15160
15161 15161
15162 PropertyCell* GlobalObject::GetPropertyCell(LookupResult* result) { 15162 PropertyCell* GlobalObject::GetPropertyCell(LookupResult* result) {
15163 ASSERT(!HasFastProperties()); 15163 ASSERT(!HasFastProperties());
15164 Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry()); 15164 Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry());
15165 return PropertyCell::cast(value); 15165 return PropertyCell::cast(value);
15166 } 15166 }
15167 15167
15168 15168
15169 PropertyCell* GlobalObject::GetPropertyCell(LookupIterator* lookup) {
Toon Verwaest 2014/07/30 16:54:53 Let the LookupIterator return the cell instead.
Jakob Kummerow 2014/07/31 13:55:51 Done.
15170 ASSERT(!HasFastProperties());
15171 Object* value = property_dictionary()->ValueAt(lookup->dictionary_entry());
15172 return PropertyCell::cast(value);
15173 }
15174
15175
15169 Handle<PropertyCell> JSGlobalObject::EnsurePropertyCell( 15176 Handle<PropertyCell> JSGlobalObject::EnsurePropertyCell(
15170 Handle<JSGlobalObject> global, 15177 Handle<JSGlobalObject> global,
15171 Handle<Name> name) { 15178 Handle<Name> name) {
15172 ASSERT(!global->HasFastProperties()); 15179 ASSERT(!global->HasFastProperties());
15173 int entry = global->property_dictionary()->FindEntry(name); 15180 int entry = global->property_dictionary()->FindEntry(name);
15174 if (entry == NameDictionary::kNotFound) { 15181 if (entry == NameDictionary::kNotFound) {
15175 Isolate* isolate = global->GetIsolate(); 15182 Isolate* isolate = global->GetIsolate();
15176 Handle<PropertyCell> cell = isolate->factory()->NewPropertyCell( 15183 Handle<PropertyCell> cell = isolate->factory()->NewPropertyCell(
15177 isolate->factory()->the_hole_value()); 15184 isolate->factory()->the_hole_value());
15178 PropertyDetails details(NONE, NORMAL, 0); 15185 PropertyDetails details(NONE, NORMAL, 0);
(...skipping 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after
16985 #define ERROR_MESSAGES_TEXTS(C, T) T, 16992 #define ERROR_MESSAGES_TEXTS(C, T) T,
16986 static const char* error_messages_[] = { 16993 static const char* error_messages_[] = {
16987 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16994 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16988 }; 16995 };
16989 #undef ERROR_MESSAGES_TEXTS 16996 #undef ERROR_MESSAGES_TEXTS
16990 return error_messages_[reason]; 16997 return error_messages_[reason];
16991 } 16998 }
16992 16999
16993 17000
16994 } } // namespace v8::internal 17001 } } // namespace v8::internal
OLDNEW
« src/ic.cc ('K') | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698