Commit 58078730 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[turbofan] Teach the serializer about the closure register.

Rearrange things such that when creating the environment we have
access to the subject of compilation (either a full JSFunction or
just a FunctionBlueprint).

Bug: v8:7790
Change-Id: I03cc4701eb8bc1ed44c8381f4ab82da5f9b840b8
Reviewed-on: https://chromium-review.googlesource.com/c/1434374
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59091}
parent aaa38048
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define V8_COMPILER_SERIALIZER_FOR_BACKGROUND_COMPILATION_H_ #define V8_COMPILER_SERIALIZER_FOR_BACKGROUND_COMPILATION_H_
#include "src/handles.h" #include "src/handles.h"
#include "src/maybe-handles.h"
#include "src/zone/zone-containers.h" #include "src/zone/zone-containers.h"
namespace v8 { namespace v8 {
...@@ -110,7 +111,21 @@ class JSHeapBroker; ...@@ -110,7 +111,21 @@ class JSHeapBroker;
struct FunctionBlueprint { struct FunctionBlueprint {
Handle<SharedFunctionInfo> shared; Handle<SharedFunctionInfo> shared;
Handle<FeedbackVector> feedback; Handle<FeedbackVector> feedback_vector;
};
class CompilationSubject {
public:
explicit CompilationSubject(FunctionBlueprint blueprint)
: blueprint_(blueprint) {}
CompilationSubject(Handle<JSFunction> closure, Isolate* isolate);
FunctionBlueprint blueprint() const { return blueprint_; }
MaybeHandle<JSFunction> closure() const { return closure_; }
private:
FunctionBlueprint blueprint_;
MaybeHandle<JSFunction> closure_;
}; };
class Hints { class Hints {
...@@ -143,12 +158,12 @@ typedef ZoneVector<Hints> HintsVector; ...@@ -143,12 +158,12 @@ typedef ZoneVector<Hints> HintsVector;
class SerializerForBackgroundCompilation { class SerializerForBackgroundCompilation {
public: public:
SerializerForBackgroundCompilation(JSHeapBroker* broker, Zone* zone, SerializerForBackgroundCompilation(JSHeapBroker* broker, Zone* zone,
Handle<JSFunction> function); Handle<JSFunction> closure);
Hints Run(); // NOTE: Returns empty for an already-serialized function. Hints Run(); // NOTE: Returns empty for an already-serialized function.
private: private:
SerializerForBackgroundCompilation(JSHeapBroker* broker, Zone* zone, SerializerForBackgroundCompilation(JSHeapBroker* broker, Zone* zone,
FunctionBlueprint function, CompilationSubject function,
const HintsVector& arguments); const HintsVector& arguments);
void TraverseBytecode(); void TraverseBytecode();
...@@ -160,24 +175,22 @@ class SerializerForBackgroundCompilation { ...@@ -160,24 +175,22 @@ class SerializerForBackgroundCompilation {
class Environment; class Environment;
Zone* zone() const { return zone_; }
JSHeapBroker* broker() const { return broker_; }
Environment* environment() const { return environment_; }
void ProcessCallOrConstruct(const Hints& callee, const HintsVector& arguments, void ProcessCallOrConstruct(const Hints& callee, const HintsVector& arguments,
bool with_spread = false); bool with_spread = false);
void ProcessCallVarArgs(interpreter::BytecodeArrayIterator* iterator, void ProcessCallVarArgs(interpreter::BytecodeArrayIterator* iterator,
ConvertReceiverMode receiver_mode, ConvertReceiverMode receiver_mode,
bool with_spread = false); bool with_spread = false);
Hints RunChildSerializer(FunctionBlueprint function, Hints RunChildSerializer(CompilationSubject function,
const HintsVector& arguments, bool with_spread); const HintsVector& arguments, bool with_spread);
JSHeapBroker* broker_; JSHeapBroker* broker() const { return broker_; }
Zone* zone_; Zone* zone() const { return zone_; }
Handle<SharedFunctionInfo> shared_; Environment* environment() const { return environment_; }
Handle<FeedbackVector> feedback_;
Environment* environment_; JSHeapBroker* const broker_;
Zone* const zone_;
Environment* const environment_;
}; };
} // namespace compiler } // namespace compiler
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment