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/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 2209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2220 writer->WriteIntptrValue(writer->GetObjectTags(this)); | 2220 writer->WriteIntptrValue(writer->GetObjectTags(this)); |
2221 | 2221 |
2222 // Write out the float values. | 2222 // Write out the float values. |
2223 writer->Write<float>(ptr()->value_[0]); | 2223 writer->Write<float>(ptr()->value_[0]); |
2224 writer->Write<float>(ptr()->value_[1]); | 2224 writer->Write<float>(ptr()->value_[1]); |
2225 writer->Write<float>(ptr()->value_[2]); | 2225 writer->Write<float>(ptr()->value_[2]); |
2226 writer->Write<float>(ptr()->value_[3]); | 2226 writer->Write<float>(ptr()->value_[3]); |
2227 } | 2227 } |
2228 | 2228 |
2229 | 2229 |
2230 RawUint32x4* Uint32x4::ReadFrom(SnapshotReader* reader, | 2230 RawInt32x4* Int32x4::ReadFrom(SnapshotReader* reader, |
2231 intptr_t object_id, | 2231 intptr_t object_id, |
2232 intptr_t tags, | 2232 intptr_t tags, |
2233 Snapshot::Kind kind) { | 2233 Snapshot::Kind kind) { |
2234 ASSERT(reader != NULL); | 2234 ASSERT(reader != NULL); |
2235 // Read the values. | 2235 // Read the values. |
2236 uint32_t value0 = reader->Read<uint32_t>(); | 2236 uint32_t value0 = reader->Read<uint32_t>(); |
2237 uint32_t value1 = reader->Read<uint32_t>(); | 2237 uint32_t value1 = reader->Read<uint32_t>(); |
2238 uint32_t value2 = reader->Read<uint32_t>(); | 2238 uint32_t value2 = reader->Read<uint32_t>(); |
2239 uint32_t value3 = reader->Read<uint32_t>(); | 2239 uint32_t value3 = reader->Read<uint32_t>(); |
2240 | 2240 |
2241 // Create a Float32x4 object. | 2241 // Create a Float32x4 object. |
2242 Uint32x4& simd = Uint32x4::ZoneHandle(reader->isolate(), Uint32x4::null()); | 2242 Int32x4& simd = Int32x4::ZoneHandle(reader->isolate(), Int32x4::null()); |
2243 | 2243 |
2244 if (kind == Snapshot::kFull) { | 2244 if (kind == Snapshot::kFull) { |
2245 simd = reader->NewUint32x4(value0, value1, value2, value3); | 2245 simd = reader->NewInt32x4(value0, value1, value2, value3); |
2246 } else { | 2246 } else { |
2247 simd = Uint32x4::New(value0, value1, value2, value3, HEAP_SPACE(kind)); | 2247 simd = Int32x4::New(value0, value1, value2, value3, HEAP_SPACE(kind)); |
2248 } | 2248 } |
2249 reader->AddBackRef(object_id, &simd, kIsDeserialized); | 2249 reader->AddBackRef(object_id, &simd, kIsDeserialized); |
2250 // Set the object tags. | 2250 // Set the object tags. |
2251 simd.set_tags(tags); | 2251 simd.set_tags(tags); |
2252 return simd.raw(); | 2252 return simd.raw(); |
2253 } | 2253 } |
2254 | 2254 |
2255 | 2255 |
2256 void RawUint32x4::WriteTo(SnapshotWriter* writer, | 2256 void RawInt32x4::WriteTo(SnapshotWriter* writer, |
2257 intptr_t object_id, | 2257 intptr_t object_id, |
2258 Snapshot::Kind kind) { | 2258 Snapshot::Kind kind) { |
2259 ASSERT(writer != NULL); | 2259 ASSERT(writer != NULL); |
2260 | 2260 |
2261 // Write out the serialization header value for this object. | 2261 // Write out the serialization header value for this object. |
2262 writer->WriteInlinedObjectHeader(object_id); | 2262 writer->WriteInlinedObjectHeader(object_id); |
2263 | 2263 |
2264 // Write out the class and tags information. | 2264 // Write out the class and tags information. |
2265 writer->WriteIndexedObject(kUint32x4Cid); | 2265 writer->WriteIndexedObject(kInt32x4Cid); |
2266 writer->WriteIntptrValue(writer->GetObjectTags(this)); | 2266 writer->WriteIntptrValue(writer->GetObjectTags(this)); |
2267 | 2267 |
2268 // Write out the mask values. | 2268 // Write out the mask values. |
2269 writer->Write<uint32_t>(ptr()->value_[0]); | 2269 writer->Write<uint32_t>(ptr()->value_[0]); |
2270 writer->Write<uint32_t>(ptr()->value_[1]); | 2270 writer->Write<uint32_t>(ptr()->value_[1]); |
2271 writer->Write<uint32_t>(ptr()->value_[2]); | 2271 writer->Write<uint32_t>(ptr()->value_[2]); |
2272 writer->Write<uint32_t>(ptr()->value_[3]); | 2272 writer->Write<uint32_t>(ptr()->value_[3]); |
2273 } | 2273 } |
2274 | 2274 |
2275 | 2275 |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2658 // We do not allow objects with native fields in an isolate message. | 2658 // We do not allow objects with native fields in an isolate message. |
2659 writer->SetWriteException(Exceptions::kArgument, | 2659 writer->SetWriteException(Exceptions::kArgument, |
2660 "Illegal argument in isolate message" | 2660 "Illegal argument in isolate message" |
2661 " : (object is a MirrorReference)"); | 2661 " : (object is a MirrorReference)"); |
2662 } else { | 2662 } else { |
2663 UNREACHABLE(); | 2663 UNREACHABLE(); |
2664 } | 2664 } |
2665 } | 2665 } |
2666 | 2666 |
2667 } // namespace dart | 2667 } // namespace dart |
OLD | NEW |