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

Unified Diff: src/runtime.cc

Issue 155212: Fixed and exposure to the_hole from Runtime_KeyedGetProperty.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/global-deleted-property-keyed.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 2389)
+++ src/runtime.cc (working copy)
@@ -2598,15 +2598,13 @@
Object* value = receiver->FastPropertyAt(offset);
return value->IsTheHole() ? Heap::undefined_value() : value;
}
- // Lookup cache miss. Perform lookup and update the cache if
- // appropriate.
+ // Lookup cache miss. Perform lookup and update the cache if appropriate.
LookupResult result;
receiver->LocalLookup(key, &result);
if (result.IsProperty() && result.IsLoaded() && result.type() == FIELD) {
int offset = result.GetFieldIndex();
KeyedLookupCache::Update(receiver_map, key, offset);
- Object* value = receiver->FastPropertyAt(offset);
- return value->IsTheHole() ? Heap::undefined_value() : value;
+ return receiver->FastPropertyAt(offset);
}
} else {
// Attempt dictionary lookup.
@@ -2615,10 +2613,10 @@
if ((entry != StringDictionary::kNotFound) &&
(dictionary->DetailsAt(entry).type() == NORMAL)) {
Object* value = dictionary->ValueAt(entry);
- if (receiver->IsGlobalObject()) {
- value = JSGlobalPropertyCell::cast(value)->value();
- }
- return value;
+ if (!receiver->IsGlobalObject()) return value;
+ value = JSGlobalPropertyCell::cast(value)->value();
+ if (!value->IsTheHole()) return value;
+ // If value is the hole do the general lookup.
}
}
}
« no previous file with comments | « no previous file | test/mjsunit/global-deleted-property-keyed.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698