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

Unified Diff: src/objects.h

Issue 1183733006: Keep a canonical list of shared function infos. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: serializer tweak Created 5 years, 6 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
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index f7192b60c0f49f87c256555cfe473c8e2747f575..f2bbbe3291c3f1932feb3a60ac062e20d0c15332 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -6406,6 +6406,9 @@ class PrototypeInfo : public Struct {
};
+// Forward declaration.
+class SharedFunctionInfo;
Michael Starzinger 2015/06/19 11:17:08 nit: Can we just move this up to the forward decla
+
// Script describes a script which has been added to the VM.
class Script: public Struct {
public:
@@ -6464,6 +6467,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)
@@ -6511,6 +6518,11 @@ class Script: public Struct {
// Get the JS object wrapping the given script; create it if none exists.
static Handle<JSObject> GetWrapper(Handle<Script> script);
+ MaybeHandle<SharedFunctionInfo> FindSharedFunctionInfo(FunctionLiteral* fun);
Michael Starzinger 2015/06/19 11:17:08 nit: IMHO this function needs short explaining com
+
+ static void AddSharedFunctionInfo(Handle<Script> script,
Michael Starzinger 2015/06/19 11:17:08 nit: This shouldn't be needed anymore, correct?
+ Handle<SharedFunctionInfo> shared);
+
// Dispatched behavior.
DECLARE_PRINTER(Script)
DECLARE_VERIFIER(Script)
@@ -6527,8 +6539,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;
@@ -6659,6 +6672,9 @@ class SharedFunctionInfo: public HeapObject {
Handle<FixedArray> literals,
BailoutId osr_ast_id);
+ static void SetScript(Handle<SharedFunctionInfo> shared,
Michael Starzinger 2015/06/19 11:17:08 nit: Likewise, can we get a comment?
+ Handle<Object> script_object);
+
// Layout description of the optimized code map.
static const int kNextMapIndex = 0;
static const int kEntriesStart = 1;
@@ -6702,6 +6718,9 @@ class SharedFunctionInfo: public HeapObject {
// available.
DECL_ACCESSORS(feedback_vector, TypeFeedbackVector)
+ // A WeakFixedArray of inner shared function infos.
+ DECL_ACCESSORS(inner_functions, Object)
Michael Starzinger 2015/06/19 11:17:08 nit: This shouldn't be needed anymore, correct?
+
#if TRACE_MAPS
// [unique_id] - For --trace-maps purposes, an identifier that's persistent
// even if the GC moves this SharedFunctionInfo.

Powered by Google App Engine
This is Rietveld 408576698