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

Side by Side Diff: src/runtime/runtime-wasm.cc

Issue 2168183002: [wasm] Adding a convolution matrix filter test to highlight the performance advantages of JITing (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Removed unnecessary changes Created 4 years, 5 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 | src/wasm/ast-decoder.cc » ('j') | src/wasm/ast-decoder.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 "src/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/assembler.h" 8 #include "src/assembler.h"
9 #include "src/compiler/wasm-compiler.h" 9 #include "src/compiler/wasm-compiler.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 // Get mem buffer associated with module object 145 // Get mem buffer associated with module object
146 Handle<Object> obj(module_object->GetInternalField(kWasmMemArrayBuffer), 146 Handle<Object> obj(module_object->GetInternalField(kWasmMemArrayBuffer),
147 isolate); 147 isolate);
148 148
149 if (obj->IsUndefined(isolate)) { 149 if (obj->IsUndefined(isolate)) {
150 return isolate->heap()->undefined_value(); 150 return isolate->heap()->undefined_value();
151 } 151 }
152 152
153 Handle<JSArrayBuffer> mem_buffer = Handle<JSArrayBuffer>::cast(obj); 153 Handle<JSArrayBuffer> mem_buffer = Handle<JSArrayBuffer>::cast(obj);
154 154
155 wasm::ErrorThrower thrower(isolate, "JITSingleFunction");
155 wasm::WasmModule module(reinterpret_cast<byte*>(mem_buffer->backing_store())); 156 wasm::WasmModule module(reinterpret_cast<byte*>(mem_buffer->backing_store()));
156 wasm::ErrorThrower thrower(isolate, "JITSingleFunction"); 157 wasm::WasmModuleInstance instance(&module);
158 instance.context = isolate->native_context();
159 instance.mem_size =
160 static_cast<uint32_t>(mem_buffer->byte_length()->Number());
161 instance.mem_start = reinterpret_cast<byte*>(mem_buffer->backing_store());
162 instance.globals_start = nullptr;
163
157 wasm::ModuleEnv module_env; 164 wasm::ModuleEnv module_env;
158 module_env.module = &module; 165 module_env.module = &module;
159 module_env.instance = nullptr; 166 module_env.instance = &instance;
160 module_env.origin = wasm::kWasmOrigin; 167 module_env.origin = wasm::kWasmOrigin;
161 168
162 uint32_t signature_size = args.length() - fixed_args; 169 uint32_t signature_size = args.length() - fixed_args;
163 wasm::LocalType* sig_types = new wasm::LocalType[signature_size]; 170 wasm::LocalType* sig_types = new wasm::LocalType[signature_size];
164 171
165 for (uint32_t i = 0; i < signature_size; ++i) { 172 for (uint32_t i = 0; i < signature_size; ++i) {
166 CONVERT_SMI_ARG_CHECKED(sig_type, i + fixed_args); 173 CONVERT_SMI_ARG_CHECKED(sig_type, i + fixed_args);
167 sig_types[i] = static_cast<wasm::LocalType>(sig_type); 174 sig_types[i] = static_cast<wasm::LocalType>(sig_type);
168 } 175 }
169 wasm::FunctionSig sig(return_count, signature_size - return_count, sig_types); 176 wasm::FunctionSig sig(return_count, signature_size - return_count, sig_types);
(...skipping 15 matching lines...) Expand all
185 return isolate->heap()->undefined_value(); 192 return isolate->heap()->undefined_value();
186 } 193 }
187 194
188 function_table->set(index, Smi::FromInt(sig_index)); 195 function_table->set(index, Smi::FromInt(sig_index));
189 function_table->set(index + function_table->length() / 2, *code); 196 function_table->set(index + function_table->length() / 2, *code);
190 197
191 return isolate->heap()->undefined_value(); 198 return isolate->heap()->undefined_value();
192 } 199 }
193 } // namespace internal 200 } // namespace internal
194 } // namespace v8 201 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/wasm/ast-decoder.cc » ('j') | src/wasm/ast-decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698