Index: src/factory.cc |
=================================================================== |
--- src/factory.cc (revision 4462) |
+++ src/factory.cc (working copy) |
@@ -513,6 +513,16 @@ |
} |
+Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name, |
+ Handle<Code> code) { |
+ Handle<JSFunction> function = NewFunctionWithoutPrototype(name); |
+ function->set_code(*code); |
+ ASSERT(!function->has_initial_map()); |
+ ASSERT(!function->has_prototype()); |
+ return function; |
+} |
+ |
+ |
Handle<Code> Factory::NewCode(const CodeDesc& desc, |
ZoneScopeInfo* sinfo, |
Code::Flags flags, |
@@ -705,6 +715,24 @@ |
} |
+Handle<JSFunction> Factory::NewFunctionWithoutPrototypeHelper( |
+ Handle<String> name) { |
+ Handle<SharedFunctionInfo> function_share = NewSharedFunctionInfo(name); |
+ CALL_HEAP_FUNCTION(Heap::AllocateFunction( |
+ *Top::function_without_prototype_map(), |
+ *function_share, |
+ *the_hole_value()), |
+ JSFunction); |
+} |
+ |
+ |
+Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name) { |
+ Handle<JSFunction> fun = NewFunctionWithoutPrototypeHelper(name); |
+ fun->set_context(Top::context()->global_context()); |
+ return fun; |
+} |
+ |
+ |
Handle<Object> Factory::ToObject(Handle<Object> object) { |
CALL_HEAP_FUNCTION(object->ToObject(), Object); |
} |