OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 // Tells whether the global context is marked with out of memory. | 257 // Tells whether the global context is marked with out of memory. |
258 bool has_out_of_memory() { | 258 bool has_out_of_memory() { |
259 return global_context()->out_of_memory() == Heap::true_value(); | 259 return global_context()->out_of_memory() == Heap::true_value(); |
260 } | 260 } |
261 | 261 |
262 // Mark the global context with out of memory. | 262 // Mark the global context with out of memory. |
263 void mark_out_of_memory() { | 263 void mark_out_of_memory() { |
264 global_context()->set_out_of_memory(Heap::true_value()); | 264 global_context()->set_out_of_memory(Heap::true_value()); |
265 } | 265 } |
266 | 266 |
| 267 // The exception holder is the object used as a with object in |
| 268 // the implementation of a catch block. |
| 269 bool is_exception_holder(Object* object) { |
| 270 return IsCatchContext() && extension() == object; |
| 271 } |
| 272 |
267 #define GLOBAL_CONTEXT_FIELD_ACCESSORS(index, type, name) \ | 273 #define GLOBAL_CONTEXT_FIELD_ACCESSORS(index, type, name) \ |
268 void set_##name(type* value) { \ | 274 void set_##name(type* value) { \ |
269 ASSERT(IsGlobalContext()); \ | 275 ASSERT(IsGlobalContext()); \ |
270 set(index, value); \ | 276 set(index, value); \ |
271 } \ | 277 } \ |
272 type* name() { \ | 278 type* name() { \ |
273 ASSERT(IsGlobalContext()); \ | 279 ASSERT(IsGlobalContext()); \ |
274 return type::cast(get(index)); \ | 280 return type::cast(get(index)); \ |
275 } | 281 } |
276 GLOBAL_CONTEXT_FIELDS(GLOBAL_CONTEXT_FIELD_ACCESSORS) | 282 GLOBAL_CONTEXT_FIELDS(GLOBAL_CONTEXT_FIELD_ACCESSORS) |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 #ifdef DEBUG | 319 #ifdef DEBUG |
314 // Bootstrapping-aware type checks. | 320 // Bootstrapping-aware type checks. |
315 static bool IsBootstrappingOrContext(Object* object); | 321 static bool IsBootstrappingOrContext(Object* object); |
316 static bool IsBootstrappingOrGlobalObject(Object* object); | 322 static bool IsBootstrappingOrGlobalObject(Object* object); |
317 #endif | 323 #endif |
318 }; | 324 }; |
319 | 325 |
320 } } // namespace v8::internal | 326 } } // namespace v8::internal |
321 | 327 |
322 #endif // V8_CONTEXTS_H_ | 328 #endif // V8_CONTEXTS_H_ |
OLD | NEW |