From e5fc9762f65103388cac4bab31127b3afca03b9c Mon Sep 17 00:00:00 2001 From: "erik.corry@gmail.com" Date: Wed, 25 May 2011 12:26:15 +0000 Subject: [PATCH] Add comment better explaining the calling-stubs-from-stubs issue. Review URL: http://codereview.chromium.org/7031046 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8059 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/code-stubs.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/code-stubs.h b/src/code-stubs.h index 7ab0b7c..76ea235 100644 --- a/src/code-stubs.h +++ b/src/code-stubs.h @@ -34,8 +34,7 @@ namespace v8 { namespace internal { -// List of code stubs used on all platforms. The order in this list is important -// as only the stubs up to and including Instanceof allows nested stub calls. +// List of code stubs used on all platforms. #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ V(CallFunction) \ V(UnaryOp) \ @@ -43,12 +42,17 @@ namespace internal { V(StringAdd) \ V(SubString) \ V(StringCompare) \ - V(SmiOp) \ V(Compare) \ - V(CompareIC) \ V(MathPow) \ V(TranscendentalCache) \ V(Instanceof) \ + /* All stubs above this line only exist in a few versions, which are */ \ + /* generated ahead of time. Therefore compiling a call to one of */ \ + /* them can't cause a new stub to be compiled, so compiling a call to */ \ + /* them is GC safe. The ones below this line exist in many variants */ \ + /* so code compiling a call to one can cause a GC. This means they */ \ + /* can't be called from other stubs, since stub generation code is */ \ + /* not GC safe. */ \ V(ConvertToDouble) \ V(WriteInt32ToHeapNumber) \ V(StackCheck) \ @@ -195,6 +199,7 @@ class CodeStub BASE_EMBEDDED { MajorKeyBits::encode(MajorKey()); } + // See comment above, where Instanceof is defined. bool AllowsStubCalls() { return MajorKey() <= Instanceof; } class MajorKeyBits: public BitField {}; -- 2.7.4