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

Unified Diff: src/accessors.cc

Issue 1191313003: More cleanup related to setting array.length (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | src/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/accessors.cc
diff --git a/src/accessors.cc b/src/accessors.cc
index faa8e51e545d82c846f129e6df149ffd4ee06ef9..58db0024ea1b2f824e15fa634e07befa10aa5bc7 100644
--- a/src/accessors.cc
+++ b/src/accessors.cc
@@ -204,6 +204,7 @@ void Accessors::ArrayLengthSetter(
v8::Local<v8::Name> name,
v8::Local<v8::Value> val,
const v8::PropertyCallbackInfo<void>& info) {
+ // TODO(verwaest): Speed up.
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
HandleScope scope(isolate);
Handle<JSObject> object = Utils::OpenHandle(*info.This());
@@ -227,7 +228,9 @@ void Accessors::ArrayLengthSetter(
}
if (uint32_v->Number() == number_v->Number()) {
- maybe = JSArray::SetElementsLength(array_handle, uint32_v);
+ uint32_t new_length = 0;
+ CHECK(uint32_v->ToArrayLength(&new_length));
+ maybe = JSArray::ObservableSetLength(array_handle, new_length);
if (maybe.is_null()) isolate->OptionalRescheduleException(false);
return;
}
« no previous file with comments | « no previous file | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698