Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1332)

Unified Diff: src/runtime/runtime-internal.cc

Issue 1210533003: Use C runtime functions for ThrowNewXXError desugarings. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-internal.cc
diff --git a/src/runtime/runtime-internal.cc b/src/runtime/runtime-internal.cc
index 294e4fb138ea92769546a1270931a80d406e5839..becd2f0e4fa7b265278bfc67824e8ed6b863b1ae 100644
--- a/src/runtime/runtime-internal.cc
+++ b/src/runtime/runtime-internal.cc
@@ -60,6 +60,39 @@ RUNTIME_FUNCTION(Runtime_ThrowReferenceError) {
}
+RUNTIME_FUNCTION(Runtime_NewTypeError) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 2);
+ CONVERT_INT32_ARG_CHECKED(template_index, 0);
+ CONVERT_ARG_HANDLE_CHECKED(Object, arg0, 1);
+ auto message_template =
+ static_cast<MessageTemplate::Template>(template_index);
+ return *isolate->factory()->NewTypeError(message_template, arg0);
+}
+
+
+RUNTIME_FUNCTION(Runtime_NewReferenceError) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 2);
+ CONVERT_INT32_ARG_CHECKED(template_index, 0);
+ CONVERT_ARG_HANDLE_CHECKED(Object, arg0, 1);
+ auto message_template =
+ static_cast<MessageTemplate::Template>(template_index);
+ return *isolate->factory()->NewReferenceError(message_template, arg0);
+}
+
+
+RUNTIME_FUNCTION(Runtime_NewSyntaxError) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 2);
+ CONVERT_INT32_ARG_CHECKED(template_index, 0);
+ CONVERT_ARG_HANDLE_CHECKED(Object, arg0, 1);
+ auto message_template =
+ static_cast<MessageTemplate::Template>(template_index);
+ return *isolate->factory()->NewSyntaxError(message_template, arg0);
+}
+
+
RUNTIME_FUNCTION(Runtime_ThrowIteratorResultNotAnObject) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
« no previous file with comments | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698