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

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

Issue 1373333004: Also reset the stub of native calls. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | 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/native_entry.h" 5 #include "vm/native_entry.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/stub_code.h" 9 #include "vm/stub_code.h"
10 #include "vm/symbols.h" 10 #include "vm/symbols.h"
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 ASSERT(info_array != TypedData::null()); 1369 ASSERT(info_array != TypedData::null());
1370 1370
1371 writer->Write<intptr_t>(length); 1371 writer->Write<intptr_t>(length);
1372 for (intptr_t i = 0; i < length; i++) { 1372 for (intptr_t i = 0; i < length; i++) {
1373 ObjectPool::EntryType entry_type = 1373 ObjectPool::EntryType entry_type =
1374 static_cast<ObjectPool::EntryType>(info_array->data()[i]); 1374 static_cast<ObjectPool::EntryType>(info_array->data()[i]);
1375 writer->Write<int8_t>(entry_type); 1375 writer->Write<int8_t>(entry_type);
1376 Entry& entry = ptr()->data()[i]; 1376 Entry& entry = ptr()->data()[i];
1377 switch (entry_type) { 1377 switch (entry_type) {
1378 case ObjectPool::kTaggedObject: { 1378 case ObjectPool::kTaggedObject: {
1379 writer->WriteObjectImpl(entry.raw_obj_, kAsReference); 1379 if (entry.raw_obj_ == StubCode::CallNativeCFunction_entry()->code()) {
1380 // Natives can run while precompiling, becoming linked and switching
1381 // their stub. Reset to the initial stub used for lazy-linking.
1382 writer->WriteObjectImpl(
1383 StubCode::CallBootstrapCFunction_entry()->code(), kAsReference);
1384 } else {
1385 writer->WriteObjectImpl(entry.raw_obj_, kAsReference);
1386 }
1380 break; 1387 break;
1381 } 1388 }
1382 case ObjectPool::kImmediate: { 1389 case ObjectPool::kImmediate: {
1383 writer->Write<intptr_t>(entry.raw_value_); 1390 writer->Write<intptr_t>(entry.raw_value_);
1384 break; 1391 break;
1385 } 1392 }
1386 case ObjectPool::kNativeEntry: { 1393 case ObjectPool::kNativeEntry: {
1387 // Write nothing. Will initialize with the lazy link entry. 1394 // Write nothing. Will initialize with the lazy link entry.
1388 break; 1395 break;
1389 } 1396 }
(...skipping 1906 matching lines...) Expand 10 before | Expand all | Expand 10 after
3296 // We do not allow objects with native fields in an isolate message. 3303 // We do not allow objects with native fields in an isolate message.
3297 writer->SetWriteException(Exceptions::kArgument, 3304 writer->SetWriteException(Exceptions::kArgument,
3298 "Illegal argument in isolate message" 3305 "Illegal argument in isolate message"
3299 " : (object is a UserTag)"); 3306 " : (object is a UserTag)");
3300 } else { 3307 } else {
3301 UNREACHABLE(); 3308 UNREACHABLE();
3302 } 3309 }
3303 } 3310 }
3304 3311
3305 } // namespace dart 3312 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698