Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: src/compiler/code-generator.cc

Issue 1292233004: [turbofan] Gracefully handle missing info()->context() in CodeGenerator::IsMaterializableFromFrame() (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/compiler/code-generator-impl.h" 7 #include "src/compiler/code-generator-impl.h"
8 #include "src/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
9 #include "src/compiler/pipeline.h" 9 #include "src/compiler/pipeline.h"
10 #include "src/frames-inl.h" 10 #include "src/frames-inl.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 Register::FromAllocationIndex(RegisterOperand::cast(operand).index()); 225 Register::FromAllocationIndex(RegisterOperand::cast(operand).index());
226 safepoint.DefinePointerRegister(reg, zone()); 226 safepoint.DefinePointerRegister(reg, zone());
227 } 227 }
228 } 228 }
229 } 229 }
230 230
231 231
232 bool CodeGenerator::IsMaterializableFromFrame(Handle<HeapObject> object, 232 bool CodeGenerator::IsMaterializableFromFrame(Handle<HeapObject> object,
233 int* offset_return) { 233 int* offset_return) {
234 if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) { 234 if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) {
235 if (object.is_identical_to(info()->context()) && !info()->is_osr()) { 235 if (info()->has_context() && object.is_identical_to(info()->context()) &&
236 !info()->is_osr()) {
236 *offset_return = StandardFrameConstants::kContextOffset; 237 *offset_return = StandardFrameConstants::kContextOffset;
237 return true; 238 return true;
238 } else if (object.is_identical_to(info()->closure())) { 239 } else if (object.is_identical_to(info()->closure())) {
239 *offset_return = JavaScriptFrameConstants::kFunctionOffset; 240 *offset_return = JavaScriptFrameConstants::kFunctionOffset;
240 return true; 241 return true;
241 } 242 }
242 } 243 }
243 return false; 244 return false;
244 } 245 }
245 246
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 // Outer-most state must be added to translation first. 525 // Outer-most state must be added to translation first.
525 if (descriptor->outer_state() != nullptr) { 526 if (descriptor->outer_state() != nullptr) {
526 BuildTranslationForFrameStateDescriptor(descriptor->outer_state(), instr, 527 BuildTranslationForFrameStateDescriptor(descriptor->outer_state(), instr,
527 translation, frame_state_offset, 528 translation, frame_state_offset,
528 OutputFrameStateCombine::Ignore()); 529 OutputFrameStateCombine::Ignore());
529 } 530 }
530 frame_state_offset += descriptor->outer_state()->GetTotalSize(); 531 frame_state_offset += descriptor->outer_state()->GetTotalSize();
531 532
532 Handle<SharedFunctionInfo> shared_info; 533 Handle<SharedFunctionInfo> shared_info;
533 if (!descriptor->shared_info().ToHandle(&shared_info)) { 534 if (!descriptor->shared_info().ToHandle(&shared_info)) {
535 if (!info()->parse_info()) return; // TODO(titzer): that was unfortunate.
Michael Starzinger 2015/08/14 11:52:38 nit: Can we use has_shared_info() here instead? We
534 shared_info = info()->shared_info(); 536 shared_info = info()->shared_info();
535 } 537 }
536 int shared_info_id = DefineDeoptimizationLiteral(shared_info); 538 int shared_info_id = DefineDeoptimizationLiteral(shared_info);
537 539
538 switch (descriptor->type()) { 540 switch (descriptor->type()) {
539 case FrameStateType::kJavaScriptFunction: 541 case FrameStateType::kJavaScriptFunction:
540 translation->BeginJSFrame( 542 translation->BeginJSFrame(
541 descriptor->bailout_id(), shared_info_id, 543 descriptor->bailout_id(), shared_info_id,
542 static_cast<unsigned int>(descriptor->GetSize(state_combine) - 544 static_cast<unsigned int>(descriptor->GetSize(state_combine) -
543 (1 + descriptor->parameters_count()))); 545 (1 + descriptor->parameters_count())));
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 : masm_(gen->masm()), next_(gen->ools_) { 662 : masm_(gen->masm()), next_(gen->ools_) {
661 gen->ools_ = this; 663 gen->ools_ = this;
662 } 664 }
663 665
664 666
665 OutOfLineCode::~OutOfLineCode() {} 667 OutOfLineCode::~OutOfLineCode() {}
666 668
667 } // namespace compiler 669 } // namespace compiler
668 } // namespace internal 670 } // namespace internal
669 } // namespace v8 671 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698