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

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

Issue 2964943002: [wasm] Introduce instance types for WebAssembly.* objects. (Closed)
Patch Set: Address rossberg comments. Created 3 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 | « src/runtime/runtime-test.cc ('k') | src/value-serializer.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 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 174
175 RUNTIME_FUNCTION(Runtime_ClearThreadInWasm) { 175 RUNTIME_FUNCTION(Runtime_ClearThreadInWasm) {
176 trap_handler::ClearThreadInWasm(); 176 trap_handler::ClearThreadInWasm();
177 return isolate->heap()->undefined_value(); 177 return isolate->heap()->undefined_value();
178 } 178 }
179 179
180 RUNTIME_FUNCTION(Runtime_WasmRunInterpreter) { 180 RUNTIME_FUNCTION(Runtime_WasmRunInterpreter) {
181 DCHECK_EQ(3, args.length()); 181 DCHECK_EQ(3, args.length());
182 HandleScope scope(isolate); 182 HandleScope scope(isolate);
183 CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 0); 183 CONVERT_ARG_HANDLE_CHECKED(WasmInstanceObject, instance, 0);
184 CONVERT_NUMBER_CHECKED(int32_t, func_index, Int32, args[1]); 184 CONVERT_NUMBER_CHECKED(int32_t, func_index, Int32, args[1]);
185 CONVERT_ARG_HANDLE_CHECKED(Object, arg_buffer_obj, 2); 185 CONVERT_ARG_HANDLE_CHECKED(Object, arg_buffer_obj, 2);
186 CHECK(WasmInstanceObject::IsWasmInstanceObject(*instance_obj));
187 Handle<WasmInstanceObject> instance =
188 Handle<WasmInstanceObject>::cast(instance_obj);
189 186
190 // The arg buffer is the raw pointer to the caller's stack. It looks like a 187 // The arg buffer is the raw pointer to the caller's stack. It looks like a
191 // Smi (lowest bit not set, as checked by IsSmi), but is no valid Smi. We just 188 // Smi (lowest bit not set, as checked by IsSmi), but is no valid Smi. We just
192 // cast it back to the raw pointer. 189 // cast it back to the raw pointer.
193 CHECK(!arg_buffer_obj->IsHeapObject()); 190 CHECK(!arg_buffer_obj->IsHeapObject());
194 CHECK(arg_buffer_obj->IsSmi()); 191 CHECK(arg_buffer_obj->IsSmi());
195 uint8_t* arg_buffer = reinterpret_cast<uint8_t*>(*arg_buffer_obj); 192 uint8_t* arg_buffer = reinterpret_cast<uint8_t*>(*arg_buffer_obj);
196 193
197 // Set the current isolate's context. 194 // Set the current isolate's context.
198 DCHECK_NULL(isolate->context()); 195 DCHECK_NULL(isolate->context());
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 241
245 RUNTIME_FUNCTION(Runtime_WasmCompileLazy) { 242 RUNTIME_FUNCTION(Runtime_WasmCompileLazy) {
246 DCHECK(args.length() == 0); 243 DCHECK(args.length() == 0);
247 HandleScope scope(isolate); 244 HandleScope scope(isolate);
248 245
249 return *wasm::CompileLazy(isolate); 246 return *wasm::CompileLazy(isolate);
250 } 247 }
251 248
252 } // namespace internal 249 } // namespace internal
253 } // namespace v8 250 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-test.cc ('k') | src/value-serializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698