OLD | NEW |
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 }; | 48 }; |
49 | 49 |
50 | 50 |
51 uint32_t AddJsFunction(TestingModule* module, FunctionSig* sig, | 51 uint32_t AddJsFunction(TestingModule* module, FunctionSig* sig, |
52 const char* source) { | 52 const char* source) { |
53 Handle<JSFunction> jsfunc = Handle<JSFunction>::cast(v8::Utils::OpenHandle( | 53 Handle<JSFunction> jsfunc = Handle<JSFunction>::cast(v8::Utils::OpenHandle( |
54 *v8::Local<v8::Function>::Cast(CompileRun(source)))); | 54 *v8::Local<v8::Function>::Cast(CompileRun(source)))); |
55 module->AddFunction(sig, Handle<Code>::null()); | 55 module->AddFunction(sig, Handle<Code>::null()); |
56 uint32_t index = static_cast<uint32_t>(module->module->functions->size() - 1); | 56 uint32_t index = static_cast<uint32_t>(module->module->functions->size() - 1); |
57 Isolate* isolate = CcTest::InitIsolateOnce(); | 57 Isolate* isolate = CcTest::InitIsolateOnce(); |
58 Handle<Code> code = CompileWasmToJSWrapper(isolate, module, jsfunc, index); | 58 Handle<Code> code = |
| 59 CompileWasmToJSWrapper(isolate, module, jsfunc, sig, "test"); |
59 module->instance->function_code->at(index) = code; | 60 module->instance->function_code->at(index) = code; |
60 return index; | 61 return index; |
61 } | 62 } |
62 | 63 |
63 | 64 |
64 uint32_t AddJSSelector(TestingModule* module, FunctionSig* sig, int which) { | 65 uint32_t AddJSSelector(TestingModule* module, FunctionSig* sig, int which) { |
65 const int kMaxParams = 8; | 66 const int kMaxParams = 8; |
66 static const char* formals[kMaxParams] = { | 67 static const char* formals[kMaxParams] = { |
67 "", "a", "a,b", "a,b,c", | 68 "", "a", "a,b", "a,b,c", |
68 "a,b,c,d", "a,b,c,d,e", "a,b,c,d,e,f", "a,b,c,d,e,f,g", | 69 "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 Loading... |
421 RunJSSelectAlignTest(1, 2); | 422 RunJSSelectAlignTest(1, 2); |
422 RunJSSelectAlignTest(1, 3); | 423 RunJSSelectAlignTest(1, 3); |
423 } | 424 } |
424 | 425 |
425 | 426 |
426 TEST(Run_JSSelectAlign_3) { | 427 TEST(Run_JSSelectAlign_3) { |
427 RunJSSelectAlignTest(3, 3); | 428 RunJSSelectAlignTest(3, 3); |
428 RunJSSelectAlignTest(3, 4); | 429 RunJSSelectAlignTest(3, 4); |
429 } | 430 } |
430 #endif | 431 #endif |
OLD | NEW |