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

Side by Side Diff: src/compiler/js-graph.cc

Issue 1759383003: [compiler] Add relocatable pointer constants for wasm memory references. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix mips/mips64 compile Created 4 years, 9 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
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/code-stubs.h" 5 #include "src/code-stubs.h"
6 #include "src/compiler/js-graph.h" 6 #include "src/compiler/js-graph.h"
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 #include "src/compiler/typer.h" 8 #include "src/compiler/typer.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 129
130 Node* JSGraph::Int64Constant(int64_t value) { 130 Node* JSGraph::Int64Constant(int64_t value) {
131 Node** loc = cache_.FindInt64Constant(value); 131 Node** loc = cache_.FindInt64Constant(value);
132 if (*loc == nullptr) { 132 if (*loc == nullptr) {
133 *loc = graph()->NewNode(common()->Int64Constant(value)); 133 *loc = graph()->NewNode(common()->Int64Constant(value));
134 } 134 }
135 return *loc; 135 return *loc;
136 } 136 }
137 137
138 Node* JSGraph::RelocatableInt32Constant(int32_t value, RelocInfo::Mode rmode) {
139 Node** loc = cache_.FindRelocatableInt32Constant(value);
140 if (*loc == nullptr) {
141 *loc = graph()->NewNode(common()->RelocatableInt32Constant(value, rmode));
142 }
143 return *loc;
144 }
145
146 Node* JSGraph::RelocatableInt64Constant(int64_t value, RelocInfo::Mode rmode) {
147 Node** loc = cache_.FindRelocatableInt64Constant(value);
148 if (*loc == nullptr) {
149 *loc = graph()->NewNode(common()->RelocatableInt64Constant(value, rmode));
150 }
151 return *loc;
152 }
153
154 Node* JSGraph::RelocatableIntPtrConstant(intptr_t value,
155 RelocInfo::Mode rmode) {
156 return kPointerSize == 8
157 ? RelocatableInt64Constant(value, rmode)
158 : RelocatableInt32Constant(static_cast<int>(value), rmode);
159 }
138 160
139 Node* JSGraph::NumberConstant(double value) { 161 Node* JSGraph::NumberConstant(double value) {
140 Node** loc = cache_.FindNumberConstant(value); 162 Node** loc = cache_.FindNumberConstant(value);
141 if (*loc == nullptr) { 163 if (*loc == nullptr) {
142 *loc = graph()->NewNode(common()->NumberConstant(value)); 164 *loc = graph()->NewNode(common()->NumberConstant(value));
143 } 165 }
144 return *loc; 166 return *loc;
145 } 167 }
146 168
147 169
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 for (size_t i = 0; i < arraysize(cached_nodes_); i++) { 224 for (size_t i = 0; i < arraysize(cached_nodes_); i++) {
203 if (Node* node = cached_nodes_[i]) { 225 if (Node* node = cached_nodes_[i]) {
204 if (!node->IsDead()) nodes->push_back(node); 226 if (!node->IsDead()) nodes->push_back(node);
205 } 227 }
206 } 228 }
207 } 229 }
208 230
209 } // namespace compiler 231 } // namespace compiler
210 } // namespace internal 232 } // namespace internal
211 } // namespace v8 233 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698