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

Issue 14483: Fix issue 142 (Closed)

Created:
12 years ago by iposva
Modified:
9 years, 4 months ago
Reviewers:
Erik Corry
CC:
v8-dev
Visibility:
Public.

Description

Fix issue 142: - Removed the potential for a NULL pointer access in ContextSwitcher::PreemptionReceived. - Removed a leak of the semaphore in the ContexSwitcher thread, by removing the need for this semaphore entirely. - Added a regression test case which will catch accesses to the ContextSwitcher singleton after it has been stopped. Committed: http://code.google.com/p/v8/source/detail?r=994

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+81 lines, -33 lines) Patch
M src/v8threads.h View 1 1 chunk +16 lines, -4 lines 6 comments Download
M src/v8threads.cc View 1 chunk +30 lines, -28 lines 2 comments Download
M test/cctest/SConscript View 1 chunk +1 line, -1 line 0 comments Download
A test/cctest/test-threads.cc View 1 1 chunk +34 lines, -0 lines 2 comments Download

Messages

Total messages: 3 (0 generated)
iposva
12 years ago (2008-12-16 22:37:24 UTC) #1
Erik Corry
LGTM. We still need some better tests. http://codereview.chromium.org/14483/diff/12/15 File src/v8threads.cc (right): http://codereview.chromium.org/14483/diff/12/15#newcode310 Line 310: singleton_ ...
12 years ago (2008-12-17 14:30:07 UTC) #2
iposva
12 years ago (2008-12-17 17:39:24 UTC) #3
I agree that we need more tests. By adding this new cctest file we now have a
place where they can go.

-Ivan

http://codereview.chromium.org/14483/diff/12/15
File src/v8threads.cc (right):

http://codereview.chromium.org/14483/diff/12/15#newcode310
Line 310: singleton_ = NULL;
On 2008/12/17 14:30:07, Erik Corry wrote:
> Perhaps here we should clear a pending preemption.  It might be confusing to
> have it discovered after this point?

I disagree. To the running thread a pending preemption will appear like a
spurious interrupt, the thread has to be able to handle that anyway. Also you
would need to iterate through all the threads clearing all pending interrupts.

http://codereview.chromium.org/14483/diff/12/16
File src/v8threads.h (right):

http://codereview.chromium.org/14483/diff/12/16#newcode91
Line 91: // multiple running V8 threads. Generally it is needed to call
StartPreemption
On 2008/12/17 14:30:07, Erik Corry wrote:
> "it is necessary"

Done.

http://codereview.chromium.org/14483/diff/12/16#newcode92
Line 92: // if there is more than one thread running. If not a single JavaScript
can
On 2008/12/17 14:30:07, Erik Corry wrote:
> "If not, a single JavaScript thread can"

Done.

http://codereview.chromium.org/14483/diff/12/16#newcode102
Line 102: // Preempted thread needs to calls back to the ContextSwitcher to
acknowlege
On 2008/12/17 14:30:07, Erik Corry wrote:
> "to call back"

Done.

http://codereview.chromium.org/14483/diff/12/13
File test/cctest/test-threads.cc (right):

http://codereview.chromium.org/14483/diff/12/13#newcode3
Line 3: // Check that we can traverse very deep stacks of ConsStrings using
On 2008/12/17 14:30:07, Erik Corry wrote:
> Stale comment (should be replaced with copyright boilerplate)

Done.

Powered by Google App Engine
This is Rietveld 408576698