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

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

Issue 2619803004: [wasm] Add support for compiling WASM_INTERPRETER_ENTRY stubs (Closed)
Patch Set: Change void* to uint8_t* Created 3 years, 11 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.h ('k') | src/wasm/wasm-debug.cc » ('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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 HandleScope scope(isolate); 145 HandleScope scope(isolate);
146 DCHECK_EQ(1, args.length()); 146 DCHECK_EQ(1, args.length());
147 Object* exception = args[0]; 147 Object* exception = args[0];
148 // The unwinder will only deliver exceptions to wasm if the exception is a 148 // The unwinder will only deliver exceptions to wasm if the exception is a
149 // Number or a Smi (which we have just converted to a Number.) This logic 149 // Number or a Smi (which we have just converted to a Number.) This logic
150 // lives in Isolate::is_catchable_by_wasm(Object*). 150 // lives in Isolate::is_catchable_by_wasm(Object*).
151 CHECK(exception->IsNumber()); 151 CHECK(exception->IsNumber());
152 return exception; 152 return exception;
153 } 153 }
154 154
155 RUNTIME_FUNCTION(Runtime_WasmRunInterpreter) {
156 DCHECK(args.length() == 3);
157 HandleScope scope(isolate);
158 CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 0);
159 CONVERT_NUMBER_CHECKED(int32_t, func_index, Int32, args[1]);
160 CONVERT_ARG_HANDLE_CHECKED(Object, arg_buffer_obj, 2);
161 CHECK(WasmInstanceObject::IsWasmInstanceObject(*instance_obj));
162
163 // The arg buffer is the raw pointer to the caller's stack. It looks like a
164 // Smi (lowest bit not set, as checked by IsSmi), but is no valid Smi. We just
165 // cast it back to the raw pointer.
166 CHECK(!arg_buffer_obj->IsHeapObject());
167 CHECK(arg_buffer_obj->IsSmi());
168 uint8_t* arg_buffer = reinterpret_cast<uint8_t*>(*arg_buffer_obj);
169
170 Handle<WasmInstanceObject> instance =
171 Handle<WasmInstanceObject>::cast(instance_obj);
172 Handle<WasmDebugInfo> debug_info =
173 WasmInstanceObject::GetOrCreateDebugInfo(instance);
174 WasmDebugInfo::RunInterpreter(debug_info, func_index, arg_buffer);
175 return isolate->heap()->undefined_value();
176 }
177
155 } // namespace internal 178 } // namespace internal
156 } // namespace v8 179 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/wasm/wasm-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698