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

Unified Diff: runtime/vm/code_patcher_ia32.cc

Issue 1343383003: VM: Store edge counters in one per-function array. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: clean up comments, save space in IL Instruction class. Created 5 years, 3 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
Index: runtime/vm/code_patcher_ia32.cc
diff --git a/runtime/vm/code_patcher_ia32.cc b/runtime/vm/code_patcher_ia32.cc
index 95d64e08e59c73a8175017f3b67af494df5627e5..b2369bcc9748079bb95b10f4010e34dcf6b10bdc 100644
--- a/runtime/vm/code_patcher_ia32.cc
+++ b/runtime/vm/code_patcher_ia32.cc
@@ -260,35 +260,6 @@ intptr_t CodePatcher::InstanceCallSizeInBytes() {
return InstanceCall::kNumInstructions * InstanceCall::kInstructionSize;
}
-
-// The expected code pattern of an edge counter in unoptimized code:
-// b8 imm32 mov EAX, immediate
-class EdgeCounter : public ValueObject {
- public:
- EdgeCounter(uword pc, const Code& ignored)
- : end_(pc - FlowGraphCompiler::EdgeCounterIncrementSizeInBytes()) {
- ASSERT(IsValid(end_));
- }
-
- static bool IsValid(uword end) {
- return (*reinterpret_cast<uint8_t*>(end - 5) == 0xb8);
- }
-
- RawObject* edge_counter() const {
- return *reinterpret_cast<RawObject**>(end_ - 4);
- }
-
- private:
- uword end_;
-};
-
-
-RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) {
- ASSERT(code.ContainsInstructionAt(pc));
- EdgeCounter counter(pc, code);
- return counter.edge_counter();
-}
-
} // namespace dart
#endif // defined TARGET_ARCH_IA32

Powered by Google App Engine
This is Rietveld 408576698