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

Side by Side Diff: src/wasm/wasm-module.h

Issue 2263953002: [wasm] Use the right context in the wasm-to-js wrapper. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cleanup the test. Created 4 years, 4 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
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 #ifndef V8_WASM_MODULE_H_ 5 #ifndef V8_WASM_MODULE_H_
6 #define V8_WASM_MODULE_H_ 6 #define V8_WASM_MODULE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "src/api.h" 10 #include "src/api.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 } 227 }
228 228
229 // Checks the given offset range is contained within the module bytes. 229 // Checks the given offset range is contained within the module bytes.
230 bool BoundsCheck(uint32_t start, uint32_t end) const { 230 bool BoundsCheck(uint32_t start, uint32_t end) const {
231 size_t size = module_end - module_start; 231 size_t size = module_end - module_start;
232 return start <= size && end <= size; 232 return start <= size && end <= size;
233 } 233 }
234 234
235 // Creates a new instantiation of the module in the given isolate. 235 // Creates a new instantiation of the module in the given isolate.
236 static MaybeHandle<JSObject> Instantiate(Isolate* isolate, 236 static MaybeHandle<JSObject> Instantiate(Isolate* isolate,
237 Handle<Context> context,
237 Handle<FixedArray> compiled_module, 238 Handle<FixedArray> compiled_module,
238 Handle<JSReceiver> ffi, 239 Handle<JSReceiver> ffi,
239 Handle<JSArrayBuffer> memory); 240 Handle<JSArrayBuffer> memory);
240 241
241 MaybeHandle<FixedArray> CompileFunctions(Isolate* isolate, 242 MaybeHandle<FixedArray> CompileFunctions(Isolate* isolate,
242 ErrorThrower* thrower) const; 243 ErrorThrower* thrower) const;
243 244
244 private: 245 private:
245 DISALLOW_COPY_AND_ASSIGN(WasmModule); 246 DISALLOW_COPY_AND_ASSIGN(WasmModule);
246 }; 247 };
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 411
411 int32_t CallFunction(Isolate* isolate, Handle<JSObject> instance, 412 int32_t CallFunction(Isolate* isolate, Handle<JSObject> instance,
412 ErrorThrower* thrower, const char* name, int argc, 413 ErrorThrower* thrower, const char* name, int argc,
413 Handle<Object> argv[]); 414 Handle<Object> argv[]);
414 } // namespace testing 415 } // namespace testing
415 } // namespace wasm 416 } // namespace wasm
416 } // namespace internal 417 } // namespace internal
417 } // namespace v8 418 } // namespace v8
418 419
419 #endif // V8_WASM_MODULE_H_ 420 #endif // V8_WASM_MODULE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698