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

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

Issue 1799793002: Precompilation: Have instances calls load the entry point and Code object from the ic data array in… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | « runtime/vm/precompiler.cc ('k') | runtime/vm/stub_code.h » ('j') | 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/snapshot.h" 5 #include "vm/snapshot.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/bootstrap.h" 8 #include "vm/bootstrap.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 for (intptr_t i = 0; i <= num_flds; i++) { 620 for (intptr_t i = 0; i <= num_flds; i++) {
621 *(object_store->from() + i) = ReadObjectImpl(kAsInlinedObject); 621 *(object_store->from() + i) = ReadObjectImpl(kAsInlinedObject);
622 } 622 }
623 for (intptr_t i = 0; i < backward_references_->length(); i++) { 623 for (intptr_t i = 0; i < backward_references_->length(); i++) {
624 if (!(*backward_references_)[i].is_deserialized()) { 624 if (!(*backward_references_)[i].is_deserialized()) {
625 ReadObjectImpl(kAsInlinedObject); 625 ReadObjectImpl(kAsInlinedObject);
626 (*backward_references_)[i].set_state(kIsDeserialized); 626 (*backward_references_)[i].set_state(kIsDeserialized);
627 } 627 }
628 } 628 }
629 629
630 if (snapshot_code()) {
631 ICData& ic = ICData::Handle(thread->zone());
632 Object& funcOrCode = Object::Handle(thread->zone());
633 Code& code = Code::Handle(thread->zone());
634 Smi& entry_point = Smi::Handle(thread->zone());
635 for (intptr_t i = 0; i < backward_references_->length(); i++) {
636 if ((*backward_references_)[i].reference()->IsICData()) {
637 ic ^= (*backward_references_)[i].reference()->raw();
638 for (intptr_t j = 0; j < ic.NumberOfChecks(); j++) {
639 funcOrCode = ic.GetTargetOrCodeAt(j);
640 if (funcOrCode.IsCode()) {
641 code ^= funcOrCode.raw();
642 entry_point = Smi::FromAlignedAddress(code.EntryPoint());
643 ic.SetEntryPointAt(j, entry_point);
644 }
645 }
646 }
647 }
648 }
649
650
630 // Validate the class table. 651 // Validate the class table.
631 #if defined(DEBUG) 652 #if defined(DEBUG)
632 isolate->ValidateClassTable(); 653 isolate->ValidateClassTable();
633 #endif 654 #endif
634 655
635 // Setup native resolver for bootstrap impl. 656 // Setup native resolver for bootstrap impl.
636 Bootstrap::SetupNativeResolver(); 657 Bootstrap::SetupNativeResolver();
637 return ApiError::null(); 658 return ApiError::null();
638 } 659 }
639 } 660 }
(...skipping 2035 matching lines...) Expand 10 before | Expand all | Expand 10 after
2675 if (setjmp(*jump.Set()) == 0) { 2696 if (setjmp(*jump.Set()) == 0) {
2676 NoSafepointScope no_safepoint; 2697 NoSafepointScope no_safepoint;
2677 WriteObject(obj.raw()); 2698 WriteObject(obj.raw());
2678 } else { 2699 } else {
2679 ThrowException(exception_type(), exception_msg()); 2700 ThrowException(exception_type(), exception_msg());
2680 } 2701 }
2681 } 2702 }
2682 2703
2683 2704
2684 } // namespace dart 2705 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/precompiler.cc ('k') | runtime/vm/stub_code.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698