| Index: runtime/vm/code_patcher_ia32.cc
|
| ===================================================================
|
| --- runtime/vm/code_patcher_ia32.cc (revision 41605)
|
| +++ runtime/vm/code_patcher_ia32.cc (working copy)
|
| @@ -274,7 +274,8 @@
|
| // b8 imm32 mov EAX, immediate
|
| class EdgeCounter : public ValueObject {
|
| public:
|
| - EdgeCounter(uword pc, const Code& ignored) : end_(pc - kAdjust) {
|
| + EdgeCounter(uword pc, const Code& ignored)
|
| + : end_(pc - CodePatcher::EdgeCounterIncrementSizeInBytes()) {
|
| ASSERT(IsValid(end_));
|
| }
|
|
|
| @@ -287,15 +288,18 @@
|
| }
|
|
|
| private:
|
| + uword end_;
|
| +};
|
| +
|
| +
|
| +int32_t CodePatcher::EdgeCounterIncrementSizeInBytes() {
|
| // The edge counter load is followed by the fixed-size edge counter
|
| // incrementing code:
|
| // 83 40 0b 02 add [eax+0xb],0x2
|
| - static const intptr_t kAdjust = 4;
|
| + return 4;
|
| +}
|
|
|
| - uword end_;
|
| -};
|
|
|
| -
|
| RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) {
|
| ASSERT(code.ContainsInstructionAt(pc));
|
| EdgeCounter counter(pc, code);
|
|
|