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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 len); | 411 len); |
412 } | 412 } |
413 | 413 |
414 | 414 |
415 RawTokenStream* SnapshotReader::NewTokenStream(intptr_t len) { | 415 RawTokenStream* SnapshotReader::NewTokenStream(intptr_t len) { |
416 ASSERT(kind_ == Snapshot::kFull); | 416 ASSERT(kind_ == Snapshot::kFull); |
417 ASSERT(isolate()->no_gc_scope_depth() != 0); | 417 ASSERT(isolate()->no_gc_scope_depth() != 0); |
418 cls_ = Object::token_stream_class(); | 418 cls_ = Object::token_stream_class(); |
419 stream_ = reinterpret_cast<RawTokenStream*>( | 419 stream_ = reinterpret_cast<RawTokenStream*>( |
420 AllocateUninitialized(cls_, TokenStream::InstanceSize())); | 420 AllocateUninitialized(cls_, TokenStream::InstanceSize())); |
421 cls_ = object_store()->external_int8_array_class(); | 421 cls_ = object_store()->external_uint8_array_class(); |
422 uint8_t* array = const_cast<uint8_t*>(CurrentBufferAddress()); | 422 uint8_t* array = const_cast<uint8_t*>(CurrentBufferAddress()); |
423 ASSERT(array != NULL); | 423 ASSERT(array != NULL); |
424 Advance(len); | 424 Advance(len); |
425 ExternalByteArrayData<uint8_t>* external_data = | 425 ExternalByteArrayData<uint8_t>* external_data = |
426 new ExternalByteArrayData<uint8_t>(array, NULL, NULL); | 426 new ExternalByteArrayData<uint8_t>(array, NULL, NULL); |
427 ASSERT(external_data != NULL); | 427 ASSERT(external_data != NULL); |
428 data_ = reinterpret_cast<RawExternalUint8Array*>( | 428 data_ = reinterpret_cast<RawExternalUint8Array*>( |
429 AllocateUninitialized(cls_, ExternalUint8Array::InstanceSize())); | 429 AllocateUninitialized(cls_, ExternalUint8Array::InstanceSize())); |
430 data_.SetExternalData(external_data); | 430 data_.SetExternalData(external_data); |
431 data_.SetLength(len); | 431 data_.SetLength(len); |
(...skipping 883 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 |