Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 return ThrowRuntimeError(isolate, message_id, 0, false); | 129 return ThrowRuntimeError(isolate, message_id, 0, false); |
| 130 } | 130 } |
| 131 | 131 |
| 132 RUNTIME_FUNCTION(Runtime_ThrowWasmError) { | 132 RUNTIME_FUNCTION(Runtime_ThrowWasmError) { |
| 133 DCHECK_EQ(2, args.length()); | 133 DCHECK_EQ(2, args.length()); |
| 134 CONVERT_SMI_ARG_CHECKED(message_id, 0); | 134 CONVERT_SMI_ARG_CHECKED(message_id, 0); |
| 135 CONVERT_SMI_ARG_CHECKED(byte_offset, 1); | 135 CONVERT_SMI_ARG_CHECKED(byte_offset, 1); |
| 136 return ThrowRuntimeError(isolate, message_id, byte_offset, true); | 136 return ThrowRuntimeError(isolate, message_id, byte_offset, true); |
| 137 } | 137 } |
| 138 | 138 |
| 139 RUNTIME_FUNCTION(Runtime_ThrowWasmStackOverflow) { | |
| 140 HandleScope scope(isolate); | |
| 141 DCHECK_NULL(isolate->context()); | |
| 142 isolate->set_context(GetWasmContextOnStackTop(isolate)); | |
| 143 SealHandleScope shs(isolate); | |
|
Michael Starzinger
2017/03/20 14:54:51
nit: The {Isolate::StackOverflow} method creates i
ahaas
2017/03/20 15:16:23
I removed the HandleScope and moved the SealHandle
| |
| 144 DCHECK_LE(0, args.length()); | |
|
Michael Starzinger
2017/03/20 14:54:51
nit: DCHECK_EQ? Also, please move the check up to
ahaas
2017/03/20 15:16:23
Done.
| |
| 145 return isolate->StackOverflow(); | |
| 146 } | |
| 147 | |
| 139 RUNTIME_FUNCTION(Runtime_WasmThrowTypeError) { | 148 RUNTIME_FUNCTION(Runtime_WasmThrowTypeError) { |
| 140 HandleScope scope(isolate); | 149 HandleScope scope(isolate); |
| 141 DCHECK_EQ(0, args.length()); | 150 DCHECK_EQ(0, args.length()); |
| 142 THROW_NEW_ERROR_RETURN_FAILURE( | 151 THROW_NEW_ERROR_RETURN_FAILURE( |
| 143 isolate, NewTypeError(MessageTemplate::kWasmTrapTypeError)); | 152 isolate, NewTypeError(MessageTemplate::kWasmTrapTypeError)); |
| 144 } | 153 } |
| 145 | 154 |
| 146 RUNTIME_FUNCTION(Runtime_WasmThrow) { | 155 RUNTIME_FUNCTION(Runtime_WasmThrow) { |
| 147 HandleScope scope(isolate); | 156 HandleScope scope(isolate); |
| 148 DCHECK_EQ(2, args.length()); | 157 DCHECK_EQ(2, args.length()); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 | 230 |
| 222 // Check if this is a real stack overflow. | 231 // Check if this is a real stack overflow. |
| 223 StackLimitCheck check(isolate); | 232 StackLimitCheck check(isolate); |
| 224 if (check.JsHasOverflowed()) return isolate->StackOverflow(); | 233 if (check.JsHasOverflowed()) return isolate->StackOverflow(); |
| 225 | 234 |
| 226 return isolate->stack_guard()->HandleInterrupts(); | 235 return isolate->stack_guard()->HandleInterrupts(); |
| 227 } | 236 } |
| 228 | 237 |
| 229 } // namespace internal | 238 } // namespace internal |
| 230 } // namespace v8 | 239 } // namespace v8 |
| OLD | NEW |