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

Unified Diff: src/runtime/runtime-scopes.cc

Issue 1152093003: [strong] create strong array literals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cl feedback Created 5 years, 7 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 | « src/runtime/runtime.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-scopes.cc
diff --git a/src/runtime/runtime-scopes.cc b/src/runtime/runtime-scopes.cc
index 9d35ffaed28305a53905ba8b13499619e0038a53..8dedcea6b0418866544c6beceab576e9f3ebe164 100644
--- a/src/runtime/runtime-scopes.cc
+++ b/src/runtime/runtime-scopes.cc
@@ -522,10 +522,9 @@ RUNTIME_FUNCTION(Runtime_NewStrictArguments) {
}
-static Handle<JSArray> NewRestParam(Isolate* isolate,
- Object** parameters,
- int num_params,
- int rest_index) {
+static Handle<JSArray> NewRestParam(Isolate* isolate, Object** parameters,
+ int num_params, int rest_index,
+ LanguageMode language_mode) {
parameters -= rest_index;
int num_elements = std::max(0, num_params - rest_index);
Handle<FixedArray> elements =
@@ -533,26 +532,29 @@ static Handle<JSArray> NewRestParam(Isolate* isolate,
for (int i = 0; i < num_elements; ++i) {
elements->set(i, *--parameters);
}
- return isolate->factory()->NewJSArrayWithElements(elements, FAST_ELEMENTS,
- num_elements);
+ return isolate->factory()->NewJSArrayWithElements(
+ elements, FAST_ELEMENTS, num_elements, strength(language_mode));
}
RUNTIME_FUNCTION(Runtime_NewRestParam) {
HandleScope scope(isolate);
- DCHECK(args.length() == 3);
+ DCHECK(args.length() == 4);
Object** parameters = reinterpret_cast<Object**>(args[0]);
CONVERT_SMI_ARG_CHECKED(num_params, 1);
CONVERT_SMI_ARG_CHECKED(rest_index, 2);
+ CONVERT_SMI_ARG_CHECKED(language_mode, 3);
- return *NewRestParam(isolate, parameters, num_params, rest_index);
+ return *NewRestParam(isolate, parameters, num_params, rest_index,
+ static_cast<LanguageMode>(language_mode));
}
RUNTIME_FUNCTION(Runtime_NewRestParamSlow) {
HandleScope scope(isolate);
- DCHECK(args.length() == 1);
+ DCHECK(args.length() == 2);
CONVERT_SMI_ARG_CHECKED(rest_index, 0);
+ CONVERT_SMI_ARG_CHECKED(language_mode, 1);
JavaScriptFrameIterator it(isolate);
@@ -563,7 +565,8 @@ RUNTIME_FUNCTION(Runtime_NewRestParamSlow) {
int argument_count = frame->GetArgumentsLength();
Object** parameters = reinterpret_cast<Object**>(frame->GetParameterSlot(-1));
- return *NewRestParam(isolate, parameters, argument_count, rest_index);
+ return *NewRestParam(isolate, parameters, argument_count, rest_index,
+ static_cast<LanguageMode>(language_mode));
}
« no previous file with comments | « src/runtime/runtime.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698