| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 // Returns a JSGlobalProxy object or null. | 337 // Returns a JSGlobalProxy object or null. |
| 338 JSObject* global_proxy(); | 338 JSObject* global_proxy(); |
| 339 void set_global_proxy(JSObject* global); | 339 void set_global_proxy(JSObject* global); |
| 340 | 340 |
| 341 // The builtins object. | 341 // The builtins object. |
| 342 JSBuiltinsObject* builtins(); | 342 JSBuiltinsObject* builtins(); |
| 343 | 343 |
| 344 // Compute the native context by traversing the context chain. | 344 // Compute the native context by traversing the context chain. |
| 345 Context* native_context(); | 345 Context* native_context(); |
| 346 | 346 |
| 347 // Predicates for context types. IsNativeContext is defined on Object | 347 // Predicates for context types. IsNativeContext is also defined on Object |
| 348 // because we frequently have to know if arbitrary objects are natives | 348 // because we frequently have to know if arbitrary objects are natives |
| 349 // contexts. | 349 // contexts. |
| 350 bool IsNativeContext() { |
| 351 Map* map = this->map(); |
| 352 return map == map->GetHeap()->native_context_map(); |
| 353 } |
| 350 bool IsFunctionContext() { | 354 bool IsFunctionContext() { |
| 351 Map* map = this->map(); | 355 Map* map = this->map(); |
| 352 return map == map->GetHeap()->function_context_map(); | 356 return map == map->GetHeap()->function_context_map(); |
| 353 } | 357 } |
| 354 bool IsCatchContext() { | 358 bool IsCatchContext() { |
| 355 Map* map = this->map(); | 359 Map* map = this->map(); |
| 356 return map == map->GetHeap()->catch_context_map(); | 360 return map == map->GetHeap()->catch_context_map(); |
| 357 } | 361 } |
| 358 bool IsWithContext() { | 362 bool IsWithContext() { |
| 359 Map* map = this->map(); | 363 Map* map = this->map(); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 #ifdef DEBUG | 448 #ifdef DEBUG |
| 445 // Bootstrapping-aware type checks. | 449 // Bootstrapping-aware type checks. |
| 446 static bool IsBootstrappingOrValidParentContext(Object* object, Context* kid); | 450 static bool IsBootstrappingOrValidParentContext(Object* object, Context* kid); |
| 447 static bool IsBootstrappingOrGlobalObject(Object* object); | 451 static bool IsBootstrappingOrGlobalObject(Object* object); |
| 448 #endif | 452 #endif |
| 449 }; | 453 }; |
| 450 | 454 |
| 451 } } // namespace v8::internal | 455 } } // namespace v8::internal |
| 452 | 456 |
| 453 #endif // V8_CONTEXTS_H_ | 457 #endif // V8_CONTEXTS_H_ |
| OLD | NEW |