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

Issue 7084032: Add asserts and state tracking to ensure that we do not call (Closed)

Created:
9 years, 6 months ago by Erik Corry
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Add asserts and state tracking to ensure that we do not call into C++ without having a valid stack frame that can be traversed at GC. Also add asserts to track that we do not try to generate a stub while we are generating a stub, since the stub creation code is not GC safe. Committed: http://code.google.com/p/v8/source/detail?r=8122

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 16

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+913 lines, -541 lines) Patch
M include/v8.h View 2 chunks +5 lines, -5 lines 0 comments Download
M src/arm/builtins-arm.cc View 1 2 16 chunks +65 lines, -44 lines 0 comments Download
M src/arm/code-stubs-arm.h View 3 chunks +5 lines, -1 line 0 comments Download
M src/arm/code-stubs-arm.cc View 1 2 12 chunks +66 lines, -47 lines 0 comments Download
M src/arm/codegen-arm.cc View 1 chunk +6 lines, -2 lines 0 comments Download
M src/arm/debug-arm.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M src/arm/deoptimizer-arm.cc View 1 2 2 chunks +9 lines, -3 lines 0 comments Download
M src/arm/full-codegen-arm.cc View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M src/arm/ic-arm.cc View 2 chunks +19 lines, -17 lines 0 comments Download
M src/arm/lithium-codegen-arm.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M src/arm/macro-assembler-arm.h View 1 2 6 chunks +9 lines, -14 lines 0 comments Download
M src/arm/macro-assembler-arm.cc View 1 2 12 chunks +37 lines, -9 lines 0 comments Download
M src/arm/regexp-macro-assembler-arm.cc View 1 2 2 chunks +12 lines, -3 lines 0 comments Download
M src/arm/stub-cache-arm.cc View 4 chunks +46 lines, -42 lines 0 comments Download
M src/builtins.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/code-stubs.h View 4 chunks +13 lines, -4 lines 0 comments Download
M src/code-stubs.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M src/deoptimizer.cc View 2 chunks +5 lines, -0 lines 0 comments Download
M src/frames.h View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M src/ia32/builtins-ia32.cc View 1 2 26 chunks +70 lines, -48 lines 0 comments Download
M src/ia32/code-stubs-ia32.h View 3 chunks +5 lines, -1 line 0 comments Download
M src/ia32/code-stubs-ia32.cc View 8 chunks +47 lines, -37 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 1 chunk +6 lines, -2 lines 0 comments Download
M src/ia32/debug-ia32.cc View 3 chunks +5 lines, -4 lines 0 comments Download
M src/ia32/deoptimizer-ia32.cc View 1 2 2 chunks +9 lines, -3 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M src/ia32/ic-ia32.cc View 2 chunks +24 lines, -20 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M src/ia32/macro-assembler-ia32.h View 1 2 5 chunks +9 lines, -13 lines 0 comments Download
M src/ia32/macro-assembler-ia32.cc View 13 chunks +37 lines, -10 lines 0 comments Download
src/ia32/regexp-macro-assembler-ia32.cc View 1 2 2 chunks +12 lines, -4 lines 0 comments Download
M src/ia32/stub-cache-ia32.cc View 4 chunks +47 lines, -42 lines 0 comments Download
M src/macro-assembler.h View 1 2 1 chunk +57 lines, -0 lines 0 comments Download
M src/x64/builtins-x64.cc View 1 2 23 chunks +62 lines, -41 lines 0 comments Download
M src/x64/code-stubs-x64.h View 3 chunks +5 lines, -1 line 0 comments Download
M src/x64/code-stubs-x64.cc View 6 chunks +29 lines, -21 lines 0 comments Download
M src/x64/codegen-x64.cc View 1 chunk +6 lines, -2 lines 0 comments Download
M src/x64/debug-x64.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M src/x64/deoptimizer-x64.cc View 1 2 2 chunks +9 lines, -3 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M src/x64/ic-x64.cc View 2 chunks +21 lines, -19 lines 0 comments Download
M src/x64/lithium-codegen-x64.cc View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M src/x64/macro-assembler-x64.h View 1 2 6 chunks +10 lines, -13 lines 0 comments Download
M src/x64/macro-assembler-x64.cc View 1 2 13 chunks +37 lines, -13 lines 0 comments Download
M src/x64/regexp-macro-assembler-x64.cc View 1 2 2 chunks +14 lines, -4 lines 0 comments Download
M src/x64/stub-cache-x64.cc View 4 chunks +47 lines, -42 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Erik Corry
9 years, 6 months ago (2011-05-30 14:59:32 UTC) #1
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/7084032/diff/4004/src/arm/builtins-arm.cc File src/arm/builtins-arm.cc (right): http://codereview.chromium.org/7084032/diff/4004/src/arm/builtins-arm.cc#newcode1065 src/arm/builtins-arm.cc:1065: // Exit the JS frame and remove the ...
9 years, 6 months ago (2011-05-31 07:51:45 UTC) #2
Erik Corry
9 years, 6 months ago (2011-05-31 11:52:51 UTC) #3
http://codereview.chromium.org/7084032/diff/4004/src/arm/builtins-arm.cc
File src/arm/builtins-arm.cc (right):

http://codereview.chromium.org/7084032/diff/4004/src/arm/builtins-arm.cc#newc...
src/arm/builtins-arm.cc:1065: // Exit the JS frame and remove the parameters
(except function), and
On 2011/05/31 07:51:45, Søren Gjesse wrote:
> JS frame -> internal frame.

Done.

http://codereview.chromium.org/7084032/diff/4004/src/arm/builtins-arm.cc#newc...
src/arm/builtins-arm.cc:1135: // Tear down temporary frame.
On 2011/05/31 07:51:45, Søren Gjesse wrote:
> temporary -> internal

Done.

http://codereview.chromium.org/7084032/diff/4004/src/arm/full-codegen-arm.cc
File src/arm/full-codegen-arm.cc (right):

http://codereview.chromium.org/7084032/diff/4004/src/arm/full-codegen-arm.cc#...
src/arm/full-codegen-arm.cc:159: FrameScope frame_scope(masm_,
StackFrame::NONE);
On 2011/05/31 07:51:45, Søren Gjesse wrote:
> How about using StackFrame::JAVA_SCRIPT, and maybe place it after the __ Push
> where the frame is set up? Then a FrameScopt for StackFrame::JAVA_SCRIPT of
> cause should do nothing but mark that a frame is present.

Used StackFrame::MANUAL

http://codereview.chromium.org/7084032/diff/4004/src/arm/lithium-codegen-arm.cc
File src/arm/lithium-codegen-arm.cc (right):

http://codereview.chromium.org/7084032/diff/4004/src/arm/lithium-codegen-arm....
src/arm/lithium-codegen-arm.cc:89: FrameScope frame_scope(masm_,
StackFrame::NONE);
On 2011/05/31 07:51:45, Søren Gjesse wrote:
> StackFrame::JAVA_SCRIPT?

Done.

http://codereview.chromium.org/7084032/diff/4004/src/arm/macro-assembler-arm.h
File src/arm/macro-assembler-arm.h (right):

http://codereview.chromium.org/7084032/diff/4004/src/arm/macro-assembler-arm....
src/arm/macro-assembler-arm.h:1063: 
On 2011/05/31 07:51:45, Søren Gjesse wrote:
> Can these two classes be in platform independent macro-assembler.h?

Done.

http://codereview.chromium.org/7084032/diff/4004/src/arm/regexp-macro-assembl...
File src/arm/regexp-macro-assembler-arm.cc (right):

http://codereview.chromium.org/7084032/diff/4004/src/arm/regexp-macro-assembl...
src/arm/regexp-macro-assembler-arm.cc:380: __ CallCFunction(function,
argument_count);
On 2011/05/31 07:51:45, Søren Gjesse wrote:
> How about having CallCFunctionWithoutFrame or CallCFunctionNotCausingGC
instead?
> Then the comment is not needed.

This turns out to be messy because there are lots and lots of CallCFunction
variants.  Instead I introduced a new scoped variable called
AllowExternalCallThatCantCauseGC.  I am hoping with a name like that I don't
need a comment.

http://codereview.chromium.org/7084032/diff/4004/src/builtins.cc
File src/builtins.cc (right):

http://codereview.chromium.org/7084032/diff/4004/src/builtins.cc#newcode1620
src/builtins.cc:1620: NoCurrentFrameScope scope(&masm);
On 2011/05/31 07:51:45, Søren Gjesse wrote:
> This might deserve a comment.

Replaced with an assert that there is no current frame.

http://codereview.chromium.org/7084032/diff/4004/src/ia32/builtins-ia32.cc
File src/ia32/builtins-ia32.cc (right):

http://codereview.chromium.org/7084032/diff/4004/src/ia32/builtins-ia32.cc#ne...
src/ia32/builtins-ia32.cc:466: __ ret(1 * kPointerSize);  // Remove receiver.
On 2011/05/31 07:51:45, Søren Gjesse wrote:
> Maybe remove 1 * while you are here.

Done.

Powered by Google App Engine
This is Rietveld 408576698