Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 844880c209a7fad2afa8278231a1f04b0ff77e17..1ae768ba0e50566c6540d1cc7a9a806486192a56 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -2269,6 +2269,17 @@ Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( |
return shared; |
} |
+Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfoForLiteral( |
+ FunctionLiteral* literal, Handle<Script> script) { |
+ Handle<Code> code = isolate()->builtins()->CompileLazy(); |
+ Handle<ScopeInfo> scope_info(ScopeInfo::Empty(isolate())); |
+ Handle<SharedFunctionInfo> result = NewSharedFunctionInfo( |
+ literal->name(), literal->materialized_literal_count(), literal->kind(), |
+ code, scope_info); |
+ SharedFunctionInfo::InitFromFunctionLiteral(result, literal); |
+ SharedFunctionInfo::SetScript(result, script); |
+ return result; |
+} |
Handle<JSMessageObject> Factory::NewJSMessageObject( |
MessageTemplate::Template message, Handle<Object> argument, |