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

Unified Diff: src/objects-inl.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 side-by-side diff with in-line comments
Download patch
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 72dca225900ae5815fb92b106d86351aaa01b069..b5718ddaf9c660869168a0fb2b16b2357e6ca9c1 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -523,22 +523,17 @@ bool Object::IsDeoptimizationOutputData() {
bool Object::IsContext() {
if (Object::IsHeapObject()) {
- Heap* heap = HeapObject::cast(this)->GetHeap();
- return (HeapObject::cast(this)->map() == heap->context_map() ||
- HeapObject::cast(this)->map() == heap->catch_context_map() ||
- HeapObject::cast(this)->map() == heap->global_context_map());
+ Map* map = HeapObject::cast(this)->map();
+ Heap* heap = map->GetHeap();
+ return (map == heap->function_context_map() ||
+ map == heap->catch_context_map() ||
+ map == heap->with_context_map() ||
+ map == heap->global_context_map());
}
return false;
}
-bool Object::IsCatchContext() {
Kevin Millikin (Chromium) 2011/06/08 16:35:52 We only ever ask this of Contexts, so I just moved
- return Object::IsHeapObject() &&
- HeapObject::cast(this)->map() ==
- HeapObject::cast(this)->GetHeap()->catch_context_map();
-}
-
-
bool Object::IsGlobalContext() {
return Object::IsHeapObject() &&
HeapObject::cast(this)->map() ==

Powered by Google App Engine
This is Rietveld 408576698