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

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

Issue 2371833007: [wasm] Initial signal handler (Closed)
Patch Set: Make sure guard pages get set up when resizing from 0 to more than 0 Created 3 years, 9 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/trap-handler/DEPS » ('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"
11 #include "src/debug/debug.h" 11 #include "src/debug/debug.h"
12 #include "src/factory.h" 12 #include "src/factory.h"
13 #include "src/frames-inl.h" 13 #include "src/frames-inl.h"
14 #include "src/objects-inl.h" 14 #include "src/objects-inl.h"
15 #include "src/trap-handler/trap-handler.h"
15 #include "src/v8memory.h" 16 #include "src/v8memory.h"
16 #include "src/wasm/wasm-module.h" 17 #include "src/wasm/wasm-module.h"
17 #include "src/wasm/wasm-objects.h" 18 #include "src/wasm/wasm-objects.h"
18 #include "src/wasm/wasm-opcodes.h" 19 #include "src/wasm/wasm-opcodes.h"
19 20
20 namespace v8 { 21 namespace v8 {
21 namespace internal { 22 namespace internal {
22 23
23 namespace { 24 namespace {
24 WasmInstanceObject* GetWasmInstanceOnStackTop(Isolate* isolate) { 25 WasmInstanceObject* GetWasmInstanceOnStackTop(Isolate* isolate) {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 HandleScope scope(isolate); 162 HandleScope scope(isolate);
162 DCHECK_EQ(1, args.length()); 163 DCHECK_EQ(1, args.length());
163 Object* exception = args[0]; 164 Object* exception = args[0];
164 // The unwinder will only deliver exceptions to wasm if the exception is a 165 // The unwinder will only deliver exceptions to wasm if the exception is a
165 // Number or a Smi (which we have just converted to a Number.) This logic 166 // Number or a Smi (which we have just converted to a Number.) This logic
166 // lives in Isolate::is_catchable_by_wasm(Object*). 167 // lives in Isolate::is_catchable_by_wasm(Object*).
167 CHECK(exception->IsNumber()); 168 CHECK(exception->IsNumber());
168 return exception; 169 return exception;
169 } 170 }
170 171
172 RUNTIME_FUNCTION(Runtime_SetThreadInWasm) {
173 trap_handler::SetThreadInWasm();
174 return isolate->heap()->undefined_value();
175 }
176
177 RUNTIME_FUNCTION(Runtime_ClearThreadInWasm) {
178 trap_handler::ClearThreadInWasm();
179 return isolate->heap()->undefined_value();
180 }
181
171 RUNTIME_FUNCTION(Runtime_WasmRunInterpreter) { 182 RUNTIME_FUNCTION(Runtime_WasmRunInterpreter) {
172 DCHECK_EQ(3, args.length()); 183 DCHECK_EQ(3, args.length());
173 HandleScope scope(isolate); 184 HandleScope scope(isolate);
174 CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 0); 185 CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 0);
175 CONVERT_NUMBER_CHECKED(int32_t, func_index, Int32, args[1]); 186 CONVERT_NUMBER_CHECKED(int32_t, func_index, Int32, args[1]);
176 CONVERT_ARG_HANDLE_CHECKED(Object, arg_buffer_obj, 2); 187 CONVERT_ARG_HANDLE_CHECKED(Object, arg_buffer_obj, 2);
177 CHECK(WasmInstanceObject::IsWasmInstanceObject(*instance_obj)); 188 CHECK(WasmInstanceObject::IsWasmInstanceObject(*instance_obj));
178 Handle<WasmInstanceObject> instance = 189 Handle<WasmInstanceObject> instance =
179 Handle<WasmInstanceObject>::cast(instance_obj); 190 Handle<WasmInstanceObject>::cast(instance_obj);
180 191
(...skipping 22 matching lines...) Expand all
203 214
204 // Check if this is a real stack overflow. 215 // Check if this is a real stack overflow.
205 StackLimitCheck check(isolate); 216 StackLimitCheck check(isolate);
206 if (check.JsHasOverflowed()) return isolate->StackOverflow(); 217 if (check.JsHasOverflowed()) return isolate->StackOverflow();
207 218
208 return isolate->stack_guard()->HandleInterrupts(); 219 return isolate->stack_guard()->HandleInterrupts();
209 } 220 }
210 221
211 } // namespace internal 222 } // namespace internal
212 } // namespace v8 223 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/trap-handler/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698