Index: src/builtins.h |
diff --git a/src/builtins.h b/src/builtins.h |
index a2f752e052fd881984e04b535cfb5a3077f57c3f..859edbc3f2084186e0bdcaaf136b527270e3a684 100644 |
--- a/src/builtins.h |
+++ b/src/builtins.h |
@@ -37,6 +37,18 @@ enum BuiltinExtraArguments { |
NEEDS_CALLED_FUNCTION = 1 |
}; |
+// Specifies whether or not a builtin should be part of the snapshot. |
+enum InSnapshot { |
+ NOT_IN_SNAPSHOT = 0, |
+ IN_SNAPSHOT = 1 |
+}; |
+ |
+#if defined(V8_TARGET_ARCH_ARM) |
+#define NOT_IN_ARM_SNAPSHOT NOT_IN_SNAPSHOT |
+#else |
+#define NOT_IN_ARM_SNAPSHOT IN_SNAPSHOT |
+#endif |
+ |
#define CODE_AGE_LIST_WITH_ARG(V, A) \ |
V(Quadragenarian, A) \ |
@@ -50,11 +62,11 @@ enum BuiltinExtraArguments { |
#define CODE_AGE_LIST(V) \ |
CODE_AGE_LIST_WITH_ARG(CODE_AGE_LIST_IGNORE_ARG, V) |
-#define DECLARE_CODE_AGE_BUILTIN(C, V) \ |
- V(Make##C##CodeYoungAgainOddMarking, BUILTIN, \ |
- UNINITIALIZED, Code::kNoExtraICState) \ |
- V(Make##C##CodeYoungAgainEvenMarking, BUILTIN, \ |
- UNINITIALIZED, Code::kNoExtraICState) |
+#define DECLARE_CODE_AGE_BUILTIN(C, V) \ |
+ V(Make##C##CodeYoungAgainOddMarking, BUILTIN, \ |
+ UNINITIALIZED, Code::kNoExtraICState, IN_SNAPSHOT) \ |
+ V(Make##C##CodeYoungAgainEvenMarking, BUILTIN, \ |
+ UNINITIALIZED, Code::kNoExtraICState, IN_SNAPSHOT) |
// Define list of builtins implemented in C++. |
@@ -84,166 +96,239 @@ enum BuiltinExtraArguments { |
// Define list of builtins implemented in assembly. |
#define BUILTIN_LIST_A(V) \ |
V(ArgumentsAdaptorTrampoline, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(InRecompileQueue, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(JSConstructStubCountdown, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(JSConstructStubGeneric, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(JSConstructStubApi, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(JSEntryTrampoline, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(JSConstructEntryTrampoline, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(LazyCompile, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(LazyRecompile, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(ParallelRecompile, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(NotifyDeoptimized, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(NotifyLazyDeoptimized, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(NotifyOSR, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
\ |
V(LoadIC_Miss, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(KeyedLoadIC_Miss, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(KeyedLoadIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(KeyedLoadIC_Slow, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(StoreIC_Miss, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(KeyedStoreIC_Miss, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(KeyedStoreIC_MissForceGeneric, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(KeyedStoreIC_Slow, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(LoadIC_Initialize, LOAD_IC, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(LoadIC_PreMonomorphic, LOAD_IC, PREMONOMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(LoadIC_Normal, LOAD_IC, MONOMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(LoadIC_ArrayLength, LOAD_IC, MONOMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(LoadIC_StringLength, LOAD_IC, MONOMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(LoadIC_StringWrapperLength, LOAD_IC, MONOMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(LoadIC_FunctionPrototype, LOAD_IC, MONOMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(LoadIC_Megamorphic, LOAD_IC, MEGAMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(LoadIC_Getter_ForDeopt, LOAD_IC, MONOMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
\ |
V(KeyedLoadIC_Initialize, KEYED_LOAD_IC, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(KeyedLoadIC_PreMonomorphic, KEYED_LOAD_IC, PREMONOMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(KeyedLoadIC_Generic, KEYED_LOAD_IC, MEGAMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(KeyedLoadIC_String, KEYED_LOAD_IC, MEGAMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(KeyedLoadIC_IndexedInterceptor, KEYED_LOAD_IC, MEGAMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(KeyedLoadIC_NonStrictArguments, KEYED_LOAD_IC, MEGAMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
\ |
V(StoreIC_Initialize, STORE_IC, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(StoreIC_ArrayLength, STORE_IC, MONOMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(StoreIC_Normal, STORE_IC, MONOMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(StoreIC_Megamorphic, STORE_IC, MEGAMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(StoreIC_GlobalProxy, STORE_IC, MEGAMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(StoreIC_Initialize_Strict, STORE_IC, UNINITIALIZED, \ |
- kStrictMode) \ |
+ kStrictMode, \ |
+ IN_SNAPSHOT) \ |
V(StoreIC_ArrayLength_Strict, STORE_IC, MONOMORPHIC, \ |
- kStrictMode) \ |
+ kStrictMode, \ |
+ IN_SNAPSHOT) \ |
V(StoreIC_Normal_Strict, STORE_IC, MONOMORPHIC, \ |
- kStrictMode) \ |
+ kStrictMode, \ |
+ IN_SNAPSHOT) \ |
V(StoreIC_Megamorphic_Strict, STORE_IC, MEGAMORPHIC, \ |
- kStrictMode) \ |
+ kStrictMode, \ |
+ IN_SNAPSHOT) \ |
V(StoreIC_GlobalProxy_Strict, STORE_IC, MEGAMORPHIC, \ |
- kStrictMode) \ |
+ kStrictMode, \ |
+ IN_SNAPSHOT) \ |
V(StoreIC_Setter_ForDeopt, STORE_IC, MONOMORPHIC, \ |
- kStrictMode) \ |
+ kStrictMode, \ |
+ IN_SNAPSHOT) \ |
\ |
V(KeyedStoreIC_Initialize, KEYED_STORE_IC, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(KeyedStoreIC_Generic, KEYED_STORE_IC, MEGAMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
\ |
V(KeyedStoreIC_Initialize_Strict, KEYED_STORE_IC, UNINITIALIZED, \ |
- kStrictMode) \ |
+ kStrictMode, \ |
+ IN_SNAPSHOT) \ |
V(KeyedStoreIC_Generic_Strict, KEYED_STORE_IC, MEGAMORPHIC, \ |
- kStrictMode) \ |
+ kStrictMode, \ |
+ IN_SNAPSHOT) \ |
V(KeyedStoreIC_NonStrictArguments, KEYED_STORE_IC, MEGAMORPHIC, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(TransitionElementsSmiToDouble, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(TransitionElementsDoubleToObject, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
\ |
/* Uses KeyedLoadIC_Initialize; must be after in list. */ \ |
V(FunctionCall, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(FunctionApply, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
\ |
V(InternalArrayCode, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(ArrayCode, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(ArrayConstructCode, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
\ |
V(StringConstructCode, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
\ |
V(OnStackReplacement, BUILTIN, UNINITIALIZED, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ NOT_IN_ARM_SNAPSHOT) \ |
CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, V) |
#ifdef ENABLE_DEBUGGER_SUPPORT |
// Define list of builtins used by the debugger implemented in assembly. |
#define BUILTIN_LIST_DEBUG_A(V) \ |
V(Return_DebugBreak, BUILTIN, DEBUG_BREAK, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(CallFunctionStub_DebugBreak, BUILTIN, DEBUG_BREAK, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(CallFunctionStub_Recording_DebugBreak, BUILTIN, DEBUG_BREAK, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(CallConstructStub_DebugBreak, BUILTIN, DEBUG_BREAK, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(CallConstructStub_Recording_DebugBreak, BUILTIN, DEBUG_BREAK, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(LoadIC_DebugBreak, LOAD_IC, DEBUG_BREAK, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(KeyedLoadIC_DebugBreak, KEYED_LOAD_IC, DEBUG_BREAK, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(StoreIC_DebugBreak, STORE_IC, DEBUG_BREAK, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(KeyedStoreIC_DebugBreak, KEYED_STORE_IC, DEBUG_BREAK, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(Slot_DebugBreak, BUILTIN, DEBUG_BREAK, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(PlainReturn_LiveEdit, BUILTIN, DEBUG_BREAK, \ |
- Code::kNoExtraICState) \ |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) \ |
V(FrameDropper_LiveEdit, BUILTIN, DEBUG_BREAK, \ |
- Code::kNoExtraICState) |
+ Code::kNoExtraICState, \ |
+ IN_SNAPSHOT) |
#else |
#define BUILTIN_LIST_DEBUG_A(V) |
#endif |
@@ -291,9 +376,16 @@ class Builtins { |
public: |
~Builtins(); |
- // Generate all builtin code objects. Should be called once during |
- // isolate initialization. |
- void SetUp(bool create_heap_objects); |
+ enum SetUpKind { |
+ FOR_SNAPSHOT, |
+ ALL, |
+ BEFORE_DESERIALIZATION, |
+ AFTER_DESERIALIZATION |
+ }; |
+ |
+ // Generate builtin code object. Should be called during isolate |
+ // initialization. |
+ void SetUp(SetUpKind kind); |
void TearDown(); |
// Garbage collection support. |
@@ -304,7 +396,7 @@ class Builtins { |
enum Name { |
#define DEF_ENUM_C(name, ignore) k##name, |
-#define DEF_ENUM_A(name, kind, state, extra) k##name, |
+#define DEF_ENUM_A(name, kind, state, extra, extra2) k##name, |
BUILTIN_LIST_C(DEF_ENUM_C) |
BUILTIN_LIST_A(DEF_ENUM_A) |
BUILTIN_LIST_DEBUG_A(DEF_ENUM_A) |
@@ -328,7 +420,7 @@ class Builtins { |
}; |
#define DECLARE_BUILTIN_ACCESSOR_C(name, ignore) Handle<Code> name(); |
-#define DECLARE_BUILTIN_ACCESSOR_A(name, kind, state, extra) \ |
+#define DECLARE_BUILTIN_ACCESSOR_A(name, kind, state, extra, extra2) \ |
Handle<Code> name(); |
BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C) |
BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A) |