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

Unified Diff: src/hydrogen.cc

Issue 7366008: Add map check for COW elements to crankshaft array handling code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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/regress/regress-1560.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1560.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698