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

Unified Diff: runtime/vm/instructions_arm64.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/instructions_arm64.h ('k') | runtime/vm/instructions_arm64_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/instructions_arm64.cc
diff --git a/runtime/vm/instructions_arm64.cc b/runtime/vm/instructions_arm64.cc
index 99c57ba12cfc4809f38166551c2abeb83aa24838..60ef9bff42f0c82bc1dc047ca303aaa3c83fbda0 100644
--- a/runtime/vm/instructions_arm64.cc
+++ b/runtime/vm/instructions_arm64.cc
@@ -359,40 +359,45 @@ void CallPattern::InsertDeoptCallAt(uword pc, uword target_address) {
SwitchableCallPattern::SwitchableCallPattern(uword pc, const Code& code)
: object_pool_(ObjectPool::Handle(code.GetObjectPool())),
- cache_pool_index_(-1),
- stub_pool_index_(-1) {
+ data_pool_index_(-1),
+ target_pool_index_(-1) {
ASSERT(code.ContainsInstructionAt(pc));
- // Last instruction: blr r1.
- ASSERT(*(reinterpret_cast<uint32_t*>(pc) - 1) == 0xd63f0020);
+ // Last instruction: blr ip0.
+ ASSERT(*(reinterpret_cast<uint32_t*>(pc) - 1) == 0xd63f0200);
Register reg;
uword stub_load_end =
- InstructionPattern::DecodeLoadWordFromPool(pc - 3 * Instr::kInstrSize,
+ InstructionPattern::DecodeLoadWordFromPool(pc - 2 * Instr::kInstrSize,
&reg,
- &stub_pool_index_);
+ &target_pool_index_);
ASSERT(reg == CODE_REG);
InstructionPattern::DecodeLoadWordFromPool(stub_load_end,
&reg,
- &cache_pool_index_);
+ &data_pool_index_);
ASSERT(reg == R5);
}
-RawObject* SwitchableCallPattern::cache() const {
+RawObject* SwitchableCallPattern::data() const {
+ return object_pool_.ObjectAt(data_pool_index_);
+}
+
+
+RawCode* SwitchableCallPattern::target() const {
return reinterpret_cast<RawCode*>(
- object_pool_.ObjectAt(cache_pool_index_));
+ object_pool_.ObjectAt(target_pool_index_));
}
-void SwitchableCallPattern::SetCache(const MegamorphicCache& cache) const {
- ASSERT(Object::Handle(object_pool_.ObjectAt(cache_pool_index_)).IsICData());
- object_pool_.SetObjectAt(cache_pool_index_, cache);
+void SwitchableCallPattern::SetData(const Object& data) const {
+ ASSERT(!Object::Handle(object_pool_.ObjectAt(data_pool_index_)).IsCode());
+ object_pool_.SetObjectAt(data_pool_index_, data);
}
-void SwitchableCallPattern::SetLookupStub(const Code& lookup_stub) const {
- ASSERT(Object::Handle(object_pool_.ObjectAt(stub_pool_index_)).IsCode());
- object_pool_.SetObjectAt(stub_pool_index_, lookup_stub);
+void SwitchableCallPattern::SetTarget(const Code& target) const {
+ ASSERT(Object::Handle(object_pool_.ObjectAt(target_pool_index_)).IsCode());
+ object_pool_.SetObjectAt(target_pool_index_, target);
}
« no previous file with comments | « runtime/vm/instructions_arm64.h ('k') | runtime/vm/instructions_arm64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698