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

Side by Side Diff: src/runtime/runtime-internal.cc

Issue 1087633005: Start migrating error message templates to the runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix windows build Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/debug.h" 9 #include "src/debug.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 298
299 299
300 RUNTIME_FUNCTION(Runtime_MessageGetScript) { 300 RUNTIME_FUNCTION(Runtime_MessageGetScript) {
301 SealHandleScope shs(isolate); 301 SealHandleScope shs(isolate);
302 DCHECK(args.length() == 1); 302 DCHECK(args.length() == 1);
303 CONVERT_ARG_CHECKED(JSMessageObject, message, 0); 303 CONVERT_ARG_CHECKED(JSMessageObject, message, 0);
304 return message->script(); 304 return message->script();
305 } 305 }
306 306
307 307
308 RUNTIME_FUNCTION(Runtime_FormatMessageString) {
309 HandleScope scope(isolate);
310 DCHECK(args.length() == 4);
311 CONVERT_INT32_ARG_CHECKED(template_index, 0);
312 CONVERT_ARG_HANDLE_CHECKED(String, arg0, 1);
313 CONVERT_ARG_HANDLE_CHECKED(String, arg1, 2);
314 CONVERT_ARG_HANDLE_CHECKED(String, arg2, 3);
315 Handle<String> result;
316 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
317 isolate, result,
318 MessageTemplate::FormatMessage(template_index, arg0, arg1, arg2));
319 return *result;
320 }
321
322
308 RUNTIME_FUNCTION(Runtime_IS_VAR) { 323 RUNTIME_FUNCTION(Runtime_IS_VAR) {
309 UNREACHABLE(); // implemented as macro in the parser 324 UNREACHABLE(); // implemented as macro in the parser
310 return NULL; 325 return NULL;
311 } 326 }
312 327
313 328
314 RUNTIME_FUNCTION(Runtime_GetFromCache) { 329 RUNTIME_FUNCTION(Runtime_GetFromCache) {
315 HandleScope scope(isolate); 330 HandleScope scope(isolate);
316 DCHECK(args.length() == 2); 331 DCHECK(args.length() == 2);
317 CONVERT_SMI_ARG_CHECKED(id, 0); 332 CONVERT_SMI_ARG_CHECKED(id, 0);
(...skipping 25 matching lines...) Expand all
343 return args[0]; 358 return args[0];
344 } 359 }
345 360
346 361
347 RUNTIME_FUNCTION(Runtime_HarmonyToString) { 362 RUNTIME_FUNCTION(Runtime_HarmonyToString) {
348 // TODO(caitp): Delete this runtime method when removing --harmony-tostring 363 // TODO(caitp): Delete this runtime method when removing --harmony-tostring
349 return isolate->heap()->ToBoolean(FLAG_harmony_tostring); 364 return isolate->heap()->ToBoolean(FLAG_harmony_tostring);
350 } 365 }
351 } 366 }
352 } // namespace v8::internal 367 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698