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 4953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4964 AllocationSite* site) { | 4964 AllocationSite* site) { |
4965 // Never used to copy functions. If functions need to be copied we | 4965 // Never used to copy functions. If functions need to be copied we |
4966 // have to be careful to clear the literals array. | 4966 // have to be careful to clear the literals array. |
4967 SLOW_ASSERT(!source->IsJSFunction()); | 4967 SLOW_ASSERT(!source->IsJSFunction()); |
4968 | 4968 |
4969 // Make the clone. | 4969 // Make the clone. |
4970 Map* map = source->map(); | 4970 Map* map = source->map(); |
4971 int object_size = map->instance_size(); | 4971 int object_size = map->instance_size(); |
4972 Object* clone; | 4972 Object* clone; |
4973 | 4973 |
4974 ASSERT(map->CanTrackAllocationSite()); | 4974 ASSERT(AllocationSite::CanTrack(map->instance_type())); |
4975 ASSERT(map->instance_type() == JS_ARRAY_TYPE); | 4975 ASSERT(map->instance_type() == JS_ARRAY_TYPE); |
4976 WriteBarrierMode wb_mode = UPDATE_WRITE_BARRIER; | 4976 WriteBarrierMode wb_mode = UPDATE_WRITE_BARRIER; |
4977 | 4977 |
4978 // If we're forced to always allocate, we use the general allocation | 4978 // If we're forced to always allocate, we use the general allocation |
4979 // functions which may leave us with an object in old space. | 4979 // functions which may leave us with an object in old space. |
4980 int adjusted_object_size = object_size; | 4980 int adjusted_object_size = object_size; |
4981 if (always_allocate()) { | 4981 if (always_allocate()) { |
4982 // We'll only track origin if we are certain to allocate in new space | 4982 // We'll only track origin if we are certain to allocate in new space |
4983 const int kMinFreeNewSpaceAfterGC = InitialSemiSpaceSize() * 3/4; | 4983 const int kMinFreeNewSpaceAfterGC = InitialSemiSpaceSize() * 3/4; |
4984 if ((object_size + AllocationMemento::kSize) < kMinFreeNewSpaceAfterGC) { | 4984 if ((object_size + AllocationMemento::kSize) < kMinFreeNewSpaceAfterGC) { |
(...skipping 3066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8051 if (FLAG_concurrent_recompilation) { | 8051 if (FLAG_concurrent_recompilation) { |
8052 heap_->relocation_mutex_->Lock(); | 8052 heap_->relocation_mutex_->Lock(); |
8053 #ifdef DEBUG | 8053 #ifdef DEBUG |
8054 heap_->relocation_mutex_locked_by_optimizer_thread_ = | 8054 heap_->relocation_mutex_locked_by_optimizer_thread_ = |
8055 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 8055 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |
8056 #endif // DEBUG | 8056 #endif // DEBUG |
8057 } | 8057 } |
8058 } | 8058 } |
8059 | 8059 |
8060 } } // namespace v8::internal | 8060 } } // namespace v8::internal |
OLD | NEW |