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) { | 573 void Heap::SetLastScriptId(int last_script_id) { |
574 roots_[kLastScriptIdRootIndex] = last_script_id; | 574 roots_[kLastScriptIdRootIndex] = Smi::FromInt(last_script_id); |
575 } | 575 } |
576 | 576 |
577 | 577 |
578 Isolate* Heap::isolate() { | 578 Isolate* Heap::isolate() { |
579 return reinterpret_cast<Isolate*>(reinterpret_cast<intptr_t>(this) - | 579 return reinterpret_cast<Isolate*>(reinterpret_cast<intptr_t>(this) - |
580 reinterpret_cast<size_t>(reinterpret_cast<Isolate*>(4)->heap()) + 4); | 580 reinterpret_cast<size_t>(reinterpret_cast<Isolate*>(4)->heap()) + 4); |
581 } | 581 } |
582 | 582 |
583 | 583 |
584 #ifdef DEBUG | 584 #ifdef DEBUG |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 DisallowAllocationFailure::~DisallowAllocationFailure() { | 865 DisallowAllocationFailure::~DisallowAllocationFailure() { |
866 #ifdef DEBUG | 866 #ifdef DEBUG |
867 HEAP->disallow_allocation_failure_ = old_state_; | 867 HEAP->disallow_allocation_failure_ = old_state_; |
868 #endif | 868 #endif |
869 } | 869 } |
870 | 870 |
871 | 871 |
872 } } // namespace v8::internal | 872 } } // namespace v8::internal |
873 | 873 |
874 #endif // V8_HEAP_INL_H_ | 874 #endif // V8_HEAP_INL_H_ |
OLD | NEW |