Commit 974f4a80 authored by jpp's avatar jpp Committed by Commit bot

V8. ASM-2-WASM. Validator V2.

This is a rewrite of the ASM validator. This one follows the spec instead of using the AST visitors.

BUG= https://bugs.chromium.org/p/v8/issues/detail?id=4203
TEST=cctest/asmjs/test-asm-typer
TEST=cctest/asmjs/test-typing-asm
LOG=N

Review-Url: https://codereview.chromium.org/2071343003
Cr-Commit-Position: refs/heads/master@{#37694}
parent cd95c600
...@@ -788,6 +788,8 @@ v8_source_set("v8_base") { ...@@ -788,6 +788,8 @@ v8_source_set("v8_base") {
"src/arguments.h", "src/arguments.h",
"src/asmjs/asm-js.cc", "src/asmjs/asm-js.cc",
"src/asmjs/asm-js.h", "src/asmjs/asm-js.h",
"src/asmjs/asm-typer.cc",
"src/asmjs/asm-typer.h",
"src/asmjs/asm-types.cc", "src/asmjs/asm-types.cc",
"src/asmjs/asm-types.h", "src/asmjs/asm-types.h",
"src/asmjs/asm-wasm-builder.cc", "src/asmjs/asm-wasm-builder.cc",
......
# Keep in sync with test/cctest/asmjs/OWNERS.
set noparent set noparent
ahaas@chromium.org ahaas@chromium.org
......
This diff is collapsed.
This diff is collapsed.
...@@ -49,7 +49,9 @@ class AsmFunctionTableType; ...@@ -49,7 +49,9 @@ class AsmFunctionTableType;
V(Float32Array, "Float32Array", 20, kAsmHeap) \ V(Float32Array, "Float32Array", 20, kAsmHeap) \
V(Float64Array, "Float64Array", 21, kAsmHeap) \ V(Float64Array, "Float64Array", 21, kAsmHeap) \
/* Pseudo-types used in representing heap access for fp types.*/ \ /* Pseudo-types used in representing heap access for fp types.*/ \
/* TODO(jpp): FloatishDoubleQ should be a base type.*/ \
V(FloatishDoubleQ, "floatish|double?", 22, kAsmFloatish | kAsmDoubleQ) \ V(FloatishDoubleQ, "floatish|double?", 22, kAsmFloatish | kAsmDoubleQ) \
/* TODO(jpp): FloatQDoubleQ should be a base type.*/ \
V(FloatQDoubleQ, "float?|double?", 23, kAsmFloatQ | kAsmDoubleQ) \ V(FloatQDoubleQ, "float?|double?", 23, kAsmFloatQ | kAsmDoubleQ) \
/* None is used to represent errors in the type checker. */ \ /* None is used to represent errors in the type checker. */ \
V(None, "<none>", 31, 0) V(None, "<none>", 31, 0)
...@@ -132,6 +134,9 @@ class AsmFunctionType : public AsmCallableType { ...@@ -132,6 +134,9 @@ class AsmFunctionType : public AsmCallableType {
virtual bool IsMinMaxType() const { return false; } virtual bool IsMinMaxType() const { return false; }
virtual bool IsFroundType() const { return false; } virtual bool IsFroundType() const { return false; }
AsmType* ValidateCall(AsmType* return_type,
const ZoneVector<AsmType*>& args) override;
protected: protected:
AsmFunctionType(Zone* zone, AsmType* return_type) AsmFunctionType(Zone* zone, AsmType* return_type)
: return_type_(return_type), args_(zone) {} : return_type_(return_type), args_(zone) {}
...@@ -140,8 +145,6 @@ class AsmFunctionType : public AsmCallableType { ...@@ -140,8 +145,6 @@ class AsmFunctionType : public AsmCallableType {
friend AsmType; friend AsmType;
std::string Name() override; std::string Name() override;
AsmType* ValidateCall(AsmType* return_type,
const ZoneVector<AsmType*>& args) override;
AsmType* return_type_; AsmType* return_type_;
ZoneVector<AsmType*> args_; ZoneVector<AsmType*> args_;
...@@ -197,6 +200,7 @@ class AsmFunctionTableType : public AsmCallableType { ...@@ -197,6 +200,7 @@ class AsmFunctionTableType : public AsmCallableType {
const ZoneVector<AsmType*>& args) override; const ZoneVector<AsmType*>& args) override;
size_t length() const { return length_; } size_t length() const { return length_; }
AsmType* signature() { return signature_; }
private: private:
friend class AsmType; friend class AsmType;
...@@ -341,4 +345,4 @@ class AsmType { ...@@ -341,4 +345,4 @@ class AsmType {
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
#endif // SRC_WASM_ASM_TYPES_H_ #endif // SRC_ASMJS_ASM_TYPES_H_
...@@ -420,6 +420,8 @@ ...@@ -420,6 +420,8 @@
'arguments.h', 'arguments.h',
'asmjs/asm-js.cc', 'asmjs/asm-js.cc',
'asmjs/asm-js.h', 'asmjs/asm-js.h',
'asmjs/asm-typer.cc',
'asmjs/asm-typer.h',
'asmjs/asm-types.cc', 'asmjs/asm-types.cc',
'asmjs/asm-types.h', 'asmjs/asm-types.h',
'asmjs/asm-wasm-builder.cc', 'asmjs/asm-wasm-builder.cc',
......
...@@ -18,5 +18,3 @@ per-file *-x87*=chunyang.dai@intel.com ...@@ -18,5 +18,3 @@ per-file *-x87*=chunyang.dai@intel.com
per-file *-x87*=weiliang.lin@intel.com per-file *-x87*=weiliang.lin@intel.com
per-file expression-type-collector*=aseemgarg@chromium.org per-file expression-type-collector*=aseemgarg@chromium.org
per-file expression-type-collector*=bradnelson@chromium.org per-file expression-type-collector*=bradnelson@chromium.org
per-file test-asm-validator.cc=aseemgarg@chromium.org
per-file test-asm-validator.cc=bradnelson@chromium.org
# Keep in sync with src/asmjs/OWNERS.
set noparent
ahaas@chromium.org
bradnelson@chromium.org
jpp@chromium.org
mtrofin@chromium.org
rossberg@chromium.org
titzer@chromium.org
This diff is collapsed.
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
'v8_code': 1, 'v8_code': 1,
'generated_file': '<(SHARED_INTERMEDIATE_DIR)/resources.cc', 'generated_file': '<(SHARED_INTERMEDIATE_DIR)/resources.cc',
'cctest_sources': [ ### gcmole(all) ### 'cctest_sources': [ ### gcmole(all) ###
'asmjs/test-asm-typer.cc',
'asmjs/test-typing-asm.cc',
'compiler/c-signature.h', 'compiler/c-signature.h',
'compiler/codegen-tester.cc', 'compiler/codegen-tester.cc',
'compiler/codegen-tester.h', 'compiler/codegen-tester.h',
...@@ -115,7 +117,6 @@ ...@@ -115,7 +117,6 @@
'test-array-list.cc', 'test-array-list.cc',
'test-ast.cc', 'test-ast.cc',
'test-ast-expression-visitor.cc', 'test-ast-expression-visitor.cc',
'test-asm-validator.cc',
'test-atomicops.cc', 'test-atomicops.cc',
'test-bignum.cc', 'test-bignum.cc',
'test-bignum-dtoa.cc', 'test-bignum-dtoa.cc',
......
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