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

Side by Side Diff: test/cctest/wasm/test-run-wasm-module.cc

Issue 1869183002: Debug error (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 | no next file » | 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 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <string.h> 6 #include <string.h>
7 7
8 #include "src/wasm/encoder.h" 8 #include "src/wasm/encoder.h"
9 #include "src/wasm/wasm-js.h" 9 #include "src/wasm/wasm-js.h"
10 #include "src/wasm/wasm-macro-gen.h" 10 #include "src/wasm/wasm-macro-gen.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 f = builder->FunctionAt(f2_index); 186 f = builder->FunctionAt(f2_index);
187 f->ReturnType(kAstI32); 187 f->ReturnType(kAstI32);
188 f->Exported(1); 188 f->Exported(1);
189 byte code2[] = {WASM_STORE_GLOBAL(global1, WASM_I32V_1(56)), 189 byte code2[] = {WASM_STORE_GLOBAL(global1, WASM_I32V_1(56)),
190 WASM_STORE_GLOBAL(global2, WASM_I32V_1(41)), 190 WASM_STORE_GLOBAL(global2, WASM_I32V_1(41)),
191 WASM_RETURN(WASM_CALL_FUNCTION0(f1_index))}; 191 WASM_RETURN(WASM_CALL_FUNCTION0(f1_index))};
192 f->EmitCode(code2, sizeof(code2)); 192 f->EmitCode(code2, sizeof(code2));
193 WasmModuleWriter* writer = builder->Build(&zone); 193 WasmModuleWriter* writer = builder->Build(&zone);
194 TestModule(writer->WriteTo(&zone), 97); 194 TestModule(writer->WriteTo(&zone), 97);
195 } 195 }
196
197 TEST(Run_WasmModule_SubDebug) {
198 v8::base::AccountingAllocator allocator;
199 Zone zone(&allocator);
200 WasmModuleBuilder* builder = new (&zone) WasmModuleBuilder(&zone);
201 uint16_t f_index = builder->AddFunction();
202 WasmFunctionBuilder* f = builder->FunctionAt(f_index);
203 f->ReturnType(kAstI32);
204 f->Exported(1);
205 uint16_t local = f->AddLocal(kAstI32);
206 byte code[] = {
207 WASM_SET_LOCAL(local, WASM_I32V(-1)),
208 WASM_RETURN(WASM_I32_SUB(WASM_GET_LOCAL(local), WASM_I32V(0)))};
209 uint32_t local_indices[] = {1, 11};
210 f->EmitCode(code, sizeof(code), local_indices, sizeof(local_indices) / 4);
211 WasmModuleWriter* writer = builder->Build(&zone);
212 TestModule(writer->WriteTo(&zone), -1);
213 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698