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

Side by Side Diff: src/code-stubs.h

Issue 7031046: Add comment better explaining the calling-stubs-from-stubs issue. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 16 matching lines...) Expand all
27 27
28 #ifndef V8_CODE_STUBS_H_ 28 #ifndef V8_CODE_STUBS_H_
29 #define V8_CODE_STUBS_H_ 29 #define V8_CODE_STUBS_H_
30 30
31 #include "allocation.h" 31 #include "allocation.h"
32 #include "globals.h" 32 #include "globals.h"
33 33
34 namespace v8 { 34 namespace v8 {
35 namespace internal { 35 namespace internal {
36 36
37 // List of code stubs used on all platforms. The order in this list is important 37 // List of code stubs used on all platforms.
38 // as only the stubs up to and including Instanceof allows nested stub calls.
39 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ 38 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \
40 V(CallFunction) \ 39 V(CallFunction) \
41 V(UnaryOp) \ 40 V(UnaryOp) \
42 V(BinaryOp) \ 41 V(BinaryOp) \
43 V(StringAdd) \ 42 V(StringAdd) \
44 V(SubString) \ 43 V(SubString) \
45 V(StringCompare) \ 44 V(StringCompare) \
46 V(SmiOp) \
47 V(Compare) \ 45 V(Compare) \
48 V(CompareIC) \
49 V(MathPow) \ 46 V(MathPow) \
50 V(TranscendentalCache) \ 47 V(TranscendentalCache) \
51 V(Instanceof) \ 48 V(Instanceof) \
49 /* All stubs above this line only exist in a few versions, which are */ \
50 /* generated ahead of time. Therefore inserting a call to one of */ \
Kevin Millikin (Chromium) 2011/05/25 12:22:29 Maybe less ambiguous: "inserting" --> "compiling",
Erik Corry 2011/05/25 12:51:06 Done.
51 /* them can't cause a new stub to be compiled, so inserting a call to*/ \
52 /* them is GC safe. The ones below this line exist in many variants */ \
53 /* so code generating a call to one can cause a GC. This means they */ \
54 /* can't be called from other stubs, since stub generation code is */ \
55 /* not GC safe. */ \
52 V(ConvertToDouble) \ 56 V(ConvertToDouble) \
53 V(WriteInt32ToHeapNumber) \ 57 V(WriteInt32ToHeapNumber) \
54 V(StackCheck) \ 58 V(StackCheck) \
55 V(FastNewClosure) \ 59 V(FastNewClosure) \
56 V(FastNewContext) \ 60 V(FastNewContext) \
57 V(FastCloneShallowArray) \ 61 V(FastCloneShallowArray) \
58 V(RevertToNumber) \ 62 V(RevertToNumber) \
59 V(ToBoolean) \ 63 V(ToBoolean) \
60 V(ToNumber) \ 64 V(ToNumber) \
61 V(CounterOp) \ 65 V(CounterOp) \
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 virtual void Print() { PrintF("%s\n", GetName()); } 192 virtual void Print() { PrintF("%s\n", GetName()); }
189 #endif 193 #endif
190 194
191 // Computes the key based on major and minor. 195 // Computes the key based on major and minor.
192 uint32_t GetKey() { 196 uint32_t GetKey() {
193 ASSERT(static_cast<int>(MajorKey()) < NUMBER_OF_IDS); 197 ASSERT(static_cast<int>(MajorKey()) < NUMBER_OF_IDS);
194 return MinorKeyBits::encode(MinorKey()) | 198 return MinorKeyBits::encode(MinorKey()) |
195 MajorKeyBits::encode(MajorKey()); 199 MajorKeyBits::encode(MajorKey());
196 } 200 }
197 201
202 // See comment above, where Instanceof is defined.
198 bool AllowsStubCalls() { return MajorKey() <= Instanceof; } 203 bool AllowsStubCalls() { return MajorKey() <= Instanceof; }
199 204
200 class MajorKeyBits: public BitField<uint32_t, 0, kMajorBits> {}; 205 class MajorKeyBits: public BitField<uint32_t, 0, kMajorBits> {};
201 class MinorKeyBits: public BitField<uint32_t, kMajorBits, kMinorBits> {}; 206 class MinorKeyBits: public BitField<uint32_t, kMajorBits, kMinorBits> {};
202 207
203 friend class BreakPointIterator; 208 friend class BreakPointIterator;
204 }; 209 };
205 210
206 211
207 // Helper interface to prepare to/restore after making runtime calls. 212 // Helper interface to prepare to/restore after making runtime calls.
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 DECLARE_ARRAY_STUB_PRINT(KeyedStoreExternalArrayStub) 1007 DECLARE_ARRAY_STUB_PRINT(KeyedStoreExternalArrayStub)
1003 1008
1004 protected: 1009 protected:
1005 ExternalArrayType array_type_; 1010 ExternalArrayType array_type_;
1006 }; 1011 };
1007 1012
1008 1013
1009 } } // namespace v8::internal 1014 } } // namespace v8::internal
1010 1015
1011 #endif // V8_CODE_STUBS_H_ 1016 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698