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

Side by Side Diff: vm/raw_object_snapshot.cc

Issue 11293031: Remove some unnecessary class handle creations. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | « vm/object.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/bigint_operations.h" 5 #include "vm/bigint_operations.h"
6 #include "vm/object.h" 6 #include "vm/object.h"
7 #include "vm/object_store.h" 7 #include "vm/object_store.h"
8 #include "vm/snapshot.h" 8 #include "vm/snapshot.h"
9 #include "vm/symbols.h" 9 #include "vm/symbols.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 2084 matching lines...) Expand 10 before | Expand all | Expand 10 after
2095 SnapshotReader* reader, \ 2095 SnapshotReader* reader, \
2096 intptr_t object_id, \ 2096 intptr_t object_id, \
2097 intptr_t tags, \ 2097 intptr_t tags, \
2098 Snapshot::Kind kind) { \ 2098 Snapshot::Kind kind) { \
2099 ASSERT(kind != Snapshot::kFull); \ 2099 ASSERT(kind != Snapshot::kFull); \
2100 intptr_t length = reader->ReadSmiValue(); \ 2100 intptr_t length = reader->ReadSmiValue(); \
2101 type* data = reinterpret_cast<type*>(reader->ReadIntptrValue()); \ 2101 type* data = reinterpret_cast<type*>(reader->ReadIntptrValue()); \
2102 void* peer = reinterpret_cast<void*>(reader->ReadIntptrValue()); \ 2102 void* peer = reinterpret_cast<void*>(reader->ReadIntptrValue()); \
2103 Dart_PeerFinalizer callback = \ 2103 Dart_PeerFinalizer callback = \
2104 reinterpret_cast<Dart_PeerFinalizer>(reader->ReadIntptrValue()); \ 2104 reinterpret_cast<Dart_PeerFinalizer>(reader->ReadIntptrValue()); \
2105 const Class& cls = Class::Handle( \ 2105 return New(data, length, peer, callback, HEAP_SPACE(kind)); \
2106 reader->isolate()->object_store()->external_##lname##_array_class()); \
2107 return NewExternalImpl<External##name##Array, RawExternal##name##Array>( \
2108 cls, data, length, peer, callback, HEAP_SPACE(kind)); \
2109 } \ 2106 } \
2110 2107
2111 2108
2112 BYTEARRAY_TYPE_LIST(EXTERNALARRAY_READ_FROM) 2109 BYTEARRAY_TYPE_LIST(EXTERNALARRAY_READ_FROM)
2113 #undef EXTERNALARRAY_READ_FROM 2110 #undef EXTERNALARRAY_READ_FROM
2114 2111
2115 2112
2116 template<typename ElementT> 2113 template<typename ElementT>
2117 static void ByteArrayWriteTo(SnapshotWriter* writer, 2114 static void ByteArrayWriteTo(SnapshotWriter* writer,
2118 intptr_t object_id, 2115 intptr_t object_id,
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2307 // Write out the class and tags information. 2304 // Write out the class and tags information.
2308 writer->WriteIndexedObject(kWeakPropertyCid); 2305 writer->WriteIndexedObject(kWeakPropertyCid);
2309 writer->WriteIntptrValue(writer->GetObjectTags(this)); 2306 writer->WriteIntptrValue(writer->GetObjectTags(this));
2310 2307
2311 // Write out all the other fields. 2308 // Write out all the other fields.
2312 writer->Write<RawObject*>(ptr()->key_); 2309 writer->Write<RawObject*>(ptr()->key_);
2313 writer->Write<RawObject*>(ptr()->value_); 2310 writer->Write<RawObject*>(ptr()->value_);
2314 } 2311 }
2315 2312
2316 } // namespace dart 2313 } // namespace dart
OLDNEW
« no previous file with comments | « vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698