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

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

Issue 2035683002: [turbofan] Fix assert caused by bogus merging of out-of-scope CodeAssembler variables (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 6 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/code-assembler.h ('k') | test/cctest/test-code-stub-assembler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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-assembler.h" 5 #include "src/compiler/code-assembler.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/compiler/graph.h" 10 #include "src/compiler/graph.h"
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 // properly be verified. 593 // properly be verified.
594 class CodeAssembler::Variable::Impl : public ZoneObject { 594 class CodeAssembler::Variable::Impl : public ZoneObject {
595 public: 595 public:
596 explicit Impl(MachineRepresentation rep) : value_(nullptr), rep_(rep) {} 596 explicit Impl(MachineRepresentation rep) : value_(nullptr), rep_(rep) {}
597 Node* value_; 597 Node* value_;
598 MachineRepresentation rep_; 598 MachineRepresentation rep_;
599 }; 599 };
600 600
601 CodeAssembler::Variable::Variable(CodeAssembler* assembler, 601 CodeAssembler::Variable::Variable(CodeAssembler* assembler,
602 MachineRepresentation rep) 602 MachineRepresentation rep)
603 : impl_(new (assembler->zone()) Impl(rep)) { 603 : impl_(new (assembler->zone()) Impl(rep)), assembler_(assembler) {
604 assembler->variables_.push_back(impl_); 604 assembler->variables_.insert(impl_);
605 } 605 }
606 606
607 CodeAssembler::Variable::~Variable() { assembler_->variables_.erase(impl_); }
608
607 void CodeAssembler::Variable::Bind(Node* value) { impl_->value_ = value; } 609 void CodeAssembler::Variable::Bind(Node* value) { impl_->value_ = value; }
608 610
609 Node* CodeAssembler::Variable::value() const { 611 Node* CodeAssembler::Variable::value() const {
610 DCHECK_NOT_NULL(impl_->value_); 612 DCHECK_NOT_NULL(impl_->value_);
611 return impl_->value_; 613 return impl_->value_;
612 } 614 }
613 615
614 MachineRepresentation CodeAssembler::Variable::rep() const { 616 MachineRepresentation CodeAssembler::Variable::rep() const {
615 return impl_->rep_; 617 return impl_->rep_;
616 } 618 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 } 732 }
731 } 733 }
732 } 734 }
733 735
734 bound_ = true; 736 bound_ = true;
735 } 737 }
736 738
737 } // namespace compiler 739 } // namespace compiler
738 } // namespace internal 740 } // namespace internal
739 } // namespace v8 741 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/code-assembler.h ('k') | test/cctest/test-code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698