| 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 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); | 1020 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); |
| 1021 next_gc_likely_to_collect_more = | 1021 next_gc_likely_to_collect_more = |
| 1022 isolate_->global_handles()->PostGarbageCollectionProcessing( | 1022 isolate_->global_handles()->PostGarbageCollectionProcessing( |
| 1023 collector, tracer); | 1023 collector, tracer); |
| 1024 } | 1024 } |
| 1025 gc_post_processing_depth_--; | 1025 gc_post_processing_depth_--; |
| 1026 | 1026 |
| 1027 isolate_->eternal_handles()->PostGarbageCollectionProcessing(this); | 1027 isolate_->eternal_handles()->PostGarbageCollectionProcessing(this); |
| 1028 | 1028 |
| 1029 // Update relocatables. | 1029 // Update relocatables. |
| 1030 Relocatable::PostGarbageCollectionProcessing(); | 1030 Relocatable::PostGarbageCollectionProcessing(isolate_); |
| 1031 | 1031 |
| 1032 if (collector == MARK_COMPACTOR) { | 1032 if (collector == MARK_COMPACTOR) { |
| 1033 // Register the amount of external allocated memory. | 1033 // Register the amount of external allocated memory. |
| 1034 amount_of_external_allocated_memory_at_last_global_gc_ = | 1034 amount_of_external_allocated_memory_at_last_global_gc_ = |
| 1035 amount_of_external_allocated_memory_; | 1035 amount_of_external_allocated_memory_; |
| 1036 } | 1036 } |
| 1037 | 1037 |
| 1038 { | 1038 { |
| 1039 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); | 1039 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); |
| 1040 VMState<EXTERNAL> state(isolate_); | 1040 VMState<EXTERNAL> state(isolate_); |
| (...skipping 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2931 } | 2931 } |
| 2932 | 2932 |
| 2933 | 2933 |
| 2934 MaybeObject* Heap::CreateOddball(const char* to_string, | 2934 MaybeObject* Heap::CreateOddball(const char* to_string, |
| 2935 Object* to_number, | 2935 Object* to_number, |
| 2936 byte kind) { | 2936 byte kind) { |
| 2937 Object* result; | 2937 Object* result; |
| 2938 { MaybeObject* maybe_result = Allocate(oddball_map(), OLD_POINTER_SPACE); | 2938 { MaybeObject* maybe_result = Allocate(oddball_map(), OLD_POINTER_SPACE); |
| 2939 if (!maybe_result->ToObject(&result)) return maybe_result; | 2939 if (!maybe_result->ToObject(&result)) return maybe_result; |
| 2940 } | 2940 } |
| 2941 return Oddball::cast(result)->Initialize(to_string, to_number, kind); | 2941 return Oddball::cast(result)->Initialize(this, to_string, to_number, kind); |
| 2942 } | 2942 } |
| 2943 | 2943 |
| 2944 | 2944 |
| 2945 bool Heap::CreateApiObjects() { | 2945 bool Heap::CreateApiObjects() { |
| 2946 Object* obj; | 2946 Object* obj; |
| 2947 | 2947 |
| 2948 { MaybeObject* maybe_obj = AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); | 2948 { MaybeObject* maybe_obj = AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
| 2949 if (!maybe_obj->ToObject(&obj)) return false; | 2949 if (!maybe_obj->ToObject(&obj)) return false; |
| 2950 } | 2950 } |
| 2951 // Don't use Smi-only elements optimizations for objects with the neander | 2951 // Don't use Smi-only elements optimizations for objects with the neander |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3035 // Allocate initial string table. | 3035 // Allocate initial string table. |
| 3036 { MaybeObject* maybe_obj = | 3036 { MaybeObject* maybe_obj = |
| 3037 StringTable::Allocate(this, kInitialStringTableSize); | 3037 StringTable::Allocate(this, kInitialStringTableSize); |
| 3038 if (!maybe_obj->ToObject(&obj)) return false; | 3038 if (!maybe_obj->ToObject(&obj)) return false; |
| 3039 } | 3039 } |
| 3040 // Don't use set_string_table() due to asserts. | 3040 // Don't use set_string_table() due to asserts. |
| 3041 roots_[kStringTableRootIndex] = obj; | 3041 roots_[kStringTableRootIndex] = obj; |
| 3042 | 3042 |
| 3043 // Finish initializing oddballs after creating the string table. | 3043 // Finish initializing oddballs after creating the string table. |
| 3044 { MaybeObject* maybe_obj = | 3044 { MaybeObject* maybe_obj = |
| 3045 undefined_value()->Initialize("undefined", | 3045 undefined_value()->Initialize(this, |
| 3046 "undefined", |
| 3046 nan_value(), | 3047 nan_value(), |
| 3047 Oddball::kUndefined); | 3048 Oddball::kUndefined); |
| 3048 if (!maybe_obj->ToObject(&obj)) return false; | 3049 if (!maybe_obj->ToObject(&obj)) return false; |
| 3049 } | 3050 } |
| 3050 | 3051 |
| 3051 // Initialize the null_value. | 3052 // Initialize the null_value. |
| 3052 { MaybeObject* maybe_obj = | 3053 { MaybeObject* maybe_obj = null_value()->Initialize( |
| 3053 null_value()->Initialize("null", Smi::FromInt(0), Oddball::kNull); | 3054 this, "null", Smi::FromInt(0), Oddball::kNull); |
| 3054 if (!maybe_obj->ToObject(&obj)) return false; | 3055 if (!maybe_obj->ToObject(&obj)) return false; |
| 3055 } | 3056 } |
| 3056 | 3057 |
| 3057 { MaybeObject* maybe_obj = CreateOddball("true", | 3058 { MaybeObject* maybe_obj = CreateOddball("true", |
| 3058 Smi::FromInt(1), | 3059 Smi::FromInt(1), |
| 3059 Oddball::kTrue); | 3060 Oddball::kTrue); |
| 3060 if (!maybe_obj->ToObject(&obj)) return false; | 3061 if (!maybe_obj->ToObject(&obj)) return false; |
| 3061 } | 3062 } |
| 3062 set_true_value(Oddball::cast(obj)); | 3063 set_true_value(Oddball::cast(obj)); |
| 3063 | 3064 |
| (...skipping 3503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6567 v->VisitPointers(&roots_[0], &roots_[kStrongRootListLength]); | 6568 v->VisitPointers(&roots_[0], &roots_[kStrongRootListLength]); |
| 6568 v->Synchronize(VisitorSynchronization::kStrongRootList); | 6569 v->Synchronize(VisitorSynchronization::kStrongRootList); |
| 6569 | 6570 |
| 6570 v->VisitPointer(BitCast<Object**>(&hidden_string_)); | 6571 v->VisitPointer(BitCast<Object**>(&hidden_string_)); |
| 6571 v->Synchronize(VisitorSynchronization::kInternalizedString); | 6572 v->Synchronize(VisitorSynchronization::kInternalizedString); |
| 6572 | 6573 |
| 6573 isolate_->bootstrapper()->Iterate(v); | 6574 isolate_->bootstrapper()->Iterate(v); |
| 6574 v->Synchronize(VisitorSynchronization::kBootstrapper); | 6575 v->Synchronize(VisitorSynchronization::kBootstrapper); |
| 6575 isolate_->Iterate(v); | 6576 isolate_->Iterate(v); |
| 6576 v->Synchronize(VisitorSynchronization::kTop); | 6577 v->Synchronize(VisitorSynchronization::kTop); |
| 6577 Relocatable::Iterate(v); | 6578 Relocatable::Iterate(isolate_, v); |
| 6578 v->Synchronize(VisitorSynchronization::kRelocatable); | 6579 v->Synchronize(VisitorSynchronization::kRelocatable); |
| 6579 | 6580 |
| 6580 #ifdef ENABLE_DEBUGGER_SUPPORT | 6581 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 6581 isolate_->debug()->Iterate(v); | 6582 isolate_->debug()->Iterate(v); |
| 6582 if (isolate_->deoptimizer_data() != NULL) { | 6583 if (isolate_->deoptimizer_data() != NULL) { |
| 6583 isolate_->deoptimizer_data()->Iterate(v); | 6584 isolate_->deoptimizer_data()->Iterate(v); |
| 6584 } | 6585 } |
| 6585 #endif | 6586 #endif |
| 6586 v->Synchronize(VisitorSynchronization::kDebug); | 6587 v->Synchronize(VisitorSynchronization::kDebug); |
| 6587 isolate_->compilation_cache()->Iterate(v); | 6588 isolate_->compilation_cache()->Iterate(v); |
| (...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8059 if (FLAG_concurrent_recompilation) { | 8060 if (FLAG_concurrent_recompilation) { |
| 8060 heap_->relocation_mutex_->Lock(); | 8061 heap_->relocation_mutex_->Lock(); |
| 8061 #ifdef DEBUG | 8062 #ifdef DEBUG |
| 8062 heap_->relocation_mutex_locked_by_optimizer_thread_ = | 8063 heap_->relocation_mutex_locked_by_optimizer_thread_ = |
| 8063 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 8064 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |
| 8064 #endif // DEBUG | 8065 #endif // DEBUG |
| 8065 } | 8066 } |
| 8066 } | 8067 } |
| 8067 | 8068 |
| 8068 } } // namespace v8::internal | 8069 } } // namespace v8::internal |
| OLD | NEW |