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

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

Issue 2226893002: Optimize AOT's switchable calls for the monomorphic case. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 4 years, 4 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/assembler_x64_test.cc ('k') | runtime/vm/code_generator.cc » ('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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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/clustered_snapshot.h" 5 #include "vm/clustered_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 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1512 bool is_vm_object = d->isolate() == Dart::vm_isolate(); 1512 bool is_vm_object = d->isolate() == Dart::vm_isolate();
1513 1513
1514 for (intptr_t id = start_index_; id < stop_index_; id++) { 1514 for (intptr_t id = start_index_; id < stop_index_; id++) {
1515 RawCode* code = reinterpret_cast<RawCode*>(d->Ref(id)); 1515 RawCode* code = reinterpret_cast<RawCode*>(d->Ref(id));
1516 Deserializer::InitializeHeader(code, kCodeCid, 1516 Deserializer::InitializeHeader(code, kCodeCid,
1517 Code::InstanceSize(0), is_vm_object); 1517 Code::InstanceSize(0), is_vm_object);
1518 1518
1519 int32_t text_offset = d->Read<int32_t>(); 1519 int32_t text_offset = d->Read<int32_t>();
1520 RawInstructions* instr = reinterpret_cast<RawInstructions*>( 1520 RawInstructions* instr = reinterpret_cast<RawInstructions*>(
1521 d->GetInstructionsAt(text_offset) + kHeapObjectTag); 1521 d->GetInstructionsAt(text_offset) + kHeapObjectTag);
1522 uword entry_point = Instructions::EntryPoint(instr);
1523 1522
1524 code->ptr()->entry_point_ = entry_point; 1523 code->ptr()->entry_point_ = Instructions::UncheckedEntryPoint(instr);
1524 code->ptr()->checked_entry_point_ =
1525 Instructions::CheckedEntryPoint(instr);
1525 code->ptr()->active_instructions_ = instr; 1526 code->ptr()->active_instructions_ = instr;
1526 code->ptr()->instructions_ = instr; 1527 code->ptr()->instructions_ = instr;
1527 code->ptr()->object_pool_ = 1528 code->ptr()->object_pool_ =
1528 reinterpret_cast<RawObjectPool*>(d->ReadRef()); 1529 reinterpret_cast<RawObjectPool*>(d->ReadRef());
1529 code->ptr()->owner_ = d->ReadRef(); 1530 code->ptr()->owner_ = d->ReadRef();
1530 code->ptr()->exception_handlers_ = 1531 code->ptr()->exception_handlers_ =
1531 reinterpret_cast<RawExceptionHandlers*>(d->ReadRef()); 1532 reinterpret_cast<RawExceptionHandlers*>(d->ReadRef());
1532 code->ptr()->pc_descriptors_ = 1533 code->ptr()->pc_descriptors_ =
1533 reinterpret_cast<RawPcDescriptors*>(d->ReadRef()); 1534 reinterpret_cast<RawPcDescriptors*>(d->ReadRef());
1534 code->ptr()->stackmaps_ = 1535 code->ptr()->stackmaps_ =
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
2134 ICData& ic = ICData::Handle(zone); 2135 ICData& ic = ICData::Handle(zone);
2135 Object& funcOrCode = Object::Handle(zone); 2136 Object& funcOrCode = Object::Handle(zone);
2136 Code& code = Code::Handle(zone); 2137 Code& code = Code::Handle(zone);
2137 Smi& entry_point = Smi::Handle(zone); 2138 Smi& entry_point = Smi::Handle(zone);
2138 for (intptr_t i = start_index_; i < stop_index_; i++) { 2139 for (intptr_t i = start_index_; i < stop_index_; i++) {
2139 ic ^= refs.At(i); 2140 ic ^= refs.At(i);
2140 for (intptr_t j = 0; j < ic.NumberOfChecks(); j++) { 2141 for (intptr_t j = 0; j < ic.NumberOfChecks(); j++) {
2141 funcOrCode = ic.GetTargetOrCodeAt(j); 2142 funcOrCode = ic.GetTargetOrCodeAt(j);
2142 if (funcOrCode.IsCode()) { 2143 if (funcOrCode.IsCode()) {
2143 code ^= funcOrCode.raw(); 2144 code ^= funcOrCode.raw();
2144 entry_point = Smi::FromAlignedAddress(code.EntryPoint()); 2145 entry_point = Smi::FromAlignedAddress(code.UncheckedEntryPoint());
2145 ic.SetEntryPointAt(j, entry_point); 2146 ic.SetEntryPointAt(j, entry_point);
2146 } 2147 }
2147 } 2148 }
2148 } 2149 }
2149 } 2150 }
2150 } 2151 }
2151 }; 2152 };
2152 2153
2153 2154
2154 class MegamorphicCacheSerializationCluster : public SerializationCluster { 2155 class MegamorphicCacheSerializationCluster : public SerializationCluster {
(...skipping 2878 matching lines...) Expand 10 before | Expand all | Expand 10 after
5033 5034
5034 deserializer.ReadVMSnapshot(); 5035 deserializer.ReadVMSnapshot();
5035 5036
5036 Dart::set_instructions_snapshot_buffer(instructions_buffer_); 5037 Dart::set_instructions_snapshot_buffer(instructions_buffer_);
5037 Dart::set_data_snapshot_buffer(data_buffer_); 5038 Dart::set_data_snapshot_buffer(data_buffer_);
5038 5039
5039 return ApiError::null(); 5040 return ApiError::null();
5040 } 5041 }
5041 5042
5042 } // namespace dart 5043 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/assembler_x64_test.cc ('k') | runtime/vm/code_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698