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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 } | 545 } |
546 | 546 |
547 | 547 |
548 bool Object::IsContext() { | 548 bool Object::IsContext() { |
549 if (Object::IsHeapObject()) { | 549 if (Object::IsHeapObject()) { |
550 Map* map = HeapObject::cast(this)->map(); | 550 Map* map = HeapObject::cast(this)->map(); |
551 Heap* heap = map->GetHeap(); | 551 Heap* heap = map->GetHeap(); |
552 return (map == heap->function_context_map() || | 552 return (map == heap->function_context_map() || |
553 map == heap->catch_context_map() || | 553 map == heap->catch_context_map() || |
554 map == heap->with_context_map() || | 554 map == heap->with_context_map() || |
555 map == heap->global_context_map()); | 555 map == heap->global_context_map() || |
| 556 map == heap->block_context_map()); |
556 } | 557 } |
557 return false; | 558 return false; |
558 } | 559 } |
559 | 560 |
560 | 561 |
561 bool Object::IsGlobalContext() { | 562 bool Object::IsGlobalContext() { |
562 return Object::IsHeapObject() && | 563 return Object::IsHeapObject() && |
563 HeapObject::cast(this)->map() == | 564 HeapObject::cast(this)->map() == |
564 HeapObject::cast(this)->GetHeap()->global_context_map(); | 565 HeapObject::cast(this)->GetHeap()->global_context_map(); |
565 } | 566 } |
566 | 567 |
567 | 568 |
| 569 bool Object::IsSerializedScopeInfo() { |
| 570 return Object::IsHeapObject() && |
| 571 HeapObject::cast(this)->map() == |
| 572 HeapObject::cast(this)->GetHeap()->serialized_scope_info_map(); |
| 573 } |
| 574 |
| 575 |
568 bool Object::IsJSFunction() { | 576 bool Object::IsJSFunction() { |
569 return Object::IsHeapObject() | 577 return Object::IsHeapObject() |
570 && HeapObject::cast(this)->map()->instance_type() == JS_FUNCTION_TYPE; | 578 && HeapObject::cast(this)->map()->instance_type() == JS_FUNCTION_TYPE; |
571 } | 579 } |
572 | 580 |
573 | 581 |
574 template <> inline bool Is<JSFunction>(Object* obj) { | 582 template <> inline bool Is<JSFunction>(Object* obj) { |
575 return obj->IsJSFunction(); | 583 return obj->IsJSFunction(); |
576 } | 584 } |
577 | 585 |
(...skipping 4028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4606 #undef WRITE_INT_FIELD | 4614 #undef WRITE_INT_FIELD |
4607 #undef READ_SHORT_FIELD | 4615 #undef READ_SHORT_FIELD |
4608 #undef WRITE_SHORT_FIELD | 4616 #undef WRITE_SHORT_FIELD |
4609 #undef READ_BYTE_FIELD | 4617 #undef READ_BYTE_FIELD |
4610 #undef WRITE_BYTE_FIELD | 4618 #undef WRITE_BYTE_FIELD |
4611 | 4619 |
4612 | 4620 |
4613 } } // namespace v8::internal | 4621 } } // namespace v8::internal |
4614 | 4622 |
4615 #endif // V8_OBJECTS_INL_H_ | 4623 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |