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

Unified Diff: test/unittests/wasm/module-decoder-unittest.cc

Issue 1980483002: [wasm] Remove legacy encoding of local variables from asm->wasm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/unittests/wasm/ast-decoder-unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/wasm/module-decoder-unittest.cc
diff --git a/test/unittests/wasm/module-decoder-unittest.cc b/test/unittests/wasm/module-decoder-unittest.cc
index 2cb923ddf07451016c9bd2d4a0799d39fab444e9..7090c1fab9c54db9cdca9f540a483c2f5607409a 100644
--- a/test/unittests/wasm/module-decoder-unittest.cc
+++ b/test/unittests/wasm/module-decoder-unittest.cc
@@ -343,21 +343,16 @@ TEST_F(WasmModuleVerifyTest, FunctionWithoutSig) {
}
TEST_F(WasmModuleVerifyTest, OneEmptyVoidVoidFunction) {
- const int kCodeStartOffset = 49;
+ const int kCodeStartOffset = 41;
const int kCodeEndOffset = kCodeStartOffset + 1;
static const byte data[] = {
// signatures
SIGNATURES_SECTION_VOID_VOID,
// func#0 ------------------------------------------------------
- SECTION(OLD_FUNCTIONS, 18), 1,
- kDeclFunctionLocals | kDeclFunctionExport | kDeclFunctionName,
+ SECTION(OLD_FUNCTIONS, 10), 1, kDeclFunctionExport | kDeclFunctionName,
SIG_INDEX(0), // signature index
NAME_LENGTH(2), 'h', 'i', // name
- U16_LE(1466), // local int32 count
- U16_LE(1355), // local int64 count
- U16_LE(1244), // local float32 count
- U16_LE(1133), // local float64 count
1, 0, // size
kExprNop,
};
@@ -379,11 +374,6 @@ TEST_F(WasmModuleVerifyTest, OneEmptyVoidVoidFunction) {
EXPECT_EQ(kCodeStartOffset, function->code_start_offset);
EXPECT_EQ(kCodeEndOffset, function->code_end_offset);
- EXPECT_EQ(1466, function->local_i32_count);
- EXPECT_EQ(1355, function->local_i64_count);
- EXPECT_EQ(1244, function->local_f32_count);
- EXPECT_EQ(1133, function->local_f64_count);
-
EXPECT_TRUE(function->exported);
if (result.val) delete result.val;
@@ -415,47 +405,6 @@ TEST_F(WasmModuleVerifyTest, OneFunctionWithNopBody) {
EXPECT_EQ(kCodeStartOffset, function->code_start_offset);
EXPECT_EQ(kCodeEndOffset, function->code_end_offset);
- EXPECT_EQ(0, function->local_i32_count);
- EXPECT_EQ(0, function->local_i64_count);
- EXPECT_EQ(0, function->local_f32_count);
- EXPECT_EQ(0, function->local_f64_count);
-
- EXPECT_FALSE(function->exported);
-
- if (result.val) delete result.val;
-}
-
-TEST_F(WasmModuleVerifyTest, OneFunctionWithNopBody_WithLocals) {
- static const byte kCodeStartOffset = 46;
- static const byte kCodeEndOffset = kCodeStartOffset + 1;
-
- static const byte data[] = {
- SIGNATURES_SECTION_VOID_VOID, // --
- SECTION(OLD_FUNCTIONS, 15), 1,
- // func#0 ------------------------------------------------------
- kDeclFunctionLocals, 0, 0, // signature index
- 1, 2, // local int32 count
- 3, 4, // local int64 count
- 5, 6, // local float32 count
- 7, 8, // local float64 count
- 1, 0, // body size
- kExprNop // body
- };
-
- ModuleResult result = DecodeModule(data, data + arraysize(data));
- EXPECT_OK(result);
- EXPECT_EQ(1, result.val->functions.size());
- WasmFunction* function = &result.val->functions.back();
-
- EXPECT_EQ(0, function->name_length);
- EXPECT_EQ(kCodeStartOffset, function->code_start_offset);
- EXPECT_EQ(kCodeEndOffset, function->code_end_offset);
-
- EXPECT_EQ(513, function->local_i32_count);
- EXPECT_EQ(1027, function->local_i64_count);
- EXPECT_EQ(1541, function->local_f32_count);
- EXPECT_EQ(2055, function->local_f64_count);
-
EXPECT_FALSE(function->exported);
if (result.val) delete result.val;
@@ -463,7 +412,7 @@ TEST_F(WasmModuleVerifyTest, OneFunctionWithNopBody_WithLocals) {
TEST_F(WasmModuleVerifyTest, OneGlobalOneFunctionWithNopBodyOneDataSegment) {
static const byte kNameOffset = 49;
- static const byte kCodeStartOffset = 61;
+ static const byte kCodeStartOffset = 53;
static const byte kCodeEndOffset = kCodeStartOffset + 3;
static const byte kDataSegmentSourceOffset = kCodeEndOffset + 22;
@@ -476,18 +425,14 @@ TEST_F(WasmModuleVerifyTest, OneGlobalOneFunctionWithNopBodyOneDataSegment) {
// sig#0 -----------------------------------------------------
SIGNATURES_SECTION_VOID_VOID,
// func#0 ----------------------------------------------------
- SECTION(OLD_FUNCTIONS, 20), 1,
- kDeclFunctionLocals | kDeclFunctionName, // --
- SIG_INDEX(0), // signature index
- 2, 'h', 'i', // name
- 1, 2, // local int32 count
- 3, 4, // local int64 count
- 5, 6, // local float32 count
- 7, 8, // local float64 count
- 3, 0, // body size
- kExprNop, // func#0 body
- kExprNop, // func#0 body
- kExprNop, // func#0 body
+ SECTION(OLD_FUNCTIONS, 12), 1,
+ kDeclFunctionName, // --
+ SIG_INDEX(0), // signature index
+ 2, 'h', 'i', // name
+ 3, 0, // body size
+ kExprNop, // func#0 body
+ kExprNop, // func#0 body
+ kExprNop, // func#0 body
// memory section --------------------------------------------
SECTION(MEMORY, 3), 28, 28, 1,
// segment#0 -------------------------------------------------
« no previous file with comments | « test/unittests/wasm/ast-decoder-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698