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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 THROW_NEW_ERROR_RETURN_FAILURE(isolate, | 116 THROW_NEW_ERROR_RETURN_FAILURE(isolate, |
117 NewTypeError(message_id, arg0, arg1, arg2)); | 117 NewTypeError(message_id, arg0, arg1, arg2)); |
118 } | 118 } |
119 | 119 |
120 RUNTIME_FUNCTION(Runtime_ThrowWasmError) { | 120 RUNTIME_FUNCTION(Runtime_ThrowWasmError) { |
121 HandleScope scope(isolate); | 121 HandleScope scope(isolate); |
122 DCHECK_EQ(2, args.length()); | 122 DCHECK_EQ(2, args.length()); |
123 CONVERT_SMI_ARG_CHECKED(message_id, 0); | 123 CONVERT_SMI_ARG_CHECKED(message_id, 0); |
124 CONVERT_SMI_ARG_CHECKED(byte_offset, 1); | 124 CONVERT_SMI_ARG_CHECKED(byte_offset, 1); |
125 Handle<Object> error_obj = isolate->factory()->NewError( | 125 Handle<Object> error_obj = isolate->factory()->NewWasmRuntimeError( |
126 static_cast<MessageTemplate::Template>(message_id)); | 126 static_cast<MessageTemplate::Template>(message_id)); |
127 | 127 |
128 // For wasm traps, the byte offset (a.k.a source position) can not be | 128 // For wasm traps, the byte offset (a.k.a source position) can not be |
129 // determined from relocation info, since the explicit checks for traps | 129 // determined from relocation info, since the explicit checks for traps |
130 // converge in one singe block which calls this runtime function. | 130 // converge in one singe block which calls this runtime function. |
131 // We hence pass the byte offset explicitely, and patch it into the top-most | 131 // We hence pass the byte offset explicitely, and patch it into the top-most |
132 // frame (a wasm frame) on the collected stack trace. | 132 // frame (a wasm frame) on the collected stack trace. |
133 // TODO(wasm): This implementation is temporary, see bug #5007: | 133 // TODO(wasm): This implementation is temporary, see bug #5007: |
134 // https://bugs.chromium.org/p/v8/issues/detail?id=5007 | 134 // https://bugs.chromium.org/p/v8/issues/detail?id=5007 |
135 Handle<JSObject> error = Handle<JSObject>::cast(error_obj); | 135 Handle<JSObject> error = Handle<JSObject>::cast(error_obj); |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 | 639 |
640 RUNTIME_FUNCTION(Runtime_Typeof) { | 640 RUNTIME_FUNCTION(Runtime_Typeof) { |
641 HandleScope scope(isolate); | 641 HandleScope scope(isolate); |
642 DCHECK_EQ(1, args.length()); | 642 DCHECK_EQ(1, args.length()); |
643 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 643 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
644 return *Object::TypeOf(isolate, object); | 644 return *Object::TypeOf(isolate, object); |
645 } | 645 } |
646 | 646 |
647 } // namespace internal | 647 } // namespace internal |
648 } // namespace v8 | 648 } // namespace v8 |
OLD | NEW |