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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 RUNTIME_FUNCTION(Runtime_NewSyntaxError) { | 200 RUNTIME_FUNCTION(Runtime_NewSyntaxError) { |
201 HandleScope scope(isolate); | 201 HandleScope scope(isolate); |
202 DCHECK(args.length() == 2); | 202 DCHECK(args.length() == 2); |
203 CONVERT_INT32_ARG_CHECKED(template_index, 0); | 203 CONVERT_INT32_ARG_CHECKED(template_index, 0); |
204 CONVERT_ARG_HANDLE_CHECKED(Object, arg0, 1); | 204 CONVERT_ARG_HANDLE_CHECKED(Object, arg0, 1); |
205 auto message_template = | 205 auto message_template = |
206 static_cast<MessageTemplate::Template>(template_index); | 206 static_cast<MessageTemplate::Template>(template_index); |
207 return *isolate->factory()->NewSyntaxError(message_template, arg0); | 207 return *isolate->factory()->NewSyntaxError(message_template, arg0); |
208 } | 208 } |
209 | 209 |
| 210 RUNTIME_FUNCTION(Runtime_ThrowCannotConvertToPrimitive) { |
| 211 HandleScope scope(isolate); |
| 212 THROW_NEW_ERROR_RETURN_FAILURE( |
| 213 isolate, NewTypeError(MessageTemplate::kCannotConvertToPrimitive)); |
| 214 } |
210 | 215 |
211 RUNTIME_FUNCTION(Runtime_ThrowIllegalInvocation) { | 216 RUNTIME_FUNCTION(Runtime_ThrowIllegalInvocation) { |
212 HandleScope scope(isolate); | 217 HandleScope scope(isolate); |
213 DCHECK(args.length() == 0); | 218 DCHECK(args.length() == 0); |
214 THROW_NEW_ERROR_RETURN_FAILURE( | 219 THROW_NEW_ERROR_RETURN_FAILURE( |
215 isolate, NewTypeError(MessageTemplate::kIllegalInvocation)); | 220 isolate, NewTypeError(MessageTemplate::kIllegalInvocation)); |
216 } | 221 } |
217 | 222 |
218 RUNTIME_FUNCTION(Runtime_ThrowIncompatibleMethodReceiver) { | 223 RUNTIME_FUNCTION(Runtime_ThrowIncompatibleMethodReceiver) { |
219 HandleScope scope(isolate); | 224 HandleScope scope(isolate); |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 HandleScope scope(isolate); | 633 HandleScope scope(isolate); |
629 DCHECK_EQ(1, args.length()); | 634 DCHECK_EQ(1, args.length()); |
630 CONVERT_ARG_CHECKED(Object, object, 0); | 635 CONVERT_ARG_CHECKED(Object, object, 0); |
631 bool is_wasm_object = | 636 bool is_wasm_object = |
632 object->IsJSObject() && wasm::IsWasmObject(JSObject::cast(object)); | 637 object->IsJSObject() && wasm::IsWasmObject(JSObject::cast(object)); |
633 return *isolate->factory()->ToBoolean(is_wasm_object); | 638 return *isolate->factory()->ToBoolean(is_wasm_object); |
634 } | 639 } |
635 | 640 |
636 } // namespace internal | 641 } // namespace internal |
637 } // namespace v8 | 642 } // namespace v8 |
OLD | NEW |