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

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

Issue 2371833007: [wasm] Initial signal handler (Closed)
Patch Set: Addressing some of Jochen's feedback 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"
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 Handle<WasmInstanceObject> GetWasmInstanceOnStackTop(Isolate* isolate) { 25 Handle<WasmInstanceObject> GetWasmInstanceOnStackTop(Isolate* isolate) {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 HandleScope scope(isolate); 146 HandleScope scope(isolate);
146 DCHECK_EQ(1, args.length()); 147 DCHECK_EQ(1, args.length());
147 Object* exception = args[0]; 148 Object* exception = args[0];
148 // The unwinder will only deliver exceptions to wasm if the exception is a 149 // 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 150 // Number or a Smi (which we have just converted to a Number.) This logic
150 // lives in Isolate::is_catchable_by_wasm(Object*). 151 // lives in Isolate::is_catchable_by_wasm(Object*).
151 CHECK(exception->IsNumber()); 152 CHECK(exception->IsNumber());
152 return exception; 153 return exception;
153 } 154 }
154 155
156 RUNTIME_FUNCTION(Runtime_SetThreadInWasm) {
157 DCHECK(!trap_handler::IsThreadInWasm());
158 trap_handler::SetThreadInWasm();
159 return isolate->heap()->undefined_value();
160 }
161
162 RUNTIME_FUNCTION(Runtime_ClearThreadInWasm) {
163 DCHECK(trap_handler::IsThreadInWasm());
164 trap_handler::ClearThreadInWasm();
165 return isolate->heap()->undefined_value();
166 }
167
155 } // namespace internal 168 } // namespace internal
156 } // namespace v8 169 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698