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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 change_in_bytes / KB, | 563 change_in_bytes / KB, |
564 amount_of_external_allocated_memory_ / KB, | 564 amount_of_external_allocated_memory_ / KB, |
565 PromotedExternalMemorySize() / KB, | 565 PromotedExternalMemorySize() / KB, |
566 reinterpret_cast<intptr_t>(isolate())); | 566 reinterpret_cast<intptr_t>(isolate())); |
567 } | 567 } |
568 ASSERT(amount_of_external_allocated_memory_ >= 0); | 568 ASSERT(amount_of_external_allocated_memory_ >= 0); |
569 return amount_of_external_allocated_memory_; | 569 return amount_of_external_allocated_memory_; |
570 } | 570 } |
571 | 571 |
572 | 572 |
573 void Heap::SetLastScriptId(Object* last_script_id) { | |
574 roots_[kLastScriptIdRootIndex] = last_script_id; | |
575 } | |
576 | |
577 | |
578 Isolate* Heap::isolate() { | 573 Isolate* Heap::isolate() { |
579 return reinterpret_cast<Isolate*>(reinterpret_cast<intptr_t>(this) - | 574 return reinterpret_cast<Isolate*>(reinterpret_cast<intptr_t>(this) - |
580 reinterpret_cast<size_t>(reinterpret_cast<Isolate*>(4)->heap()) + 4); | 575 reinterpret_cast<size_t>(reinterpret_cast<Isolate*>(4)->heap()) + 4); |
581 } | 576 } |
582 | 577 |
583 | 578 |
584 #ifdef DEBUG | 579 #ifdef DEBUG |
585 #define GC_GREEDY_CHECK() \ | 580 #define GC_GREEDY_CHECK() \ |
586 if (FLAG_gc_greedy) HEAP->GarbageCollectionGreedyCheck() | 581 if (FLAG_gc_greedy) HEAP->GarbageCollectionGreedyCheck() |
587 #else | 582 #else |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 DisallowAllocationFailure::~DisallowAllocationFailure() { | 860 DisallowAllocationFailure::~DisallowAllocationFailure() { |
866 #ifdef DEBUG | 861 #ifdef DEBUG |
867 HEAP->disallow_allocation_failure_ = old_state_; | 862 HEAP->disallow_allocation_failure_ = old_state_; |
868 #endif | 863 #endif |
869 } | 864 } |
870 | 865 |
871 | 866 |
872 } } // namespace v8::internal | 867 } } // namespace v8::internal |
873 | 868 |
874 #endif // V8_HEAP_INL_H_ | 869 #endif // V8_HEAP_INL_H_ |
OLD | NEW |