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

Side by Side Diff: src/compiler/wasm-compiler.h

Issue 1901063002: [wasm] Copy the tagged-to-int32/float64 and int32/float64-to-tagged code to the wasm compiler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | src/compiler/wasm-compiler.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 #ifndef V8_COMPILER_WASM_COMPILER_H_ 5 #ifndef V8_COMPILER_WASM_COMPILER_H_
6 #define V8_COMPILER_WASM_COMPILER_H_ 6 #define V8_COMPILER_WASM_COMPILER_H_
7 7
8 // Clients of this interface shouldn't depend on lots of compiler internals. 8 // Clients of this interface shouldn't depend on lots of compiler internals.
9 // Do not include anything from src/compiler here! 9 // Do not include anything from src/compiler here!
10 #include "src/wasm/wasm-opcodes.h" 10 #include "src/wasm/wasm-opcodes.h"
11 #include "src/zone.h" 11 #include "src/zone.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 namespace compiler { 16 namespace compiler {
17 // Forward declarations for some compiler data structures. 17 // Forward declarations for some compiler data structures.
18 class Node; 18 class Node;
19 class JSGraph; 19 class JSGraph;
20 class Graph; 20 class Graph;
21 class Operator;
21 } 22 }
22 23
23 namespace wasm { 24 namespace wasm {
24 // Forward declarations for some WASM data structures. 25 // Forward declarations for some WASM data structures.
25 struct ModuleEnv; 26 struct ModuleEnv;
26 struct WasmFunction; 27 struct WasmFunction;
27 class ErrorThrower; 28 class ErrorThrower;
28 29
29 // Expose {Node} and {Graph} opaquely as {wasm::TFNode} and {wasm::TFGraph}. 30 // Expose {Node} and {Graph} opaquely as {wasm::TFNode} and {wasm::TFGraph}.
30 typedef compiler::Node TFNode; 31 typedef compiler::Node TFNode;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 Node* ReturnVoid(); 102 Node* ReturnVoid();
102 Node* Unreachable(); 103 Node* Unreachable();
103 104
104 Node* CallDirect(uint32_t index, Node** args); 105 Node* CallDirect(uint32_t index, Node** args);
105 Node* CallImport(uint32_t index, Node** args); 106 Node* CallImport(uint32_t index, Node** args);
106 Node* CallIndirect(uint32_t index, Node** args); 107 Node* CallIndirect(uint32_t index, Node** args);
107 void BuildJSToWasmWrapper(Handle<Code> wasm_code, wasm::FunctionSig* sig); 108 void BuildJSToWasmWrapper(Handle<Code> wasm_code, wasm::FunctionSig* sig);
108 void BuildWasmToJSWrapper(Handle<JSFunction> function, 109 void BuildWasmToJSWrapper(Handle<JSFunction> function,
109 wasm::FunctionSig* sig); 110 wasm::FunctionSig* sig);
110 111
111 Node* BuildJavaScriptToNumber(Node* node, Node* context, Node* effect,
112 Node* control);
113 Node* ToJS(Node* node, Node* context, wasm::LocalType type); 112 Node* ToJS(Node* node, Node* context, wasm::LocalType type);
114 Node* FromJS(Node* node, Node* context, wasm::LocalType type); 113 Node* FromJS(Node* node, Node* context, wasm::LocalType type);
115 Node* Invert(Node* node); 114 Node* Invert(Node* node);
116 Node* FunctionTable(); 115 Node* FunctionTable();
117 116
118 //----------------------------------------------------------------------- 117 //-----------------------------------------------------------------------
119 // Operations that concern the linear memory. 118 // Operations that concern the linear memory.
120 //----------------------------------------------------------------------- 119 //-----------------------------------------------------------------------
121 Node* MemSize(uint32_t offset); 120 Node* MemSize(uint32_t offset);
122 Node* LoadGlobal(uint32_t index); 121 Node* LoadGlobal(uint32_t index);
(...skipping 28 matching lines...) Expand all
151 Node* mem_size_; 150 Node* mem_size_;
152 Node* function_table_; 151 Node* function_table_;
153 Node** control_; 152 Node** control_;
154 Node** effect_; 153 Node** effect_;
155 Node** cur_buffer_; 154 Node** cur_buffer_;
156 size_t cur_bufsize_; 155 size_t cur_bufsize_;
157 Node* def_buffer_[kDefaultBufferSize]; 156 Node* def_buffer_[kDefaultBufferSize];
158 157
159 WasmTrapHelper* trap_; 158 WasmTrapHelper* trap_;
160 wasm::FunctionSig* function_signature_; 159 wasm::FunctionSig* function_signature_;
160 SetOncePointer<const Operator> allocate_heap_number_operator_;
161 161
162 // Internal helper methods. 162 // Internal helper methods.
163 JSGraph* jsgraph() { return jsgraph_; } 163 JSGraph* jsgraph() { return jsgraph_; }
164 Graph* graph(); 164 Graph* graph();
165 165
166 Node* String(const char* string); 166 Node* String(const char* string);
167 Node* MemBuffer(uint32_t offset); 167 Node* MemBuffer(uint32_t offset);
168 void BoundsCheckMem(MachineType memtype, Node* index, uint32_t offset); 168 void BoundsCheckMem(MachineType memtype, Node* index, uint32_t offset);
169 169
170 Node* MaskShiftCount32(Node* node); 170 Node* MaskShiftCount32(Node* node);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 Node* BuildI32DivU(Node* left, Node* right); 237 Node* BuildI32DivU(Node* left, Node* right);
238 Node* BuildI32RemU(Node* left, Node* right); 238 Node* BuildI32RemU(Node* left, Node* right);
239 239
240 Node* BuildI64DivS(Node* left, Node* right); 240 Node* BuildI64DivS(Node* left, Node* right);
241 Node* BuildI64RemS(Node* left, Node* right); 241 Node* BuildI64RemS(Node* left, Node* right);
242 Node* BuildI64DivU(Node* left, Node* right); 242 Node* BuildI64DivU(Node* left, Node* right);
243 Node* BuildI64RemU(Node* left, Node* right); 243 Node* BuildI64RemU(Node* left, Node* right);
244 Node* BuildDiv64Call(Node* left, Node* right, ExternalReference ref, 244 Node* BuildDiv64Call(Node* left, Node* right, ExternalReference ref,
245 MachineType result_type, int trap_zero); 245 MachineType result_type, int trap_zero);
246 246
247 Node* BuildJavaScriptToNumber(Node* node, Node* context, Node* effect,
248 Node* control);
249 Node* BuildChangeInt32ToTagged(Node* value);
250 Node* BuildChangeFloat64ToTagged(Node* value);
251 Node* BuildChangeTaggedToFloat64(Node* value);
252
253 Node* BuildChangeInt32ToSmi(Node* value);
254 Node* BuildChangeSmiToInt32(Node* value);
255 Node* BuildChangeSmiToFloat64(Node* value);
256 Node* BuildTestNotSmi(Node* value);
257 Node* BuildSmiShiftBitsConstant();
258
259 Node* BuildAllocateHeapNumberWithValue(Node* value, Node* control);
260 Node* BuildLoadHeapNumberValue(Node* value, Node* control);
261 Node* BuildHeapNumberValueIndexConstant();
262
247 Node** Realloc(Node** buffer, size_t old_count, size_t new_count) { 263 Node** Realloc(Node** buffer, size_t old_count, size_t new_count) {
248 Node** buf = Buffer(new_count); 264 Node** buf = Buffer(new_count);
249 if (buf != buffer) memcpy(buf, buffer, old_count * sizeof(Node*)); 265 if (buf != buffer) memcpy(buf, buffer, old_count * sizeof(Node*));
250 return buf; 266 return buf;
251 } 267 }
252 }; 268 };
253 } // namespace compiler 269 } // namespace compiler
254 } // namespace internal 270 } // namespace internal
255 } // namespace v8 271 } // namespace v8
256 272
257 #endif // V8_COMPILER_WASM_COMPILER_H_ 273 #endif // V8_COMPILER_WASM_COMPILER_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/wasm-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698