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

Unified Diff: src/bootstrapper.cc

Issue 1523753002: [es6] Correct Function.prototype.apply, Reflect.construct and Reflect.apply. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Mark mjsunit/apply as TIMEOUT (for tsan). Created 5 years 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/arm64/builtins-arm64.cc ('k') | src/builtins.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index fe13d961d67f6a24cefa6b5b68b2b1b815cf6a8b..4409d935229c792c59d0039a7d8ad205f0357fc4 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1865,11 +1865,8 @@ void Bootstrapper::ExportFromRuntime(Isolate* isolate,
Handle<JSFunction> apply = InstallFunction(
container, "reflect_apply", JS_OBJECT_TYPE, JSObject::kHeaderSize,
MaybeHandle<JSObject>(), Builtins::kReflectApply);
- apply->shared()->set_internal_formal_parameter_count(3);
+ apply->shared()->DontAdaptArguments();
apply->shared()->set_length(3);
- Handle<TypeFeedbackVector> feedback_vector =
- TypeFeedbackVector::CreatePushAppliedArgumentsVector(isolate);
- apply->shared()->set_feedback_vector(*feedback_vector);
native_context->set_reflect_apply(*apply);
}
@@ -1877,11 +1874,8 @@ void Bootstrapper::ExportFromRuntime(Isolate* isolate,
Handle<JSFunction> construct = InstallFunction(
container, "reflect_construct", JS_OBJECT_TYPE, JSObject::kHeaderSize,
MaybeHandle<JSObject>(), Builtins::kReflectConstruct);
- construct->shared()->set_internal_formal_parameter_count(3);
+ construct->shared()->DontAdaptArguments();
construct->shared()->set_length(2);
- Handle<TypeFeedbackVector> feedback_vector =
- TypeFeedbackVector::CreatePushAppliedArgumentsVector(isolate);
- construct->shared()->set_feedback_vector(*feedback_vector);
native_context->set_reflect_construct(*construct);
}
@@ -2535,22 +2529,17 @@ bool Genesis::InstallNatives(ContextType context_type) {
Handle<JSFunction> apply =
InstallFunction(proto, "apply", JS_OBJECT_TYPE, JSObject::kHeaderSize,
MaybeHandle<JSObject>(), Builtins::kFunctionApply);
- Handle<TypeFeedbackVector> feedback_vector =
- TypeFeedbackVector::CreatePushAppliedArgumentsVector(isolate());
- apply->shared()->set_feedback_vector(*feedback_vector);
// Make sure that Function.prototype.call appears to be compiled.
// The code will never be called, but inline caching for call will
// only work if it appears to be compiled.
+ apply->shared()->DontAdaptArguments();
call->shared()->DontAdaptArguments();
DCHECK(call->is_compiled());
- // Set the expected parameters for apply to 2; required by builtin.
- apply->shared()->set_internal_formal_parameter_count(2);
-
// Set the lengths for the functions to satisfy ECMA-262.
- call->shared()->set_length(1);
apply->shared()->set_length(2);
+ call->shared()->set_length(1);
}
// Set up the Promise constructor.
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698