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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 285 |
286 | 286 |
287 RUNTIME_FUNCTION(Runtime_MessageGetScript) { | 287 RUNTIME_FUNCTION(Runtime_MessageGetScript) { |
288 SealHandleScope shs(isolate); | 288 SealHandleScope shs(isolate); |
289 DCHECK(args.length() == 1); | 289 DCHECK(args.length() == 1); |
290 CONVERT_ARG_CHECKED(JSMessageObject, message, 0); | 290 CONVERT_ARG_CHECKED(JSMessageObject, message, 0); |
291 return message->script(); | 291 return message->script(); |
292 } | 292 } |
293 | 293 |
294 | 294 |
| 295 RUNTIME_FUNCTION(Runtime_ErrorToStringRT) { |
| 296 HandleScope scope(isolate); |
| 297 DCHECK(args.length() == 1); |
| 298 CONVERT_ARG_HANDLE_CHECKED(JSObject, error, 0); |
| 299 Handle<String> result; |
| 300 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 301 isolate, result, |
| 302 isolate->error_tostring_helper()->Stringify(isolate, error)); |
| 303 return *result; |
| 304 } |
| 305 |
| 306 |
295 RUNTIME_FUNCTION(Runtime_FormatMessageString) { | 307 RUNTIME_FUNCTION(Runtime_FormatMessageString) { |
296 HandleScope scope(isolate); | 308 HandleScope scope(isolate); |
297 DCHECK(args.length() == 4); | 309 DCHECK(args.length() == 4); |
298 CONVERT_INT32_ARG_CHECKED(template_index, 0); | 310 CONVERT_INT32_ARG_CHECKED(template_index, 0); |
299 CONVERT_ARG_HANDLE_CHECKED(String, arg0, 1); | 311 CONVERT_ARG_HANDLE_CHECKED(String, arg0, 1); |
300 CONVERT_ARG_HANDLE_CHECKED(String, arg1, 2); | 312 CONVERT_ARG_HANDLE_CHECKED(String, arg1, 2); |
301 CONVERT_ARG_HANDLE_CHECKED(String, arg2, 3); | 313 CONVERT_ARG_HANDLE_CHECKED(String, arg2, 3); |
302 Handle<String> result; | 314 Handle<String> result; |
303 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 315 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
304 isolate, result, | 316 isolate, result, |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 HandleScope scope(isolate); | 450 HandleScope scope(isolate); |
439 DCHECK_EQ(1, args.length()); | 451 DCHECK_EQ(1, args.length()); |
440 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 452 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
441 Handle<String> callsite = RenderCallSite(isolate, object); | 453 Handle<String> callsite = RenderCallSite(isolate, object); |
442 THROW_NEW_ERROR_RETURN_FAILURE( | 454 THROW_NEW_ERROR_RETURN_FAILURE( |
443 isolate, NewTypeError(MessageTemplate::kNotConstructor, callsite)); | 455 isolate, NewTypeError(MessageTemplate::kNotConstructor, callsite)); |
444 } | 456 } |
445 | 457 |
446 } // namespace internal | 458 } // namespace internal |
447 } // namespace v8 | 459 } // namespace v8 |
OLD | NEW |