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 @@
#define V8_COMPILER_SERIALIZER_FOR_BACKGROUND_COMPILATION_H_
#include "src/handles.h"
#include "src/maybe-handles.h"
#include "src/zone/zone-containers.h"
namespace v8 {
......@@ -110,7 +111,21 @@ class JSHeapBroker;
struct FunctionBlueprint {
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 {
......@@ -143,12 +158,12 @@ typedef ZoneVector<Hints> HintsVector;
class SerializerForBackgroundCompilation {
public:
SerializerForBackgroundCompilation(JSHeapBroker* broker, Zone* zone,
Handle<JSFunction> function);
Handle<JSFunction> closure);
Hints Run(); // NOTE: Returns empty for an already-serialized function.
private:
SerializerForBackgroundCompilation(JSHeapBroker* broker, Zone* zone,
FunctionBlueprint function,
CompilationSubject function,
const HintsVector& arguments);
void TraverseBytecode();
......@@ -160,24 +175,22 @@ class SerializerForBackgroundCompilation {
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,
bool with_spread = false);
void ProcessCallVarArgs(interpreter::BytecodeArrayIterator* iterator,
ConvertReceiverMode receiver_mode,
bool with_spread = false);
Hints RunChildSerializer(FunctionBlueprint function,
Hints RunChildSerializer(CompilationSubject function,
const HintsVector& arguments, bool with_spread);
JSHeapBroker* broker_;
Zone* zone_;
Handle<SharedFunctionInfo> shared_;
Handle<FeedbackVector> feedback_;
Environment* environment_;
JSHeapBroker* broker() const { return broker_; }
Zone* zone() const { return zone_; }
Environment* environment() const { return environment_; }
JSHeapBroker* const broker_;
Zone* const zone_;
Environment* const environment_;
};
} // 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