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

Unified Diff: src/objects.cc

Issue 2957: Defer the writing of the source position data to the relocation information... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 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
« no previous file with comments | « src/debug.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
===================================================================
--- src/objects.cc (revision 330)
+++ src/objects.cc (working copy)
@@ -4147,9 +4147,19 @@
// source.
RelocIterator it(this, RelocInfo::kPositionMask);
while (!it.done()) {
- if (it.rinfo()->pc() < pc && (pc - it.rinfo()->pc()) < distance) {
- position = it.rinfo()->data();
- distance = pc - it.rinfo()->pc();
+ // Only look at positions after the current pc.
+ if (it.rinfo()->pc() < pc) {
+ // Get position and distance.
+ int dist = pc - it.rinfo()->pc();
+ int pos = it.rinfo()->data();
+ // If this position is closer than the current candidate or if it has the
+ // same distance as the current candidate and the position is higher then
+ // this position is the new candidate.
+ if ((dist < distance) ||
+ (dist == distance && pos > position)) {
+ position = pos;
+ distance = dist;
+ }
}
it.next();
}
« no previous file with comments | « src/debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698