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

Side by Side Diff: src/property.h

Issue 564035: Remove lazy loading of natives files and the natives cache.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: Created 10 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 | Annotate | Revision Log
« no previous file with comments | « src/platform-win32.cc ('k') | src/regexp.js » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 // Tells whether the result is a property. 236 // Tells whether the result is a property.
237 // Excluding transitions and the null descriptor. 237 // Excluding transitions and the null descriptor.
238 bool IsProperty() { 238 bool IsProperty() {
239 return IsValid() && type() < FIRST_PHANTOM_PROPERTY_TYPE; 239 return IsValid() && type() < FIRST_PHANTOM_PROPERTY_TYPE;
240 } 240 }
241 241
242 bool IsCacheable() { return cacheable_; } 242 bool IsCacheable() { return cacheable_; }
243 void DisallowCaching() { cacheable_ = false; } 243 void DisallowCaching() { cacheable_ = false; }
244 244
245 // Tells whether the value needs to be loaded.
246 bool IsLoaded() {
247 if (lookup_type_ == DESCRIPTOR_TYPE || lookup_type_ == DICTIONARY_TYPE) {
248 Object* target = GetLazyValue();
249 return !target->IsJSObject() || JSObject::cast(target)->IsLoaded();
250 }
251 return true;
252 }
253
254 Object* GetLazyValue() { 245 Object* GetLazyValue() {
255 switch (type()) { 246 switch (type()) {
256 case FIELD: 247 case FIELD:
257 return holder()->FastPropertyAt(GetFieldIndex()); 248 return holder()->FastPropertyAt(GetFieldIndex());
258 case NORMAL: { 249 case NORMAL: {
259 Object* value; 250 Object* value;
260 value = holder()->property_dictionary()->ValueAt(GetDictionaryEntry()); 251 value = holder()->property_dictionary()->ValueAt(GetDictionaryEntry());
261 if (holder()->IsGlobalObject()) { 252 if (holder()->IsGlobalObject()) {
262 value = JSGlobalPropertyCell::cast(value)->value(); 253 value = JSGlobalPropertyCell::cast(value)->value();
263 } 254 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 JSObject* holder_; 309 JSObject* holder_;
319 int number_; 310 int number_;
320 bool cacheable_; 311 bool cacheable_;
321 PropertyDetails details_; 312 PropertyDetails details_;
322 }; 313 };
323 314
324 315
325 } } // namespace v8::internal 316 } } // namespace v8::internal
326 317
327 #endif // V8_PROPERTY_H_ 318 #endif // V8_PROPERTY_H_
OLDNEW
« no previous file with comments | « src/platform-win32.cc ('k') | src/regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698