OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 void MarkCompactCollector::Finish() { | 155 void MarkCompactCollector::Finish() { |
156 #ifdef DEBUG | 156 #ifdef DEBUG |
157 ASSERT(state_ == SWEEP_SPACES || state_ == RELOCATE_OBJECTS); | 157 ASSERT(state_ == SWEEP_SPACES || state_ == RELOCATE_OBJECTS); |
158 state_ = IDLE; | 158 state_ = IDLE; |
159 #endif | 159 #endif |
160 // The stub cache is not traversed during GC; clear the cache to | 160 // The stub cache is not traversed during GC; clear the cache to |
161 // force lazy re-initialization of it. This must be done after the | 161 // force lazy re-initialization of it. This must be done after the |
162 // GC, because it relies on the new address of certain old space | 162 // GC, because it relies on the new address of certain old space |
163 // objects (empty string, illegal builtin). | 163 // objects (empty string, illegal builtin). |
164 Isolate::Current()->stub_cache()->Clear(); | 164 heap_->isolate()->stub_cache()->Clear(); |
165 | 165 |
166 heap_->external_string_table_.CleanUp(); | 166 heap_->external_string_table_.CleanUp(); |
167 | 167 |
168 // If we've just compacted old space there's no reason to check the | 168 // If we've just compacted old space there's no reason to check the |
169 // fragmentation limit. Just return. | 169 // fragmentation limit. Just return. |
170 if (HasCompacted()) return; | 170 if (HasCompacted()) return; |
171 | 171 |
172 // We compact the old generation on the next GC if it has gotten too | 172 // We compact the old generation on the next GC if it has gotten too |
173 // fragmented (ie, we could recover an expected amount of space by | 173 // fragmented (ie, we could recover an expected amount of space by |
174 // reclaiming the waste and free list blocks). | 174 // reclaiming the waste and free list blocks). |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 | 563 |
564 inline static bool HasSourceCode(SharedFunctionInfo* info) { | 564 inline static bool HasSourceCode(SharedFunctionInfo* info) { |
565 Object* undefined = HEAP->raw_unchecked_undefined_value(); | 565 Object* undefined = HEAP->raw_unchecked_undefined_value(); |
566 return (info->script() != undefined) && | 566 return (info->script() != undefined) && |
567 (reinterpret_cast<Script*>(info->script())->source() != undefined); | 567 (reinterpret_cast<Script*>(info->script())->source() != undefined); |
568 } | 568 } |
569 | 569 |
570 | 570 |
571 inline static bool IsCompiled(JSFunction* function) { | 571 inline static bool IsCompiled(JSFunction* function) { |
572 return function->unchecked_code() != | 572 return function->unchecked_code() != |
573 Isolate::Current()->builtins()->builtin(Builtins::kLazyCompile); | 573 function->GetIsolate()->builtins()->builtin(Builtins::kLazyCompile); |
574 } | 574 } |
575 | 575 |
576 inline static bool IsCompiled(SharedFunctionInfo* function) { | 576 inline static bool IsCompiled(SharedFunctionInfo* function) { |
577 return function->unchecked_code() != | 577 return function->unchecked_code() != |
578 Isolate::Current()->builtins()->builtin(Builtins::kLazyCompile); | 578 function->GetIsolate()->builtins()->builtin(Builtins::kLazyCompile); |
579 } | 579 } |
580 | 580 |
581 inline static bool IsFlushable(JSFunction* function) { | 581 inline static bool IsFlushable(JSFunction* function) { |
582 SharedFunctionInfo* shared_info = function->unchecked_shared(); | 582 SharedFunctionInfo* shared_info = function->unchecked_shared(); |
583 | 583 |
584 // Code is either on stack, in compilation cache or referenced | 584 // Code is either on stack, in compilation cache or referenced |
585 // by optimized version of function. | 585 // by optimized version of function. |
586 if (function->unchecked_code()->IsMarked()) { | 586 if (function->unchecked_code()->IsMarked()) { |
587 shared_info->set_code_age(0); | 587 shared_info->set_code_age(0); |
588 return false; | 588 return false; |
(...skipping 2478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3067 } | 3067 } |
3068 | 3068 |
3069 | 3069 |
3070 void MarkCompactCollector::Initialize() { | 3070 void MarkCompactCollector::Initialize() { |
3071 StaticPointersToNewGenUpdatingVisitor::Initialize(); | 3071 StaticPointersToNewGenUpdatingVisitor::Initialize(); |
3072 StaticMarkingVisitor::Initialize(); | 3072 StaticMarkingVisitor::Initialize(); |
3073 } | 3073 } |
3074 | 3074 |
3075 | 3075 |
3076 } } // namespace v8::internal | 3076 } } // namespace v8::internal |
OLD | NEW |