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

Side by Side Diff: runtime/vm/raw_object_snapshot.cc

Issue 1316673005: Track which entries in the ObjectPool are native entries, and reset them when loading a precompiled… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months 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
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/native_entry.h"
5 #include "vm/object.h" 6 #include "vm/object.h"
6 #include "vm/object_store.h" 7 #include "vm/object_store.h"
7 #include "vm/snapshot.h" 8 #include "vm/snapshot.h"
8 #include "vm/stub_code.h" 9 #include "vm/stub_code.h"
9 #include "vm/symbols.h" 10 #include "vm/symbols.h"
10 #include "vm/visitor.h" 11 #include "vm/visitor.h"
11 12
12 namespace dart { 13 namespace dart {
13 14
14 DECLARE_FLAG(int, optimization_counter_threshold); 15 DECLARE_FLAG(int, optimization_counter_threshold);
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 intptr_t raw_value = reader->Read<intptr_t>(); 1290 intptr_t raw_value = reader->Read<intptr_t>();
1290 result.SetRawValueAt(i, raw_value); 1291 result.SetRawValueAt(i, raw_value);
1291 break; 1292 break;
1292 } 1293 }
1293 case ObjectPool::kExternalLabel: { 1294 case ObjectPool::kExternalLabel: {
1294 // TODO(rmacnak): Relocate. 1295 // TODO(rmacnak): Relocate.
1295 intptr_t raw_value = reader->Read<intptr_t>(); 1296 intptr_t raw_value = reader->Read<intptr_t>();
1296 result.SetRawValueAt(i, raw_value); 1297 result.SetRawValueAt(i, raw_value);
1297 break; 1298 break;
1298 } 1299 }
1300 case ObjectPool::kNativeEntry: {
1301 // Read nothing. Initialize with the lazy link entry.
1302 uword entry = reinterpret_cast<uword>(&NativeEntry::LinkNativeCall);
1303 #if defined(USING_SIMULATOR)
1304 entry = Simulator::RedirectExternalReference(
1305 entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments);
1306 #endif
1307 result.SetRawValueAt(i, entry);
1308 break;
1309 }
1299 default: 1310 default:
1300 UNREACHABLE(); 1311 UNREACHABLE();
1301 } 1312 }
1302 } 1313 }
1303 1314
1304 return result.raw(); 1315 return result.raw();
1305 } 1316 }
1306 1317
1307 1318
1308 void RawObjectPool::WriteTo(SnapshotWriter* writer, 1319 void RawObjectPool::WriteTo(SnapshotWriter* writer,
(...skipping 23 matching lines...) Expand all
1332 case ObjectPool::kTaggedObject: 1343 case ObjectPool::kTaggedObject:
1333 writer->WriteObjectImpl(entry.raw_obj_, kAsReference); 1344 writer->WriteObjectImpl(entry.raw_obj_, kAsReference);
1334 break; 1345 break;
1335 case ObjectPool::kImmediate: 1346 case ObjectPool::kImmediate:
1336 writer->Write<intptr_t>(entry.raw_value_); 1347 writer->Write<intptr_t>(entry.raw_value_);
1337 break; 1348 break;
1338 case ObjectPool::kExternalLabel: 1349 case ObjectPool::kExternalLabel:
1339 // TODO(rmacnak): Write symbolically. 1350 // TODO(rmacnak): Write symbolically.
1340 writer->Write<intptr_t>(entry.raw_value_); 1351 writer->Write<intptr_t>(entry.raw_value_);
1341 break; 1352 break;
1353 case ObjectPool::kNativeEntry:
1354 // Write nothing. Will initialize with the lazy link entry.
1355 break;
1342 default: 1356 default:
1343 UNREACHABLE(); 1357 UNREACHABLE();
1344 } 1358 }
1345 } 1359 }
1346 } 1360 }
1347 1361
1348 1362
1349 RawPcDescriptors* PcDescriptors::ReadFrom(SnapshotReader* reader, 1363 RawPcDescriptors* PcDescriptors::ReadFrom(SnapshotReader* reader,
1350 intptr_t object_id, 1364 intptr_t object_id,
1351 intptr_t tags, 1365 intptr_t tags,
(...skipping 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after
3250 // We do not allow objects with native fields in an isolate message. 3264 // We do not allow objects with native fields in an isolate message.
3251 writer->SetWriteException(Exceptions::kArgument, 3265 writer->SetWriteException(Exceptions::kArgument,
3252 "Illegal argument in isolate message" 3266 "Illegal argument in isolate message"
3253 " : (object is a UserTag)"); 3267 " : (object is a UserTag)");
3254 } else { 3268 } else {
3255 UNREACHABLE(); 3269 UNREACHABLE();
3256 } 3270 }
3257 } 3271 }
3258 3272
3259 } // namespace dart 3273 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/simulator_arm.cc » ('j') | runtime/vm/simulator_arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698