| 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 THROW_NEW_ERROR_RETURN_FAILURE( | 230 THROW_NEW_ERROR_RETURN_FAILURE( |
| 231 isolate, NewTypeError(MessageTemplate::kNonCallableInInstanceOfCheck)); | 231 isolate, NewTypeError(MessageTemplate::kNonCallableInInstanceOfCheck)); |
| 232 } | 232 } |
| 233 | 233 |
| 234 RUNTIME_FUNCTION(Runtime_ThrowNonObjectInInstanceOfCheck) { | 234 RUNTIME_FUNCTION(Runtime_ThrowNonObjectInInstanceOfCheck) { |
| 235 HandleScope scope(isolate); | 235 HandleScope scope(isolate); |
| 236 THROW_NEW_ERROR_RETURN_FAILURE( | 236 THROW_NEW_ERROR_RETURN_FAILURE( |
| 237 isolate, NewTypeError(MessageTemplate::kNonObjectInInstanceOfCheck)); | 237 isolate, NewTypeError(MessageTemplate::kNonObjectInInstanceOfCheck)); |
| 238 } | 238 } |
| 239 | 239 |
| 240 RUNTIME_FUNCTION(Runtime_ThrowNotConstructor) { |
| 241 HandleScope scope(isolate); |
| 242 DCHECK_EQ(1, args.length()); |
| 243 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
| 244 THROW_NEW_ERROR_RETURN_FAILURE( |
| 245 isolate, NewTypeError(MessageTemplate::kNotConstructor, object)); |
| 246 } |
| 247 |
| 240 RUNTIME_FUNCTION(Runtime_ThrowNotGeneric) { | 248 RUNTIME_FUNCTION(Runtime_ThrowNotGeneric) { |
| 241 HandleScope scope(isolate); | 249 HandleScope scope(isolate); |
| 242 DCHECK_EQ(1, args.length()); | 250 DCHECK_EQ(1, args.length()); |
| 243 CONVERT_ARG_HANDLE_CHECKED(Object, arg0, 0); | 251 CONVERT_ARG_HANDLE_CHECKED(Object, arg0, 0); |
| 244 THROW_NEW_ERROR_RETURN_FAILURE( | 252 THROW_NEW_ERROR_RETURN_FAILURE( |
| 245 isolate, NewTypeError(MessageTemplate::kNotGeneric, arg0)); | 253 isolate, NewTypeError(MessageTemplate::kNotGeneric, arg0)); |
| 246 } | 254 } |
| 247 | 255 |
| 248 RUNTIME_FUNCTION(Runtime_ThrowGeneratorRunning) { | 256 RUNTIME_FUNCTION(Runtime_ThrowGeneratorRunning) { |
| 249 HandleScope scope(isolate); | 257 HandleScope scope(isolate); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 if (str->length() > 0) return str; | 379 if (str->length() > 0) return str; |
| 372 } else { | 380 } else { |
| 373 isolate->clear_pending_exception(); | 381 isolate->clear_pending_exception(); |
| 374 } | 382 } |
| 375 } | 383 } |
| 376 return Object::TypeOf(isolate, object); | 384 return Object::TypeOf(isolate, object); |
| 377 } | 385 } |
| 378 | 386 |
| 379 } // namespace | 387 } // namespace |
| 380 | 388 |
| 381 | |
| 382 RUNTIME_FUNCTION(Runtime_ThrowCalledNonCallable) { | 389 RUNTIME_FUNCTION(Runtime_ThrowCalledNonCallable) { |
| 383 HandleScope scope(isolate); | 390 HandleScope scope(isolate); |
| 384 DCHECK_EQ(1, args.length()); | 391 DCHECK_EQ(1, args.length()); |
| 385 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 392 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
| 386 Handle<String> callsite = RenderCallSite(isolate, object); | 393 Handle<String> callsite = RenderCallSite(isolate, object); |
| 387 THROW_NEW_ERROR_RETURN_FAILURE( | 394 THROW_NEW_ERROR_RETURN_FAILURE( |
| 388 isolate, NewTypeError(MessageTemplate::kCalledNonCallable, callsite)); | 395 isolate, NewTypeError(MessageTemplate::kCalledNonCallable, callsite)); |
| 389 } | 396 } |
| 390 | 397 |
| 391 RUNTIME_FUNCTION(Runtime_ThrowCalledOnNullOrUndefined) { | 398 RUNTIME_FUNCTION(Runtime_ThrowCalledOnNullOrUndefined) { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 HandleScope scope(isolate); | 511 HandleScope scope(isolate); |
| 505 DCHECK_EQ(1, args.length()); | 512 DCHECK_EQ(1, args.length()); |
| 506 CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0); | 513 CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0); |
| 507 Handle<JSObject> global_proxy(target->global_proxy(), isolate); | 514 Handle<JSObject> global_proxy(target->global_proxy(), isolate); |
| 508 return *isolate->factory()->ToBoolean( | 515 return *isolate->factory()->ToBoolean( |
| 509 Builtins::AllowDynamicFunction(isolate, target, global_proxy)); | 516 Builtins::AllowDynamicFunction(isolate, target, global_proxy)); |
| 510 } | 517 } |
| 511 | 518 |
| 512 } // namespace internal | 519 } // namespace internal |
| 513 } // namespace v8 | 520 } // namespace v8 |
| OLD | NEW |