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

Side by Side Diff: src/compiler/value-numbering-reducer.cc

Issue 912393002: Mark some common operator with Property::kNoThrow. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix GVN failures. Created 5 years, 10 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/pipeline.cc ('k') | test/unittests/compiler/common-operator-unittest.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 2014 the V8 project authors. All rights reserved. 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 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/value-numbering-reducer.h" 5 #include "src/compiler/value-numbering-reducer.h"
6 6
7 #include <cstring> 7 #include <cstring>
8 8
9 #include "src/base/functional.h" 9 #include "src/base/functional.h"
10 #include "src/compiler/node.h" 10 #include "src/compiler/node.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 44
45 ValueNumberingReducer::ValueNumberingReducer(Zone* zone) 45 ValueNumberingReducer::ValueNumberingReducer(Zone* zone)
46 : entries_(nullptr), capacity_(0), size_(0), zone_(zone) {} 46 : entries_(nullptr), capacity_(0), size_(0), zone_(zone) {}
47 47
48 48
49 ValueNumberingReducer::~ValueNumberingReducer() {} 49 ValueNumberingReducer::~ValueNumberingReducer() {}
50 50
51 51
52 Reduction ValueNumberingReducer::Reduce(Node* node) { 52 Reduction ValueNumberingReducer::Reduce(Node* node) {
53 if (!node->op()->HasProperty(Operator::kEliminatable)) return NoChange(); 53 if (!node->op()->HasProperty(Operator::kIdempotent)) return NoChange();
54 54
55 const size_t hash = HashCode(node); 55 const size_t hash = HashCode(node);
56 if (!entries_) { 56 if (!entries_) {
57 DCHECK(size_ == 0); 57 DCHECK(size_ == 0);
58 DCHECK(capacity_ == 0); 58 DCHECK(capacity_ == 0);
59 // Allocate the initial entries and insert the first entry. 59 // Allocate the initial entries and insert the first entry.
60 capacity_ = kInitialCapacity; 60 capacity_ = kInitialCapacity;
61 entries_ = zone()->NewArray<Node*>(kInitialCapacity); 61 entries_ = zone()->NewArray<Node*>(kInitialCapacity);
62 memset(entries_, 0, sizeof(*entries_) * kInitialCapacity); 62 memset(entries_, 0, sizeof(*entries_) * kInitialCapacity);
63 entries_[hash & (kInitialCapacity - 1)] = node; 63 entries_[hash & (kInitialCapacity - 1)] = node;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 size_++; 155 size_++;
156 break; 156 break;
157 } 157 }
158 } 158 }
159 } 159 }
160 } 160 }
161 161
162 } // namespace compiler 162 } // namespace compiler
163 } // namespace internal 163 } // namespace internal
164 } // namespace v8 164 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/pipeline.cc ('k') | test/unittests/compiler/common-operator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698