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

Side by Side Diff: vm/snapshot.cc

Issue 11639007: Cleanup the exceptions create code to use Arrays instead GrowableArrays so (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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 | « vm/object_store.cc ('k') | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/snapshot.h" 5 #include "vm/snapshot.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/bigint_operations.h" 8 #include "vm/bigint_operations.h"
9 #include "vm/bootstrap.h" 9 #include "vm/bootstrap.h"
10 #include "vm/exceptions.h" 10 #include "vm/exceptions.h"
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 WriteObjectRef(data[i]); 1244 WriteObjectRef(data[i]);
1245 } 1245 }
1246 } 1246 }
1247 1247
1248 1248
1249 void SnapshotWriter::ThrowException(Exceptions::ExceptionType type, 1249 void SnapshotWriter::ThrowException(Exceptions::ExceptionType type,
1250 const char* msg) { 1250 const char* msg) {
1251 Isolate::Current()->object_store()->clear_sticky_error(); 1251 Isolate::Current()->object_store()->clear_sticky_error();
1252 UnmarkAll(); 1252 UnmarkAll();
1253 const String& msg_obj = String::Handle(String::New(msg)); 1253 const String& msg_obj = String::Handle(String::New(msg));
1254 GrowableArray<const Object*> args(1); 1254 const Array& args = Array::Handle(Array::New(1));
1255 args.Add(&msg_obj); 1255 args.SetAt(0, msg_obj);
1256 Exceptions::ThrowByType(type, args); 1256 Exceptions::ThrowByType(type, args);
1257 UNREACHABLE(); 1257 UNREACHABLE();
1258 } 1258 }
1259 1259
1260 1260
1261 void ScriptSnapshotWriter::WriteScriptSnapshot(const Library& lib) { 1261 void ScriptSnapshotWriter::WriteScriptSnapshot(const Library& lib) {
1262 ASSERT(kind() == Snapshot::kScript); 1262 ASSERT(kind() == Snapshot::kScript);
1263 Isolate* isolate = Isolate::Current(); 1263 Isolate* isolate = Isolate::Current();
1264 ASSERT(isolate != NULL); 1264 ASSERT(isolate != NULL);
1265 1265
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 UnmarkAll(); 1315 UnmarkAll();
1316 isolate->set_long_jump_base(base); 1316 isolate->set_long_jump_base(base);
1317 } else { 1317 } else {
1318 isolate->set_long_jump_base(base); 1318 isolate->set_long_jump_base(base);
1319 ThrowException(exception_type(), exception_msg()); 1319 ThrowException(exception_type(), exception_msg());
1320 } 1320 }
1321 } 1321 }
1322 1322
1323 1323
1324 } // namespace dart 1324 } // namespace dart
OLDNEW
« no previous file with comments | « vm/object_store.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698