Last Comment Bug 783030 - Profiled line number is the head of a function too frequently
: Profiled line number is the head of a function too frequently
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
-- normal (vote)
: mozilla17
Assigned To: u443197
: Jason Orendorff [:jorendorff]
Depends on:
  Show dependency treegraph
Reported: 2012-08-15 11:07 PDT by u443197
Modified: 2012-08-17 19:22 PDT (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (5.35 KB, patch)
2012-08-15 12:46 PDT, u443197
bhackett1024: review+
Details | Diff | Splinter Review

Description User image u443197 2012-08-15 11:07:49 PDT

Comment 1 User image u443197 2012-08-15 11:10:53 PDT
When SPS is enabled in the JS engine, the line number is too frequently the head of a function. This was an error on my part mishandling the case where the pc for a script is at the head of a function. The relevant changes need to be made to ProfileEntry::{pc,setPC} and the emitted instrumentation.
Comment 2 User image u443197 2012-08-15 12:46:12 PDT
Created attachment 652180 [details] [diff] [review]
Comment 3 User image Brian Hackett (:bhackett) 2012-08-17 05:02:53 PDT
Comment on attachment 652180 [details] [diff] [review]

Review of attachment 652180 [details] [diff] [review]:

::: js/src/methodjit/BaseAssembler.h
@@ +1545,5 @@
>          storePtr(ImmPtr(str),  Address(reg, ProfileEntry::offsetOfString()));
>          storePtr(ImmPtr(s),    Address(reg, ProfileEntry::offsetOfScript()));
>          storePtr(ImmPtr(NULL), Address(reg, ProfileEntry::offsetOfStackAddress()));
> +        store32(Imm32(-1),     Address(reg, ProfileEntry::offsetOfPCIdx()));

Can you make the -1 some INVALID_INDEX constant in ProfileEntry?
Comment 5 User image Ryan VanderMeulen [:RyanVM] 2012-08-17 19:22:40 PDT

Note You need to log in before you can comment on or make changes to this bug.