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

Side by Side Diff: runtime/vm/exceptions.cc

Issue 1644793002: Replace intptr_t with TokenDescriptor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « runtime/vm/exceptions.h ('k') | runtime/vm/flow_graph_builder.h » ('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 (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/exceptions.h" 5 #include "vm/exceptions.h"
6 6
7 #include "platform/address_sanitizer.h" 7 #include "platform/address_sanitizer.h"
8 8
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 // No ambiguity error expected: passing NULL. 419 // No ambiguity error expected: passing NULL.
420 Class& cls = Class::Handle(core_lib.LookupClass(cls_name)); 420 Class& cls = Class::Handle(core_lib.LookupClass(cls_name));
421 ASSERT(!cls.IsNull()); 421 ASSERT(!cls.IsNull());
422 // There are no parameterized error types, so no need to set type arguments. 422 // There are no parameterized error types, so no need to set type arguments.
423 return Instance::New(cls); 423 return Instance::New(cls);
424 } 424 }
425 425
426 426
427 // Allocate, initialize, and throw a TypeError or CastError. 427 // Allocate, initialize, and throw a TypeError or CastError.
428 // If error_msg is not null, throw a TypeError, even for a type cast. 428 // If error_msg is not null, throw a TypeError, even for a type cast.
429 void Exceptions::CreateAndThrowTypeError(intptr_t location, 429 void Exceptions::CreateAndThrowTypeError(TokenPosition location,
430 const String& src_type_name, 430 const String& src_type_name,
431 const String& dst_type_name, 431 const String& dst_type_name,
432 const String& dst_name, 432 const String& dst_name,
433 const String& error_msg) { 433 const String& error_msg) {
434 const Array& args = Array::Handle(Array::New(7)); 434 const Array& args = Array::Handle(Array::New(7));
435 435
436 ExceptionType exception_type = 436 ExceptionType exception_type =
437 (error_msg.IsNull() && dst_name.Equals(kCastErrorDstName)) ? 437 (error_msg.IsNull() && dst_name.Equals(kCastErrorDstName)) ?
438 kCast : kType; 438 kCast : kType;
439 439
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 void Exceptions::PrintStackTraceAndAbort(const char* reason) { 688 void Exceptions::PrintStackTraceAndAbort(const char* reason) {
689 const Instance& stacktrace = Instance::Handle(CurrentStacktrace()); 689 const Instance& stacktrace = Instance::Handle(CurrentStacktrace());
690 690
691 OS::PrintErr("\n\n\nAborting due to %s. Stacktrace:\n%s\n", 691 OS::PrintErr("\n\n\nAborting due to %s. Stacktrace:\n%s\n",
692 reason, 692 reason,
693 stacktrace.ToCString()); 693 stacktrace.ToCString());
694 OS::Abort(); 694 OS::Abort();
695 } 695 }
696 696
697 } // namespace dart 697 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/exceptions.h ('k') | runtime/vm/flow_graph_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698