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

Unified Diff: runtime/vm/precompiler.cc

Issue 2246083003: AOT: Optimize even large functions. Ensures all calls are optimized static calls, switchable calls … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: . 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/object.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/precompiler.cc
diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc
index 5f0a33e75b9e94b8696e9132b8b1494175a9ec34..e919a5268b6e4d254ab12633f0d419b6dee4a02d 100644
--- a/runtime/vm/precompiler.cc
+++ b/runtime/vm/precompiler.cc
@@ -1910,13 +1910,12 @@ void Precompiler::SwitchICCalls() {
class SwitchICCallsVisitor : public FunctionVisitor {
public:
explicit SwitchICCallsVisitor(Zone* zone) :
+ zone_(zone),
code_(Code::Handle(zone)),
pool_(ObjectPool::Handle(zone)),
entry_(Object::Handle(zone)),
ic_(ICData::Handle(zone)),
- target_(Function::Handle(zone)),
- target_code_(Code::Handle(zone)),
- entry_point_(Smi::Handle(zone)) {
+ target_code_(Code::Handle(zone)) {
}
void Visit(const Function& function) {
@@ -1930,25 +1929,10 @@ void Precompiler::SwitchICCalls() {
if (pool_.InfoAt(i) != ObjectPool::kTaggedObject) continue;
entry_ = pool_.ObjectAt(i);
if (entry_.IsICData()) {
+ // The only IC calls generated by precompilation are for switchable
+ // calls.
ic_ ^= entry_.raw();
-
- if (ic_.NumArgsTested() != 1) continue;
-
- for (intptr_t j = 0; j < ic_.NumberOfChecks(); j++) {
- entry_ = ic_.GetTargetOrCodeAt(j);
- if (entry_.IsFunction()) {
- target_ ^= entry_.raw();
- ASSERT(target_.HasCode());
- target_code_ = target_.CurrentCode();
- entry_point_ =
- Smi::FromAlignedAddress(target_code_.UncheckedEntryPoint());
- ic_.SetCodeAt(j, target_code_);
- ic_.SetEntryPointAt(j, entry_point_);
- } else {
- // We've already seen and switched this ICData.
- ASSERT(entry_.IsCode());
- }
- }
+ ic_.ResetSwitchable(zone_);
} else if (entry_.raw() ==
StubCode::ICLookupThroughFunction_entry()->code()) {
target_code_ = StubCode::ICLookupThroughCode_entry()->code();
@@ -1958,13 +1942,12 @@ void Precompiler::SwitchICCalls() {
}
private:
+ Zone* zone_;
Code& code_;
ObjectPool& pool_;
Object& entry_;
ICData& ic_;
- Function& target_;
Code& target_code_;
- Smi& entry_point_;
};
ASSERT(!I->compilation_allowed());
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698