Index: src/factory.h |
diff --git a/src/factory.h b/src/factory.h |
index 172f473a11fec0d337081193530da29649cbe508..befc5056806358faf5bac80e4612b58d411da214 100644 |
--- a/src/factory.h |
+++ b/src/factory.h |
@@ -12,6 +12,14 @@ |
namespace v8 { |
namespace internal { |
+enum FunctionMode { |
+ // With prototype. |
+ FUNCTION_WITH_WRITEABLE_PROTOTYPE, |
+ FUNCTION_WITH_READONLY_PROTOTYPE, |
+ // Without prototype. |
+ FUNCTION_WITHOUT_PROTOTYPE |
+}; |
+ |
// Interface for handle based allocation. |
class Factory final { |
public: |
@@ -644,6 +652,16 @@ class Factory final { |
MaybeHandle<Code> code, |
bool is_constructor); |
+ static bool IsFunctionModeWithPrototype(FunctionMode function_mode) { |
+ return (function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE || |
+ function_mode == FUNCTION_WITH_READONLY_PROTOTYPE); |
+ } |
+ |
+ Handle<Map> CreateSloppyFunctionMap(FunctionMode function_mode); |
+ |
+ Handle<Map> CreateStrictFunctionMap(FunctionMode function_mode, |
+ Handle<JSFunction> empty_function); |
+ |
// Allocates a new JSMessageObject object. |
Handle<JSMessageObject> NewJSMessageObject(MessageTemplate::Template message, |
Handle<Object> argument, |
@@ -717,6 +735,12 @@ class Factory final { |
// Create a JSArray with no elements and no length. |
Handle<JSArray> NewJSArray(ElementsKind elements_kind, |
PretenureFlag pretenure = NOT_TENURED); |
+ |
+ void SetFunctionInstanceDescriptor(Handle<Map> map, |
+ FunctionMode function_mode); |
+ |
+ void SetStrictFunctionInstanceDescriptor(Handle<Map> map, |
+ FunctionMode function_mode); |
}; |
} // namespace internal |