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

Unified Diff: src/builtins.cc

Issue 669162: An attempt to fix the tests. (Closed)
Patch Set: Created 10 years, 10 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/array-splice.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index 46c3748286b91509afcf4c8399f9f9e7342107d8..00044404dd18b3431bf2c54f4687869669c8c565 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -665,8 +665,6 @@ BUILTIN(ArraySplice) {
// we should never hit this case.
ASSERT((item_count - actual_delete_count) <= (Smi::kMaxValue - len));
- FixedArray* source_elms = elms;
-
// Check if array need to grow.
if (new_length > elms->length()) {
// New backing storage is needed.
@@ -678,18 +676,21 @@ BUILTIN(ArraySplice) {
AssertNoAllocation no_gc;
// Copy the part before actual_start as is.
CopyElements(&no_gc, new_elms, 0, elms, 0, actual_start);
+ CopyElements(&no_gc,
+ new_elms, actual_start + item_count,
+ elms, actual_start + actual_delete_count,
+ (len - actual_delete_count - actual_start));
FillWithHoles(new_elms, new_length, capacity);
- source_elms = elms;
elms = new_elms;
array->set_elements(elms);
+ } else {
+ AssertNoAllocation no_gc;
+ MoveElements(&no_gc,
+ elms, actual_start + item_count,
+ elms, actual_start + actual_delete_count,
+ (len - actual_delete_count - actual_start));
}
-
- AssertNoAllocation no_gc;
- MoveElements(&no_gc,
- elms, actual_start + item_count,
- source_elms, actual_start + actual_delete_count,
- (len - actual_delete_count - actual_start));
}
AssertNoAllocation no_gc;
« no previous file with comments | « no previous file | test/mjsunit/array-splice.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698