Commit 0b9336ac authored by ager@chromium.org's avatar ager@chromium.org

Landing for Martin Maly.

Fix CalculateEmitStore HashMap use. 

The hash maps are setup to store strings or smis but instead Literal is being in them. It seems to only work by accident. 


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6279 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b522211a
...@@ -215,12 +215,16 @@ bool ObjectLiteral::Property::emit_store() { ...@@ -215,12 +215,16 @@ bool ObjectLiteral::Property::emit_store() {
bool IsEqualString(void* first, void* second) { bool IsEqualString(void* first, void* second) {
ASSERT((*reinterpret_cast<String**>(first))->IsString());
ASSERT((*reinterpret_cast<String**>(second))->IsString());
Handle<String> h1(reinterpret_cast<String**>(first)); Handle<String> h1(reinterpret_cast<String**>(first));
Handle<String> h2(reinterpret_cast<String**>(second)); Handle<String> h2(reinterpret_cast<String**>(second));
return (*h1)->Equals(*h2); return (*h1)->Equals(*h2);
} }
bool IsEqualSmi(void* first, void* second) { bool IsEqualSmi(void* first, void* second) {
ASSERT((*reinterpret_cast<Smi**>(first))->IsSmi());
ASSERT((*reinterpret_cast<Smi**>(second))->IsSmi());
Handle<Smi> h1(reinterpret_cast<Smi**>(first)); Handle<Smi> h1(reinterpret_cast<Smi**>(first));
Handle<Smi> h2(reinterpret_cast<Smi**>(second)); Handle<Smi> h2(reinterpret_cast<Smi**>(second));
return (*h1)->value() == (*h2)->value(); return (*h1)->value() == (*h2)->value();
...@@ -266,12 +270,12 @@ void ObjectLiteral::CalculateEmitStore() { ...@@ -266,12 +270,12 @@ void ObjectLiteral::CalculateEmitStore() {
// If the key of a computed property is in the table, do not emit // If the key of a computed property is in the table, do not emit
// a store for the property later. // a store for the property later.
if (property->kind() == ObjectLiteral::Property::COMPUTED) { if (property->kind() == ObjectLiteral::Property::COMPUTED) {
if (table->Lookup(literal, hash, false) != NULL) { if (table->Lookup(key, hash, false) != NULL) {
property->set_emit_store(false); property->set_emit_store(false);
} }
} }
// Add key to the table. // Add key to the table.
table->Lookup(literal, hash, true); table->Lookup(key, hash, true);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment