Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index b3f428cb3a793ffbb2c940fd7040cda7d65b1c54..f8ccdb597fe16fd8aa2a5b219af90f36fc9828a0 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -3921,12 +3921,16 @@ HInstruction* HGraphBuilder::BuildMonomorphicElementAccess(HValue* object, |
val, map->elements_kind(), is_store); |
} |
ASSERT(map->has_fast_elements()); |
+ HInstruction* elements_cow_map_check = new(zone()) HCheckMap( |
Vyacheslav Egorov (Chromium)
2011/07/14 13:03:44
I find the name of the variable confusing. We are
Jakob Kummerow
2011/07/14 14:44:49
Done, sort of: I've removed the variable completel
|
+ elements, isolate()->factory()->fixed_array_map()); |
if (map->instance_type() == JS_ARRAY_TYPE) { |
length = AddInstruction(new(zone()) HJSArrayLength(object)); |
checked_key = AddInstruction(new(zone()) HBoundsCheck(key, length)); |
AddInstruction(elements); |
+ AddInstruction(elements_cow_map_check); |
Vyacheslav Egorov (Chromium)
2011/07/14 13:03:44
This map check is redundant if !is_store.
Can you
Jakob Kummerow
2011/07/14 14:44:49
Done.
|
} else { |
AddInstruction(elements); |
+ AddInstruction(elements_cow_map_check); |
Vyacheslav Egorov (Chromium)
2011/07/14 13:03:44
Ditto.
Jakob Kummerow
2011/07/14 14:44:49
Done.
|
length = AddInstruction(new(zone()) HFixedArrayLength(elements)); |
checked_key = AddInstruction(new(zone()) HBoundsCheck(key, length)); |
} |
@@ -4032,6 +4036,8 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object, |
checked_key = AddInstruction(new(zone()) HBoundsCheck(key, length)); |
elements = AddInstruction(new(zone()) HLoadElements(object)); |
elements->ClearFlag(HValue::kUseGVN); |
+ AddInstruction(new(zone()) HCheckMap( |
Vyacheslav Egorov (Chromium)
2011/07/14 13:03:44
redundant if !is_store
Jakob Kummerow
2011/07/14 14:44:49
Done.
|
+ elements, isolate()->factory()->fixed_array_map())); |
if (is_store) { |
access = AddInstruction( |
new(zone()) HStoreKeyedFastElement(elements, checked_key, val)); |
@@ -4049,6 +4055,8 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object, |
set_current_block(if_fastobject); |
elements = AddInstruction(new(zone()) HLoadElements(object)); |
elements->ClearFlag(HValue::kUseGVN); |
+ AddInstruction(new(zone()) HCheckMap( |
Vyacheslav Egorov (Chromium)
2011/07/14 13:03:44
This map check is redundant if !is_store
Jakob Kummerow
2011/07/14 14:44:49
Done.
|
+ elements, isolate()->factory()->fixed_array_map())); |
length = AddInstruction(new(zone()) HFixedArrayLength(elements)); |
checked_key = AddInstruction(new(zone()) HBoundsCheck(key, length)); |
if (is_store) { |