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

Unified Diff: src/full-codegen/full-codegen.cc

Issue 1635553002: [Interpreter] Add native function literal support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add back some skips for Arm64 Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler.cc ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/full-codegen.cc
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc
index 9819c3e554c6c1c8712a1a2da3fc50813d743082..7e0524f54be5fd2d29f14728f75367d532ec9953 100644
--- a/src/full-codegen/full-codegen.cc
+++ b/src/full-codegen/full-codegen.cc
@@ -1348,35 +1348,8 @@ void FullCodeGenerator::VisitClassLiteral(ClassLiteral* lit) {
void FullCodeGenerator::VisitNativeFunctionLiteral(
NativeFunctionLiteral* expr) {
Comment cmnt(masm_, "[ NativeFunctionLiteral");
-
- v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate());
-
- // Compute the function template for the native function.
- Handle<String> name = expr->name();
- v8::Local<v8::FunctionTemplate> fun_template =
- expr->extension()->GetNativeFunctionTemplate(v8_isolate,
- v8::Utils::ToLocal(name));
- DCHECK(!fun_template.IsEmpty());
-
- // Instantiate the function and create a shared function info from it.
- Handle<JSFunction> fun = Handle<JSFunction>::cast(Utils::OpenHandle(
- *fun_template->GetFunction(v8_isolate->GetCurrentContext())
- .ToLocalChecked()));
- const int literals = fun->NumberOfLiterals();
- Handle<Code> code = Handle<Code>(fun->shared()->code());
- Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub());
Handle<SharedFunctionInfo> shared =
- isolate()->factory()->NewSharedFunctionInfo(
- name, literals, FunctionKind::kNormalFunction, code,
- Handle<ScopeInfo>(fun->shared()->scope_info()),
- Handle<TypeFeedbackVector>(fun->shared()->feedback_vector()));
- shared->set_construct_stub(*construct_stub);
-
- // Copy the function data to the shared function info.
- shared->set_function_data(fun->shared()->function_data());
- int parameters = fun->shared()->internal_formal_parameter_count();
- shared->set_internal_formal_parameter_count(parameters);
-
+ Compiler::GetSharedFunctionInfoForNative(expr->extension(), expr->name());
EmitNewClosure(shared, false);
}
« no previous file with comments | « src/compiler.cc ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698