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

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

Issue 1548623002: [runtime] Also migrate the Function and GeneratorFunction constructors to C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix message tests. 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/runtime/runtime-compiler.cc ('k') | test/message/paren_in_arg_string.out » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-function.cc
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc
index d6c079ae6b63be37e5615e9debd3eef9d56bde45..9ec4cda81a11f4f2cfab49c28d7a8804599d75ea 100644
--- a/src/runtime/runtime-function.cc
+++ b/src/runtime/runtime-function.cc
@@ -38,48 +38,6 @@ RUNTIME_FUNCTION(Runtime_FunctionSetName) {
}
-RUNTIME_FUNCTION(Runtime_CompleteFunctionConstruction) {
- SealHandleScope shs(isolate);
- DCHECK(args.length() == 3);
- CONVERT_ARG_HANDLE_CHECKED(JSFunction, func, 0);
- CONVERT_ARG_HANDLE_CHECKED(JSFunction, constructor, 1);
- CONVERT_ARG_HANDLE_CHECKED(Object, unchecked_new_target, 2);
- func->shared()->set_name_should_print_as_anonymous(true);
-
- if (unchecked_new_target->IsUndefined()) return *func;
-
- Handle<JSReceiver> new_target =
- Handle<JSReceiver>::cast(unchecked_new_target);
- // If new.target is equal to |constructor| then the function |func| created
- // is already correctly setup and nothing else should be done here.
- // But if new.target is not equal to |constructor| then we are have a
- // Function builtin subclassing case and therefore the function |func|
- // has wrong initial map. To fix that we create a new function object with
- // correct initial map.
- if (*constructor == *new_target) return *func;
-
- // Create a new JSFunction object with correct initial map.
- HandleScope handle_scope(isolate);
-
- DCHECK(constructor->has_initial_map());
- Handle<Map> initial_map;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, initial_map,
- JSFunction::GetDerivedMap(isolate, constructor, new_target));
-
- Handle<SharedFunctionInfo> shared_info(func->shared(), isolate);
- Handle<Map> map = Map::AsLanguageMode(
- initial_map, shared_info->language_mode(), shared_info->kind());
-
- Handle<Context> context(func->context(), isolate);
- Handle<JSFunction> result =
- isolate->factory()->NewFunctionFromSharedFunctionInfo(
- map, shared_info, context, NOT_TENURED);
- DCHECK_EQ(func->IsConstructor(), result->IsConstructor());
- return *result;
-}
-
-
RUNTIME_FUNCTION(Runtime_FunctionRemovePrototype) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 1);
« no previous file with comments | « src/runtime/runtime-compiler.cc ('k') | test/message/paren_in_arg_string.out » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698