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

Side by Side Diff: src/objects.cc

Issue 863693002: Use RETURN_ON_EXCEPTION rather than .Assert when setting .length, which may fail due to stack overf… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <sstream> 5 #include <sstream>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/accessors.h" 9 #include "src/accessors.h"
10 #include "src/allocation-site-scopes.h" 10 #include "src/allocation-site-scopes.h"
(...skipping 11636 matching lines...) Expand 10 before | Expand all | Expand 10 after
11647 Handle<JSArray> deleted = isolate->factory()->NewJSArray(0); 11647 Handle<JSArray> deleted = isolate->factory()->NewJSArray(0);
11648 if (delete_count > 0) { 11648 if (delete_count > 0) {
11649 for (int i = indices.length() - 1; i >= 0; i--) { 11649 for (int i = indices.length() - 1; i >= 0; i--) {
11650 // Skip deletions where the property was an accessor, leaving holes 11650 // Skip deletions where the property was an accessor, leaving holes
11651 // in the array of old values. 11651 // in the array of old values.
11652 if (old_values[i]->IsTheHole()) continue; 11652 if (old_values[i]->IsTheHole()) continue;
11653 JSObject::SetOwnElement(deleted, indices[i] - index, old_values[i], 11653 JSObject::SetOwnElement(deleted, indices[i] - index, old_values[i],
11654 SLOPPY).Assert(); 11654 SLOPPY).Assert();
11655 } 11655 }
11656 11656
11657 SetProperty(deleted, isolate->factory()->length_string(), 11657 RETURN_ON_EXCEPTION(
11658 isolate->factory()->NewNumberFromUint(delete_count), 11658 isolate,
11659 STRICT).Assert(); 11659 SetProperty(deleted, isolate->factory()->length_string(),
11660 isolate->factory()->NewNumberFromUint(delete_count),
11661 STRICT),
11662 Object);
11660 } 11663 }
11661 11664
11662 RETURN_ON_EXCEPTION( 11665 RETURN_ON_EXCEPTION(
11663 isolate, EnqueueSpliceRecord(array, index, deleted, add_count), Object); 11666 isolate, EnqueueSpliceRecord(array, index, deleted, add_count), Object);
11664 11667
11665 return hresult; 11668 return hresult;
11666 } 11669 }
11667 11670
11668 11671
11669 Handle<Map> Map::GetPrototypeTransition(Handle<Map> map, 11672 Handle<Map> Map::GetPrototypeTransition(Handle<Map> map,
(...skipping 5163 matching lines...) Expand 10 before | Expand all | Expand 10 after
16833 Handle<DependentCode> codes = 16836 Handle<DependentCode> codes =
16834 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), 16837 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()),
16835 DependentCode::kPropertyCellChangedGroup, 16838 DependentCode::kPropertyCellChangedGroup,
16836 info->object_wrapper()); 16839 info->object_wrapper());
16837 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); 16840 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes);
16838 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( 16841 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
16839 cell, info->zone()); 16842 cell, info->zone());
16840 } 16843 }
16841 16844
16842 } } // namespace v8::internal 16845 } } // namespace v8::internal
OLDNEW
« 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