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

Side by Side Diff: src/runtime/runtime-scopes.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-internal.cc ('k') | src/weak-collection.js » ('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/accessors.h" 7 #include "src/accessors.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/frames-inl.h" 9 #include "src/frames-inl.h"
10 #include "src/messages.h"
10 #include "src/runtime/runtime-utils.h" 11 #include "src/runtime/runtime-utils.h"
11 #include "src/scopeinfo.h" 12 #include "src/scopeinfo.h"
12 #include "src/scopes.h" 13 #include "src/scopes.h"
13 14
14 namespace v8 { 15 namespace v8 {
15 namespace internal { 16 namespace internal {
16 17
17 static Object* ThrowRedeclarationError(Isolate* isolate, Handle<String> name) { 18 static Object* ThrowRedeclarationError(Isolate* isolate, Handle<String> name) {
18 HandleScope scope(isolate); 19 HandleScope scope(isolate);
19 Handle<Object> args[1] = {name}; 20 Handle<Object> args[1] = {name};
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 Handle<JSReceiver> extension_object; 656 Handle<JSReceiver> extension_object;
656 if (args[0]->IsJSReceiver()) { 657 if (args[0]->IsJSReceiver()) {
657 extension_object = args.at<JSReceiver>(0); 658 extension_object = args.at<JSReceiver>(0);
658 } else { 659 } else {
659 // Try to convert the object to a proper JavaScript object. 660 // Try to convert the object to a proper JavaScript object.
660 MaybeHandle<JSReceiver> maybe_object = 661 MaybeHandle<JSReceiver> maybe_object =
661 Object::ToObject(isolate, args.at<Object>(0)); 662 Object::ToObject(isolate, args.at<Object>(0));
662 if (!maybe_object.ToHandle(&extension_object)) { 663 if (!maybe_object.ToHandle(&extension_object)) {
663 Handle<Object> handle = args.at<Object>(0); 664 Handle<Object> handle = args.at<Object>(0);
664 THROW_NEW_ERROR_RETURN_FAILURE( 665 THROW_NEW_ERROR_RETURN_FAILURE(
665 isolate, NewTypeError("with_expression", HandleVector(&handle, 1))); 666 isolate, NewTypeError(MessageTemplate::kWithExpression, handle));
666 } 667 }
667 } 668 }
668 669
669 Handle<JSFunction> function; 670 Handle<JSFunction> function;
670 if (args[1]->IsSmi()) { 671 if (args[1]->IsSmi()) {
671 // A smi sentinel indicates a context nested inside global code rather 672 // A smi sentinel indicates a context nested inside global code rather
672 // than some function. There is a canonical empty function that can be 673 // than some function. There is a canonical empty function that can be
673 // gotten from the native context. 674 // gotten from the native context.
674 function = handle(isolate->native_context()->closure()); 675 function = handle(isolate->native_context()->closure());
675 } else { 676 } else {
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 return Smi::FromInt(frame->GetArgumentsLength()); 1115 return Smi::FromInt(frame->GetArgumentsLength());
1115 } 1116 }
1116 1117
1117 1118
1118 RUNTIME_FUNCTION(Runtime_Arguments) { 1119 RUNTIME_FUNCTION(Runtime_Arguments) {
1119 SealHandleScope shs(isolate); 1120 SealHandleScope shs(isolate);
1120 return __RT_impl_Runtime_GetArgumentsProperty(args, isolate); 1121 return __RT_impl_Runtime_GetArgumentsProperty(args, isolate);
1121 } 1122 }
1122 } 1123 }
1123 } // namespace v8::internal 1124 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime-internal.cc ('k') | src/weak-collection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698