OLD | NEW |
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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 static internal::Object** Extend(); | 154 static internal::Object** Extend(); |
155 | 155 |
156 // Zaps the handles in the half-open interval [start, end). | 156 // Zaps the handles in the half-open interval [start, end). |
157 static void ZapRange(internal::Object** start, internal::Object** end); | 157 static void ZapRange(internal::Object** start, internal::Object** end); |
158 | 158 |
159 friend class v8::HandleScope; | 159 friend class v8::HandleScope; |
160 friend class v8::ImplementationUtilities; | 160 friend class v8::ImplementationUtilities; |
161 }; | 161 }; |
162 | 162 |
163 | 163 |
| 164 class CompilationInfo; |
| 165 |
| 166 // Like a regular stack-allocated HandleScope, but does not delete the |
| 167 // handles allocated in its scope on destruction. Instead, it ties |
| 168 // the Handles created in its scope with the CompilatationInfo passed |
| 169 // to its constructor. The Handles are reclaimed when the |
| 170 // CompilationInfo destructs. |
| 171 class GatheringHandleScope { |
| 172 public: |
| 173 explicit GatheringHandleScope(CompilationInfo* info); |
| 174 ~GatheringHandleScope(); |
| 175 |
| 176 private: |
| 177 CompilationInfo* info_; |
| 178 Object** prev_next_; |
| 179 Object** prev_limit_; |
| 180 }; |
| 181 |
| 182 |
164 // ---------------------------------------------------------------------------- | 183 // ---------------------------------------------------------------------------- |
165 // Handle operations. | 184 // Handle operations. |
166 // They might invoke garbage collection. The result is an handle to | 185 // They might invoke garbage collection. The result is an handle to |
167 // an object of expected type, or the handle is an error if running out | 186 // an object of expected type, or the handle is an error if running out |
168 // of space or encountering an internal error. | 187 // of space or encountering an internal error. |
169 | 188 |
170 // Flattens a string. | 189 // Flattens a string. |
171 void FlattenString(Handle<String> str); | 190 void FlattenString(Handle<String> str); |
172 | 191 |
173 // Flattens a string and returns the underlying external or sequential | 192 // Flattens a string and returns the underlying external or sequential |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 inline NoHandleAllocation(); | 312 inline NoHandleAllocation(); |
294 inline ~NoHandleAllocation(); | 313 inline ~NoHandleAllocation(); |
295 private: | 314 private: |
296 int level_; | 315 int level_; |
297 #endif | 316 #endif |
298 }; | 317 }; |
299 | 318 |
300 } } // namespace v8::internal | 319 } } // namespace v8::internal |
301 | 320 |
302 #endif // V8_HANDLES_H_ | 321 #endif // V8_HANDLES_H_ |
OLD | NEW |