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

Side by Side Diff: src/compiler/source-position.cc

Issue 426233002: Land the Fan (disabled) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback, rebase and "git cl format" Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/compiler/source-position.h ('k') | src/compiler/structured-machine-assembler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "src/compiler/source-position.h"
6 #include "src/compiler/graph.h"
7 #include "src/compiler/node-aux-data-inl.h"
8
9 namespace v8 {
10 namespace internal {
11 namespace compiler {
12
13 class SourcePositionTable::Decorator : public GraphDecorator {
14 public:
15 explicit Decorator(SourcePositionTable* source_positions)
16 : source_positions_(source_positions) {}
17
18 virtual void Decorate(Node* node) {
19 ASSERT(!source_positions_->current_position_.IsInvalid());
20 source_positions_->table_.Set(node, source_positions_->current_position_);
21 }
22
23 private:
24 SourcePositionTable* source_positions_;
25 };
26
27
28 SourcePositionTable::SourcePositionTable(Graph* graph)
29 : graph_(graph),
30 decorator_(NULL),
31 current_position_(SourcePosition::Invalid()),
32 table_(graph) {}
33
34
35 void SourcePositionTable::AddDecorator() {
36 ASSERT(decorator_ == NULL);
37 decorator_ = new (graph_->zone()) Decorator(this);
38 graph_->AddDecorator(decorator_);
39 }
40
41
42 void SourcePositionTable::RemoveDecorator() {
43 ASSERT(decorator_ != NULL);
44 graph_->RemoveDecorator(decorator_);
45 decorator_ = NULL;
46 }
47
48
49 SourcePosition SourcePositionTable::GetSourcePosition(Node* node) {
50 return table_.Get(node);
51 }
52
53 } // namespace compiler
54 } // namespace internal
55 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/source-position.h ('k') | src/compiler/structured-machine-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698