Commit 76569704 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[compiler] Move list of inlined functions to Crankshaft.

The data-structure in question is only used by Crankshaft, it can safely
be moved into the backend to avoid exposure through the CompilationInfo.

R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/1977473002
Cr-Commit-Position: refs/heads/master@{#36232}
parent b32f9599
......@@ -120,13 +120,6 @@ class Compiler : public AllStatic {
JavaScriptFrame* osr_frame);
};
// TODO(mstarzinger): Move this into the "crankshaft" directory.
struct InlinedFunctionInfo {
explicit InlinedFunctionInfo(int start_position)
: start_position(start_position) {}
int start_position;
};
// CompilationInfo encapsulates some information known at compile time. It
// is constructed based on the resources available at compile-time.
......@@ -386,10 +379,6 @@ class CompilationInfo final {
prologue_offset_ = prologue_offset;
}
std::vector<InlinedFunctionInfo>& inlined_function_infos() {
return inlined_function_infos_;
}
CompilationDependencies* dependencies() { return &dependencies_; }
int optimization_id() const { return optimization_id_; }
......@@ -519,7 +508,6 @@ class CompilationInfo final {
int prologue_offset_;
std::vector<InlinedFunctionInfo> inlined_function_infos_;
bool track_positions_;
InlinedFunctionList inlined_functions_;
......
......@@ -1373,8 +1373,8 @@ int HGraphBuilder::TraceInlinedFunction(Handle<SharedFunctionInfo> shared,
SourcePosition position) {
DCHECK(info_->is_tracking_positions());
int inline_id = static_cast<int>(info_->inlined_function_infos().size());
InlinedFunctionInfo info(shared->start_position());
int inline_id = static_cast<int>(graph()->inlined_function_infos().size());
HInlinedFunctionInfo info(shared->start_position());
if (!shared->script()->IsUndefined()) {
Handle<Script> script(Script::cast(shared->script()));
......@@ -1403,7 +1403,7 @@ int HGraphBuilder::TraceInlinedFunction(Handle<SharedFunctionInfo> shared,
}
}
info_->inlined_function_infos().push_back(info);
graph()->inlined_function_infos().push_back(info);
if (FLAG_hydrogen_track_positions && inline_id != 0) {
CodeTracer::Scope tracing_scope(isolate()->GetCodeTracer());
......@@ -3792,7 +3792,8 @@ HGraph::HGraph(CompilationInfo* info, CallInterfaceDescriptor descriptor)
type_change_checksum_(0),
maximum_environment_size_(0),
no_side_effects_scope_count_(0),
disallow_adding_new_values_(false) {
disallow_adding_new_values_(false),
inlined_function_infos_(info->zone()) {
if (info->IsStub()) {
// For stubs, explicitly add the context to the environment.
start_environment_ = new (zone_)
......@@ -3826,9 +3827,7 @@ void HGraph::FinalizeUniqueness() {
int HGraph::SourcePositionToScriptPosition(SourcePosition pos) {
return (FLAG_hydrogen_track_positions && !pos.IsUnknown())
? info()->inlined_function_infos()
.at(pos.inlining_id())
.start_position +
? inlined_function_infos_.at(pos.inlining_id()).start_position +
pos.position()
: pos.raw();
}
......
......@@ -317,6 +317,11 @@ class HLoopInformation final : public ZoneObject {
HStackCheck* stack_check_;
};
struct HInlinedFunctionInfo {
explicit HInlinedFunctionInfo(int start_position)
: start_position(start_position) {}
int start_position;
};
class HGraph final : public ZoneObject {
public:
......@@ -466,6 +471,10 @@ class HGraph final : public ZoneObject {
// the corresponding script.
int SourcePositionToScriptPosition(SourcePosition position);
ZoneVector<HInlinedFunctionInfo>& inlined_function_infos() {
return inlined_function_infos_;
}
private:
HConstant* ReinsertConstantIfNecessary(HConstant* constant);
HConstant* GetConstant(SetOncePointer<HConstant>* pointer,
......@@ -510,6 +519,8 @@ class HGraph final : public ZoneObject {
int no_side_effects_scope_count_;
bool disallow_adding_new_values_;
ZoneVector<HInlinedFunctionInfo> inlined_function_infos_;
DISALLOW_COPY_AND_ASSIGN(HGraph);
};
......
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