OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |