Commit 8d1ec9b1 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[compiler] Stop delegating CompilationInfo::context.

This implements the CompilationInfo::context explicitly instead of
delegating to the underlying ParseInfo. This is in preparation for
ParseInfo not having to store the context at all soon.

R=jochen@chromium.org

Review-Url: https://codereview.chromium.org/2316083002
Cr-Commit-Position: refs/heads/master@{#39244}
parent ce3f46b1
......@@ -27,8 +27,6 @@ namespace internal {
PARSE_INFO_GETTER(Handle<Script>, script)
PARSE_INFO_GETTER(FunctionLiteral*, literal)
PARSE_INFO_GETTER_WITH_DEFAULT(DeclarationScope*, scope, nullptr)
PARSE_INFO_GETTER_WITH_DEFAULT(Handle<Context>, context,
Handle<Context>::null())
PARSE_INFO_GETTER(Handle<SharedFunctionInfo>, shared_info)
#undef PARSE_INFO_GETTER
......@@ -178,6 +176,12 @@ bool CompilationInfo::ExpectsJSReceiverAsReceiver() {
return is_sloppy(parse_info()->language_mode()) && !parse_info()->is_native();
}
bool CompilationInfo::has_context() const { return !closure().is_null(); }
Context* CompilationInfo::context() const {
return has_context() ? closure()->context() : nullptr;
}
bool CompilationInfo::has_native_context() const {
return !closure().is_null() && (closure()->native_context() != nullptr);
}
......
......@@ -68,7 +68,6 @@ class CompilationInfo final {
Handle<Script> script() const;
FunctionLiteral* literal() const;
DeclarationScope* scope() const;
Handle<Context> context() const;
Handle<SharedFunctionInfo> shared_info() const;
bool has_shared_info() const;
// -----------------------------------------------------------
......@@ -218,6 +217,9 @@ class CompilationInfo final {
(FLAG_trap_on_stub_deopt && IsStub());
}
bool has_context() const;
Context* context() const;
bool has_native_context() const;
Context* native_context() const;
......
......@@ -284,7 +284,7 @@ void CodeGenerator::RecordSafepoint(ReferenceMap* references,
bool CodeGenerator::IsMaterializableFromFrame(Handle<HeapObject> object,
int* slot_return) {
if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) {
if (object.is_identical_to(info()->context()) && !info()->is_osr()) {
if (*object == info()->context() && !info()->is_osr()) {
*slot_return = Frame::kContextSlot;
return true;
} else if (object.is_identical_to(info()->closure())) {
......
......@@ -799,7 +799,7 @@ struct InliningPhase {
JSContextSpecialization context_specialization(
&graph_reducer, data->jsgraph(),
data->info()->is_function_context_specializing()
? data->info()->context()
? handle(data->info()->context())
: MaybeHandle<Context>());
JSFrameSpecialization frame_specialization(data->info()->osr_frame(),
data->jsgraph());
......
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