diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-03-31 16:11:41 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-03-31 16:28:09 -0700 |
commit | 05a48b1f8e62564abb7c2fe674e3234d5861647f (patch) | |
tree | 6ffa24272e2d9efdf1dca8b30774925041e43c8a | |
parent | cfd5acf281b0c509f86b13d73c6a8dfa3ea9922c (diff) | |
download | art-05a48b1f8e62564abb7c2fe674e3234d5861647f.zip art-05a48b1f8e62564abb7c2fe674e3234d5861647f.tar.gz art-05a48b1f8e62564abb7c2fe674e3234d5861647f.tar.bz2 |
Fix stack overflow slow path error.
The frame size without spill was being passed into the slow path
instead of the spill size. This was incorrect since only the spills
will have been pushed at the point of the overflow check.
Also addressed an other comment.
Change-Id: Ic6e455122473a8f796b291d71f945bcf72788662
-rw-r--r-- | compiler/dex/quick/arm/call_arm.cc | 7 | ||||
-rw-r--r-- | runtime/gc/collector/garbage_collector.h | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/compiler/dex/quick/arm/call_arm.cc b/compiler/dex/quick/arm/call_arm.cc index 175fc06..953e04f 100644 --- a/compiler/dex/quick/arm/call_arm.cc +++ b/compiler/dex/quick/arm/call_arm.cc @@ -359,8 +359,8 @@ void ArmMir2Lir::GenEntrySequence(RegLocation* ArgLocs, RegLocation rl_method) { NewLIR1(kThumb2VPushCS, num_fp_spills_); } - // TODO: 64 bit will be different code. - const int frame_size_without_spills = frame_size_ - spill_count * 4; + const int spill_size = spill_count * 4; + const int frame_size_without_spills = frame_size_ - spill_size; if (!skip_overflow_check) { if (Runtime::Current()->ExplicitStackOverflowChecks()) { class StackOverflowSlowPath : public LIRSlowPath { @@ -392,8 +392,7 @@ void ArmMir2Lir::GenEntrySequence(RegLocation* ArgLocs, RegLocation rl_method) { OpRegRegImm(kOpSub, rs_rARM_LR, rs_rARM_SP, frame_size_without_spills); LIR* branch = OpCmpBranch(kCondUlt, rs_rARM_LR, rs_r12, nullptr); // Need to restore LR since we used it as a temp. - AddSlowPath(new(arena_)StackOverflowSlowPath(this, branch, true, - frame_size_without_spills)); + AddSlowPath(new(arena_)StackOverflowSlowPath(this, branch, true, spill_size)); OpRegCopy(rs_rARM_SP, rs_rARM_LR); // Establish stack } else { // If the frame is small enough we are guaranteed to have enough space that remains to diff --git a/runtime/gc/collector/garbage_collector.h b/runtime/gc/collector/garbage_collector.h index ccfa9cf..5b7b8a2 100644 --- a/runtime/gc/collector/garbage_collector.h +++ b/runtime/gc/collector/garbage_collector.h @@ -128,7 +128,7 @@ class GarbageCollector { // Mark all reachable objects, done concurrently. virtual void MarkingPhase() = 0; - // Only called for concurrent GCs. + // Phase of the GC which is run with mutator lock exclusively held. virtual void PausePhase(); // Called with mutators running. |