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

Side by Side Diff: src/contexts.h

Issue 7003058: A collection of context-related refactoring changes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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
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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 // Returns a JSGlobalProxy object or null. 282 // Returns a JSGlobalProxy object or null.
283 JSObject* global_proxy(); 283 JSObject* global_proxy();
284 void set_global_proxy(JSObject* global); 284 void set_global_proxy(JSObject* global);
285 285
286 // The builtins object. 286 // The builtins object.
287 JSBuiltinsObject* builtins(); 287 JSBuiltinsObject* builtins();
288 288
289 // Compute the global context by traversing the context chain. 289 // Compute the global context by traversing the context chain.
290 Context* global_context(); 290 Context* global_context();
291 291
292 // Tells if this is a function context (as opposed to a 'with' context). 292 // Predicates for context types. IsGlobalContext is defined on Object
293 bool is_function_context() { return unchecked_previous() == NULL; } 293 // because we frequently have to know if arbitrary objects are global
Kevin Millikin (Chromium) 2011/06/08 16:35:52 I plan on next using previous() for context iterat
294 // contexts.
295 bool IsFunctionContext() {
296 Map* map = this->map();
297 return map == map->GetHeap()->function_context_map();
298 }
299 bool IsCatchContext() {
300 Map* map = this->map();
301 return map == map->GetHeap()->catch_context_map();
302 }
294 303
295 // Tells whether the global context is marked with out of memory. 304 // Tells whether the global context is marked with out of memory.
296 inline bool has_out_of_memory(); 305 inline bool has_out_of_memory();
297 306
298 // Mark the global context with out of memory. 307 // Mark the global context with out of memory.
299 inline void mark_out_of_memory(); 308 inline void mark_out_of_memory();
300 309
301 // The exception holder is the object used as a with object in 310 // The exception holder is the object used as a with object in
302 // the implementation of a catch block. 311 // the implementation of a catch block.
303 bool is_exception_holder(Object* object) { 312 bool is_exception_holder(Object* object) {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 #ifdef DEBUG 393 #ifdef DEBUG
385 // Bootstrapping-aware type checks. 394 // Bootstrapping-aware type checks.
386 static bool IsBootstrappingOrContext(Object* object); 395 static bool IsBootstrappingOrContext(Object* object);
387 static bool IsBootstrappingOrGlobalObject(Object* object); 396 static bool IsBootstrappingOrGlobalObject(Object* object);
388 #endif 397 #endif
389 }; 398 };
390 399
391 } } // namespace v8::internal 400 } } // namespace v8::internal
392 401
393 #endif // V8_CONTEXTS_H_ 402 #endif // V8_CONTEXTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698