Closed
Bug 407894
Opened 18 years ago
Closed 16 years ago
MAc timer returns values that are a power of 2
Categories
(Tamarin Graveyard :: Virtual Machine, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: brbaker, Assigned: treilly)
Details
(Keywords: flashplayer)
Attachments
(4 files, 1 obsolete file)
1.65 KB,
application/octet-stream
|
Details | |
1.19 KB,
application/octet-stream
|
Details | |
748 bytes,
patch
|
stejohns
:
review+
|
Details | Diff | Splinter Review |
1.66 KB,
patch
|
edwsmith
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
Build Identifier:
Calling getTimer() on mac will only return values that are a power of 2.
Reproducible: Always
Steps to Reproduce:
1. ./shell test.abc
Actual Results:
The timer values that will be printed will start at zero and then after a couple of zeros it will be 2048, and depending on the speed of the machine may make it to 4096.
Expected Results:
Printed timer values should be real.
Reporter | ||
Comment 1•18 years ago
|
||
Reporter | ||
Comment 2•18 years ago
|
||
Assignee | ||
Updated•18 years ago
|
Assignee: nobody → treilly
Assignee | ||
Comment 3•18 years ago
|
||
Assignee | ||
Updated•18 years ago
|
Attachment #293543 -
Flags: review?(stejohns)
Updated•18 years ago
|
Attachment #293543 -
Flags: review?(stejohns) → review+
Assignee | ||
Updated•18 years ago
|
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Reporter | ||
Updated•18 years ago
|
Status: RESOLVED → VERIFIED
Reporter | ||
Comment 4•17 years ago
|
||
A testcase should be added that will basically check that the result from the getTimer() is not always a value that is a power of 2.
Reporter | ||
Comment 5•16 years ago
|
||
Attachment #367020 -
Flags: review?(dschaffe)
Comment 6•16 years ago
|
||
Comment on attachment 367020 [details] [diff] [review]
Acceptance testcase
this test could easily return false 10 times on a fast system with a sufficiently coarse timer.
Attachment #367020 -
Flags: review-
Reporter | ||
Comment 7•16 years ago
|
||
Changed code to keep checking the timer until there is a new value and make sure that the 2 values are not a power of 2. If the values are equal a load loop is run (to take up time). The load loop is tuned to the machine by increasing its load until the timers are different. Then this load factor is what is used for subsequent loops. This should make sure that enough work is happening on fast machines and not too much on slow machines.
Attachment #367020 -
Attachment is obsolete: true
Attachment #367075 -
Flags: review?(edwsmith)
Attachment #367020 -
Flags: review?(dschaffe)
Comment 8•16 years ago
|
||
Comment on attachment 367075 [details] [diff] [review]
testcase v2
btw, Math.pow(sleeper,2) is overkill, sleeper *= sleeper would be the same. but check this out: you're squaring sleeper, which will grow super fast (2, 4, 16, 256, 64k, 4B) -- the last two steps are so far apart, in the off chance you get to 64k, the next one will hang or wraparound (wrap around, i guess, with signed int math). the timer will be stable with a "just" exponential curve:
(sleeper <<= 2).
Attachment #367075 -
Flags: review?(edwsmith)
Attachment #367075 -
Flags: review?
Attachment #367075 -
Flags: review+
Updated•16 years ago
|
Attachment #367075 -
Flags: review?
Reporter | ||
Comment 9•16 years ago
|
||
Pushed testcase as 1620:7a6b74ed85a0
Status: VERIFIED → RESOLVED
Closed: 18 years ago → 16 years ago
Flags: in-testsuite? → in-testsuite+
Reporter | ||
Updated•16 years ago
|
Status: RESOLVED → VERIFIED
Reporter | ||
Comment 10•16 years ago
|
||
removing QRB request, bug resolved/verified
Flags: flashplayer-qrb?
You need to log in
before you can comment on or make changes to this bug.
Description
•