| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ast/prettyprinter.h" | 8 #include "src/ast/prettyprinter.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 | 92 |
| 93 RUNTIME_FUNCTION(Runtime_ThrowStackOverflow) { | 93 RUNTIME_FUNCTION(Runtime_ThrowStackOverflow) { |
| 94 SealHandleScope shs(isolate); | 94 SealHandleScope shs(isolate); |
| 95 DCHECK_LE(0, args.length()); | 95 DCHECK_LE(0, args.length()); |
| 96 return isolate->StackOverflow(); | 96 return isolate->StackOverflow(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 RUNTIME_FUNCTION(Runtime_ThrowWasmError) { | 99 RUNTIME_FUNCTION(Runtime_ThrowWasmError) { |
| 100 HandleScope scope(isolate); | 100 HandleScope scope(isolate); |
| 101 DCHECK_EQ(1, args.length()); | 101 DCHECK_EQ(2, args.length()); |
| 102 CONVERT_SMI_ARG_CHECKED(message_id, 0); | 102 CONVERT_SMI_ARG_CHECKED(message_id, 0); |
| 103 THROW_NEW_ERROR_RETURN_FAILURE( | 103 CONVERT_SMI_ARG_CHECKED(byte_offset, 1); |
| 104 isolate, NewError(static_cast<MessageTemplate::Template>(message_id))); | 104 USE(byte_offset); // TODO(clemensh): patch the stack trace with this offset |
| 105 Handle<Object> error = isolate->factory()->NewError( |
| 106 static_cast<MessageTemplate::Template>(message_id)); |
| 107 return isolate->Throw(*error); |
| 105 } | 108 } |
| 106 | 109 |
| 107 RUNTIME_FUNCTION(Runtime_UnwindAndFindExceptionHandler) { | 110 RUNTIME_FUNCTION(Runtime_UnwindAndFindExceptionHandler) { |
| 108 SealHandleScope shs(isolate); | 111 SealHandleScope shs(isolate); |
| 109 DCHECK(args.length() == 0); | 112 DCHECK(args.length() == 0); |
| 110 return isolate->UnwindAndFindHandler(); | 113 return isolate->UnwindAndFindHandler(); |
| 111 } | 114 } |
| 112 | 115 |
| 113 | 116 |
| 114 RUNTIME_FUNCTION(Runtime_PromoteScheduledException) { | 117 RUNTIME_FUNCTION(Runtime_PromoteScheduledException) { |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 } | 515 } |
| 513 | 516 |
| 514 RUNTIME_FUNCTION(Runtime_RunMicrotasks) { | 517 RUNTIME_FUNCTION(Runtime_RunMicrotasks) { |
| 515 HandleScope scope(isolate); | 518 HandleScope scope(isolate); |
| 516 DCHECK(args.length() == 0); | 519 DCHECK(args.length() == 0); |
| 517 isolate->RunMicrotasks(); | 520 isolate->RunMicrotasks(); |
| 518 return isolate->heap()->undefined_value(); | 521 return isolate->heap()->undefined_value(); |
| 519 } | 522 } |
| 520 } // namespace internal | 523 } // namespace internal |
| 521 } // namespace v8 | 524 } // namespace v8 |
| OLD | NEW |