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

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 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 intptr_t raw_value = reader->Read<intptr_t>(); 1272 intptr_t raw_value = reader->Read<intptr_t>();
1272 result.SetRawValueAt(i, raw_value); 1273 result.SetRawValueAt(i, raw_value);
1273 break; 1274 break;
1274 } 1275 }
1275 case ObjectPool::kExternalLabel: { 1276 case ObjectPool::kExternalLabel: {
1276 // TODO(rmacnak): Relocate. 1277 // TODO(rmacnak): Relocate.
1277 intptr_t raw_value = reader->Read<intptr_t>(); 1278 intptr_t raw_value = reader->Read<intptr_t>();
1278 result.SetRawValueAt(i, raw_value); 1279 result.SetRawValueAt(i, raw_value);
1279 break; 1280 break;
1280 } 1281 }
1282 case ObjectPool::kNativeEntry: {
1283 // Read nothing. Initialize with the lazy link entry.
1284 uword entry = reinterpret_cast<uword>(&NativeEntry::LinkNativeCall);
1285 #if defined(USING_SIMULATOR)
1286 entry = Simulator::RedirectExternalReference(
1287 entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments);
1288 #endif
1289 result.SetRawValueAt(i, entry);
1290 break;
1291 }
1281 default: 1292 default:
1282 UNREACHABLE(); 1293 UNREACHABLE();
1283 } 1294 }
1284 } 1295 }
1285 1296
1286 return result.raw(); 1297 return result.raw();
1287 } 1298 }
1288 1299
1289 1300
1290 void RawObjectPool::WriteTo(SnapshotWriter* writer, 1301 void RawObjectPool::WriteTo(SnapshotWriter* writer,
(...skipping 23 matching lines...) Expand all
1314 case ObjectPool::kTaggedObject: 1325 case ObjectPool::kTaggedObject:
1315 writer->WriteObjectImpl(entry.raw_obj_, kAsReference); 1326 writer->WriteObjectImpl(entry.raw_obj_, kAsReference);
1316 break; 1327 break;
1317 case ObjectPool::kImmediate: 1328 case ObjectPool::kImmediate:
1318 writer->Write<intptr_t>(entry.raw_value_); 1329 writer->Write<intptr_t>(entry.raw_value_);
1319 break; 1330 break;
1320 case ObjectPool::kExternalLabel: 1331 case ObjectPool::kExternalLabel:
1321 // TODO(rmacnak): Write symbolically. 1332 // TODO(rmacnak): Write symbolically.
1322 writer->Write<intptr_t>(entry.raw_value_); 1333 writer->Write<intptr_t>(entry.raw_value_);
1323 break; 1334 break;
1335 case ObjectPool::kNativeEntry:
1336 // Write nothing. Will initialize with the lazy link entry.
1337 break;
1324 default: 1338 default:
1325 UNREACHABLE(); 1339 UNREACHABLE();
1326 } 1340 }
1327 } 1341 }
1328 } 1342 }
1329 1343
1330 1344
1331 RawPcDescriptors* PcDescriptors::ReadFrom(SnapshotReader* reader, 1345 RawPcDescriptors* PcDescriptors::ReadFrom(SnapshotReader* reader,
1332 intptr_t object_id, 1346 intptr_t object_id,
1333 intptr_t tags, 1347 intptr_t tags,
(...skipping 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after
3232 // We do not allow objects with native fields in an isolate message. 3246 // We do not allow objects with native fields in an isolate message.
3233 writer->SetWriteException(Exceptions::kArgument, 3247 writer->SetWriteException(Exceptions::kArgument,
3234 "Illegal argument in isolate message" 3248 "Illegal argument in isolate message"
3235 " : (object is a UserTag)"); 3249 " : (object is a UserTag)");
3236 } else { 3250 } else {
3237 UNREACHABLE(); 3251 UNREACHABLE();
3238 } 3252 }
3239 } 3253 }
3240 3254
3241 } // namespace dart 3255 } // namespace dart
OLDNEW
« runtime/vm/intermediate_language_arm.cc ('K') | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698