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

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

Issue 2619803004: [wasm] Add support for compiling WASM_INTERPRETER_ENTRY stubs (Closed)
Patch Set: Address comments 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
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);
titzer 2017/01/11 15:52:34 Hmmm, not sure converting the argument buffer to O
Clemens Hammacher 2017/01/11 16:56:10 But what do I do with the Smi? I would just reinte
161 CHECK(WasmInstanceObject::IsWasmInstanceObject(*instance_obj));
162
163 // The arg buffer is the raw pointer to the caller's stack.
164 CHECK(!arg_buffer_obj->IsHeapObject());
165 void* arg_buffer = *arg_buffer_obj;
166
167 Handle<WasmInstanceObject> instance =
168 Handle<WasmInstanceObject>::cast(instance_obj);
169 Handle<WasmDebugInfo> debug_info =
170 WasmInstanceObject::GetOrCreateDebugInfo(instance);
171 WasmDebugInfo::RunInterpreter(debug_info, func_index, arg_buffer);
172 return isolate->heap()->undefined_value();
173 }
174
155 } // namespace internal 175 } // namespace internal
156 } // namespace v8 176 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698