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

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

Issue 1781523002: [wasm] All strings are length-prefixed and inline (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: comment Created 4 years, 9 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 | « src/wasm/wasm-opcodes.h ('k') | test/cctest/wasm/wasm-run-utils.h » ('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 #include <stdint.h> 5 #include <stdint.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "src/wasm/wasm-macro-gen.h" 10 #include "src/wasm/wasm-macro-gen.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 }; 49 };
50 50
51 51
52 uint32_t AddJsFunction(TestingModule* module, FunctionSig* sig, 52 uint32_t AddJsFunction(TestingModule* module, FunctionSig* sig,
53 const char* source) { 53 const char* source) {
54 Handle<JSFunction> jsfunc = Handle<JSFunction>::cast(v8::Utils::OpenHandle( 54 Handle<JSFunction> jsfunc = Handle<JSFunction>::cast(v8::Utils::OpenHandle(
55 *v8::Local<v8::Function>::Cast(CompileRun(source)))); 55 *v8::Local<v8::Function>::Cast(CompileRun(source))));
56 module->AddFunction(sig, Handle<Code>::null()); 56 module->AddFunction(sig, Handle<Code>::null());
57 uint32_t index = static_cast<uint32_t>(module->module->functions.size() - 1); 57 uint32_t index = static_cast<uint32_t>(module->module->functions.size() - 1);
58 Isolate* isolate = CcTest::InitIsolateOnce(); 58 Isolate* isolate = CcTest::InitIsolateOnce();
59 Handle<Code> code = 59 WasmName module_name = {"test", 4};
60 CompileWasmToJSWrapper(isolate, module, jsfunc, sig, "test", nullptr); 60 WasmName function_name = {nullptr, 0};
61 Handle<Code> code = CompileWasmToJSWrapper(isolate, module, jsfunc, sig,
62 module_name, function_name);
61 module->instance->function_code[index] = code; 63 module->instance->function_code[index] = code;
62 return index; 64 return index;
63 } 65 }
64 66
65 67
66 uint32_t AddJSSelector(TestingModule* module, FunctionSig* sig, int which) { 68 uint32_t AddJSSelector(TestingModule* module, FunctionSig* sig, int which) {
67 const int kMaxParams = 8; 69 const int kMaxParams = 8;
68 static const char* formals[kMaxParams] = { 70 static const char* formals[kMaxParams] = {
69 "", "a", "a,b", "a,b,c", 71 "", "a", "a,b", "a,b,c",
70 "a,b,c,d", "a,b,c,d,e", "a,b,c,d,e,f", "a,b,c,d,e,f,g", 72 "a,b,c,d", "a,b,c,d,e", "a,b,c,d,e,f", "a,b,c,d,e,f,g",
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 RunJSSelectAlignTest(1, 2); 425 RunJSSelectAlignTest(1, 2);
424 RunJSSelectAlignTest(1, 3); 426 RunJSSelectAlignTest(1, 3);
425 } 427 }
426 428
427 429
428 TEST(Run_JSSelectAlign_3) { 430 TEST(Run_JSSelectAlign_3) {
429 RunJSSelectAlignTest(3, 3); 431 RunJSSelectAlignTest(3, 3);
430 RunJSSelectAlignTest(3, 4); 432 RunJSSelectAlignTest(3, 4);
431 } 433 }
432 #endif 434 #endif
OLDNEW
« no previous file with comments | « src/wasm/wasm-opcodes.h ('k') | test/cctest/wasm/wasm-run-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698