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

Unified Diff: src/ast.cc

Issue 6304016: Fix bad assumption in object literal interpretation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build-x64
Patch Set: Created 9 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index fa01be016c038714976af27bb8c532ef39576bb5..0922d85056727d5cb001ed70eda5e5af22aaed36 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -239,12 +239,19 @@ void ObjectLiteral::CalculateEmitStore() {
HashMap* table;
void* key;
fschneider 2011/01/24 14:47:52 Could this be made an Object** since that's what .
Lasse Reichstein 2011/01/25 07:48:13 Not without some reinterpret-casts. There isn't a
uint32_t index;
+ Smi* smi_key_location;
if (handle->IsSymbol()) {
Handle<String> name(String::cast(*handle));
- ASSERT(!name->AsArrayIndex(&index));
- key = name.location();
- hash = name->Hash();
- table = &properties;
+ if (name->AsArrayIndex(&index)) {
+ smi_key_location = Smi::FromInt(index);
+ key = &smi_key_location;
+ hash = index;
+ table = &elements;
+ } else {
+ key = name.location();
+ hash = name->Hash();
+ table = &properties;
+ }
} else if (handle->ToArrayIndex(&index)) {
key = handle.location();
hash = index;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698