Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index 785fa987b71fda3665c638c524f59a7edfc37fc3..c5f7217df2a5127722423ec33ca03715ced5a700 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -875,16 +875,23 @@ class AccessorPair; |
class AllocationSite; |
class AllocationSiteCreationContext; |
class AllocationSiteUsageContext; |
+class Cell; |
class ConsString; |
class DictionaryElementsAccessor; |
class ElementsAccessor; |
class FixedArrayBase; |
class FunctionLiteral; |
class GlobalObject; |
+class JSBuiltinsObject; |
class LayoutDescriptor; |
class LookupIterator; |
+class ObjectHashTable; |
class ObjectVisitor; |
+class PropertyCell; |
+class SafepointEntry; |
+class SharedFunctionInfo; |
class StringStream; |
+class TypeFeedbackInfo; |
class TypeFeedbackVector; |
class WeakCell; |
@@ -1733,9 +1740,6 @@ class JSReceiver: public HeapObject { |
DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver); |
}; |
-// Forward declaration for JSObject::GetOrCreateHiddenPropertiesHashTable. |
-class ObjectHashTable; |
- |
// The JSObject describes real heap allocated JavaScript objects with |
// properties. |
@@ -4846,12 +4850,6 @@ class HandlerTable : public FixedArray { |
}; |
-// Forward declaration. |
-class Cell; |
-class PropertyCell; |
-class SafepointEntry; |
-class TypeFeedbackInfo; |
- |
// Code describes objects with on-the-fly generated machine code. |
class Code: public HeapObject { |
public: |
@@ -6415,6 +6413,10 @@ class Script: public Struct { |
// function from which eval was called where eval was called. |
DECL_ACCESSORS(eval_from_instructions_offset, Smi) |
+ // [shared_function_infos]: weak fixed array containing all shared |
+ // function infos created from this script. |
+ DECL_ACCESSORS(shared_function_infos, Object) |
+ |
// [flags]: Holds an exciting bitfield. |
DECL_ACCESSORS(flags, Smi) |
@@ -6462,6 +6464,10 @@ class Script: public Struct { |
// Get the JS object wrapping the given script; create it if none exists. |
static Handle<JSObject> GetWrapper(Handle<Script> script); |
+ // Look through the list of existing shared function infos to find one |
+ // that matches the function literal. Return empty handle if not found. |
+ MaybeHandle<SharedFunctionInfo> FindSharedFunctionInfo(FunctionLiteral* fun); |
+ |
// Dispatched behavior. |
DECLARE_PRINTER(Script) |
DECLARE_VERIFIER(Script) |
@@ -6478,8 +6484,9 @@ class Script: public Struct { |
static const int kEvalFromSharedOffset = kIdOffset + kPointerSize; |
static const int kEvalFrominstructionsOffsetOffset = |
kEvalFromSharedOffset + kPointerSize; |
- static const int kFlagsOffset = |
+ static const int kSharedFunctionInfosOffset = |
kEvalFrominstructionsOffsetOffset + kPointerSize; |
+ static const int kFlagsOffset = kSharedFunctionInfosOffset + kPointerSize; |
static const int kSourceUrlOffset = kFlagsOffset + kPointerSize; |
static const int kSourceMappingUrlOffset = kSourceUrlOffset + kPointerSize; |
static const int kSize = kSourceMappingUrlOffset + kPointerSize; |
@@ -6610,6 +6617,11 @@ class SharedFunctionInfo: public HeapObject { |
Handle<FixedArray> literals, |
BailoutId osr_ast_id); |
+ // Set up the link between shared function info and the script. The shared |
+ // function info is added to the list on the script. |
+ static void SetScript(Handle<SharedFunctionInfo> shared, |
+ Handle<Object> script_object); |
+ |
// Layout description of the optimized code map. |
static const int kNextMapIndex = 0; |
static const int kEntriesStart = 1; |
@@ -6823,6 +6835,9 @@ class SharedFunctionInfo: public HeapObject { |
// Indicates that the the shared function info is deserialized from cache. |
DECL_BOOLEAN_ACCESSORS(deserialized) |
+ // Indicates that the the shared function info has never been compiled before. |
+ DECL_BOOLEAN_ACCESSORS(never_compiled) |
+ |
inline FunctionKind kind(); |
inline void set_kind(FunctionKind kind); |
@@ -7072,6 +7087,7 @@ class SharedFunctionInfo: public HeapObject { |
kInClassLiteral, |
kIsAsmFunction, |
kDeserialized, |
+ kNeverCompiled, |
kCompilerHintsCount // Pseudo entry |
}; |
// Add hints for other modes when they're added. |
@@ -7489,9 +7505,6 @@ class JSGlobalProxy : public JSObject { |
}; |
-// Forward declaration. |
-class JSBuiltinsObject; |
- |
// Common super class for JavaScript global objects and the special |
// builtins global objects. |
class GlobalObject: public JSObject { |