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

Unified Diff: src/factory.h

Issue 2156153002: Move function map creation code from boostrapper to factory (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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/bootstrapper.cc ('k') | src/factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/bootstrapper.cc ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698