Commit 0c6ec35b authored by ahaas's avatar ahaas Committed by Commit bot

[wasm] Copy the tagged-to-int32/float64 and int32/float64-to-tagged code to the wasm compiler.

Thereby we can get rid of the use of Typer and ChangeLowering in the
wasm compiler.

BUG=v8:4914
R=titzer@chromium.org, bmeurer@chromium.org
LOG=N

Review URL: https://codereview.chromium.org/1901063002

Cr-Commit-Position: refs/heads/master@{#35655}
parent 194a04d7
This diff is collapsed.
......@@ -18,6 +18,7 @@ namespace compiler {
class Node;
class JSGraph;
class Graph;
class Operator;
}
namespace wasm {
......@@ -108,8 +109,6 @@ class WasmGraphBuilder {
void BuildWasmToJSWrapper(Handle<JSFunction> function,
wasm::FunctionSig* sig);
Node* BuildJavaScriptToNumber(Node* node, Node* context, Node* effect,
Node* control);
Node* ToJS(Node* node, Node* context, wasm::LocalType type);
Node* FromJS(Node* node, Node* context, wasm::LocalType type);
Node* Invert(Node* node);
......@@ -158,6 +157,7 @@ class WasmGraphBuilder {
WasmTrapHelper* trap_;
wasm::FunctionSig* function_signature_;
SetOncePointer<const Operator> allocate_heap_number_operator_;
// Internal helper methods.
JSGraph* jsgraph() { return jsgraph_; }
......@@ -244,6 +244,22 @@ class WasmGraphBuilder {
Node* BuildDiv64Call(Node* left, Node* right, ExternalReference ref,
MachineType result_type, int trap_zero);
Node* BuildJavaScriptToNumber(Node* node, Node* context, Node* effect,
Node* control);
Node* BuildChangeInt32ToTagged(Node* value);
Node* BuildChangeFloat64ToTagged(Node* value);
Node* BuildChangeTaggedToFloat64(Node* value);
Node* BuildChangeInt32ToSmi(Node* value);
Node* BuildChangeSmiToInt32(Node* value);
Node* BuildChangeSmiToFloat64(Node* value);
Node* BuildTestNotSmi(Node* value);
Node* BuildSmiShiftBitsConstant();
Node* BuildAllocateHeapNumberWithValue(Node* value, Node* control);
Node* BuildLoadHeapNumberValue(Node* value, Node* control);
Node* BuildHeapNumberValueIndexConstant();
Node** Realloc(Node** buffer, size_t old_count, size_t new_count) {
Node** buf = Buffer(new_count);
if (buf != buffer) memcpy(buf, buffer, old_count * sizeof(Node*));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment