Commit a38a573a authored by titzer's avatar titzer Committed by Commit bot

[turbofan] Gracefully handle missing info()->context() in...

[turbofan] Gracefully handle missing info()->context() in CodeGenerator::IsMaterializableFromFrame()

R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1292233004

Cr-Commit-Position: refs/heads/master@{#30176}
parent aa4ad8ca
......@@ -102,6 +102,11 @@ bool CompilationInfo::has_shared_info() const {
}
bool CompilationInfo::has_context() const {
return parse_info_ && !parse_info_->context().is_null();
}
CompilationInfo::CompilationInfo(ParseInfo* parse_info)
: CompilationInfo(parse_info, nullptr, BASE, parse_info->isolate(),
parse_info->zone()) {
......
......@@ -154,6 +154,7 @@ class CompilationInfo {
Handle<Context> context() const;
Handle<SharedFunctionInfo> shared_info() const;
bool has_shared_info() const;
bool has_context() const;
// -----------------------------------------------------------
Isolate* isolate() const {
......
......@@ -232,7 +232,8 @@ void CodeGenerator::RecordSafepoint(ReferenceMap* references,
bool CodeGenerator::IsMaterializableFromFrame(Handle<HeapObject> object,
int* offset_return) {
if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) {
if (object.is_identical_to(info()->context()) && !info()->is_osr()) {
if (info()->has_context() && object.is_identical_to(info()->context()) &&
!info()->is_osr()) {
*offset_return = StandardFrameConstants::kContextOffset;
return true;
} else if (object.is_identical_to(info()->closure())) {
......@@ -531,6 +532,7 @@ void CodeGenerator::BuildTranslationForFrameStateDescriptor(
Handle<SharedFunctionInfo> shared_info;
if (!descriptor->shared_info().ToHandle(&shared_info)) {
if (!info()->has_shared_info()) return; // Stub with no SharedFunctionInfo.
shared_info = info()->shared_info();
}
int shared_info_id = DefineDeoptimizationLiteral(shared_info);
......
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