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

Side by Side Diff: runtime/lib/error.cc

Issue 8476002: Fix more co19 crashes. Introduce GET_NATIVE_ARGUMENT that throws an illegal argument exception if... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/lib/integers.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 (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 "lib/error.h" 5 #include "lib/error.h"
6 6
7 #include "vm/bootstrap_natives.h" 7 #include "vm/bootstrap_natives.h"
8 #include "vm/exceptions.h" 8 #include "vm/exceptions.h"
9 #include "vm/object_store.h" 9 #include "vm/object_store.h"
10 #include "vm/runtime_entry.h" 10 #include "vm/runtime_entry.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // Throw TypeError instance. 149 // Throw TypeError instance.
150 Exceptions::Throw(type_error); 150 Exceptions::Throw(type_error);
151 UNREACHABLE(); 151 UNREACHABLE();
152 } 152 }
153 153
154 154
155 // Allocate and throw a new FallThroughError. 155 // Allocate and throw a new FallThroughError.
156 // Arg0: index of the case clause token into which we fall through. 156 // Arg0: index of the case clause token into which we fall through.
157 // Return value: none, throws an exception. 157 // Return value: none, throws an exception.
158 DEFINE_NATIVE_ENTRY(FallThroughError_throwNew, 1) { 158 DEFINE_NATIVE_ENTRY(FallThroughError_throwNew, 1) {
159 intptr_t fallthrough_pos = Smi::CheckedHandle(arguments->At(0)).Value(); 159 GET_NATIVE_ARGUMENT(Smi, smi_pos, arguments->At(0));
160 intptr_t fallthrough_pos = smi_pos.Value();
160 161
161 // Allocate a new instance of type FallThroughError. 162 // Allocate a new instance of type FallThroughError.
162 const Instance& fallthrough_error = 163 const Instance& fallthrough_error =
163 Instance::Handle(NewInstance("FallThroughError")); 164 Instance::Handle(NewInstance("FallThroughError"));
164 ASSERT(!fallthrough_error.IsNull()); 165 ASSERT(!fallthrough_error.IsNull());
165 166
166 // Initialize 'url' and 'line' fields. 167 // Initialize 'url' and 'line' fields.
167 DartFrameIterator iterator; 168 DartFrameIterator iterator;
168 iterator.NextFrame(); // Skip native call. 169 iterator.NextFrame(); // Skip native call.
169 const Script& script = Script::Handle(GetCallerScript(&iterator)); 170 const Script& script = Script::Handle(GetCallerScript(&iterator));
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 dst_type_name = element_type.Name(); 279 dst_type_name = element_type.Name();
279 } 280 }
280 const String& dst_name = String::Handle(String::New(buf)); 281 const String& dst_name = String::Handle(String::New(buf));
281 ThrowTypeError(location, src_type_name, dst_type_name, dst_name); 282 ThrowTypeError(location, src_type_name, dst_type_name, dst_name);
282 UNREACHABLE(); 283 UNREACHABLE();
283 } 284 }
284 } 285 }
285 } 286 }
286 287
287 } // namespace dart 288 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/integers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698