Changeset 53400 in webkit for trunk/JavaScriptCore/bytecode/CodeBlock.h
- Timestamp:
- Jan 18, 2010, 4:14:49 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecode/CodeBlock.h
r53391 r53400 111 111 CodeLocationDataLabelPtr hotPathBegin; 112 112 CodeLocationNearCall hotPathOther; 113 CodeBlock*ownerCodeBlock;113 PtrAndFlags<CodeBlock, HasSeenShouldRepatch> ownerCodeBlock; 114 114 CodeBlock* callee; 115 unsigned position : 31; 116 unsigned hasSeenShouldRepatch : 1; 115 unsigned position; 117 116 118 117 void setUnlinked() { callee = 0; } … … 121 120 bool seenOnce() 122 121 { 123 return hasSeenShouldRepatch;122 return ownerCodeBlock.isFlagSet(hasSeenShouldRepatch); 124 123 } 125 124 126 125 void setSeen() 127 126 { 128 hasSeenShouldRepatch = true; 129 } 130 }; 131 132 #define MethodCallLinkInfo_seenFlag ((Structure*)1) 127 ownerCodeBlock.setFlag(hasSeenShouldRepatch); 128 } 129 }; 133 130 134 131 struct MethodCallLinkInfo { 135 132 MethodCallLinkInfo() 136 133 : cachedStructure(0) 137 , cachedPrototypeStructure(0)138 134 { 139 135 } … … 141 137 bool seenOnce() 142 138 { 143 ASSERT(!cachedStructure); 144 return cachedPrototypeStructure; 139 return cachedPrototypeStructure.isFlagSet(hasSeenShouldRepatch); 145 140 } 146 141 147 142 void setSeen() 148 143 { 149 ASSERT(!cachedStructure && !cachedPrototypeStructure); 150 // We use the values of cachedStructure & cachedPrototypeStructure to indicate the 151 // current state. 152 // - In the initial state, both are null. 153 // - Once this transition has been taken once, cachedStructure is 154 // null and cachedPrototypeStructure is set to a nun-null value. 155 // - Once the call is linked both structures are set to non-null values. 156 cachedPrototypeStructure = MethodCallLinkInfo_seenFlag; 144 cachedPrototypeStructure.setFlag(hasSeenShouldRepatch); 157 145 } 158 146 … … 160 148 CodeLocationDataLabelPtr structureLabel; 161 149 Structure* cachedStructure; 162 Structure*cachedPrototypeStructure;150 PtrAndFlags<Structure, HasSeenShouldRepatch> cachedPrototypeStructure; 163 151 }; 164 152
Note:
See TracChangeset
for help on using the changeset viewer.