Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: src/heap.cc

Issue 22915007: Clear next map word when folding allocations into js arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | src/hydrogen-instructions.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4952 matching lines...) Expand 10 before | Expand all | Expand 10 after
4963 AllocationSite* site) { 4963 AllocationSite* site) {
4964 // Never used to copy functions. If functions need to be copied we 4964 // Never used to copy functions. If functions need to be copied we
4965 // have to be careful to clear the literals array. 4965 // have to be careful to clear the literals array.
4966 SLOW_ASSERT(!source->IsJSFunction()); 4966 SLOW_ASSERT(!source->IsJSFunction());
4967 4967
4968 // Make the clone. 4968 // Make the clone.
4969 Map* map = source->map(); 4969 Map* map = source->map();
4970 int object_size = map->instance_size(); 4970 int object_size = map->instance_size();
4971 Object* clone; 4971 Object* clone;
4972 4972
4973 ASSERT(map->CanTrackAllocationSite()); 4973 ASSERT(AllocationSite::CanTrack(map->instance_type()));
4974 ASSERT(map->instance_type() == JS_ARRAY_TYPE); 4974 ASSERT(map->instance_type() == JS_ARRAY_TYPE);
4975 WriteBarrierMode wb_mode = UPDATE_WRITE_BARRIER; 4975 WriteBarrierMode wb_mode = UPDATE_WRITE_BARRIER;
4976 4976
4977 // If we're forced to always allocate, we use the general allocation 4977 // If we're forced to always allocate, we use the general allocation
4978 // functions which may leave us with an object in old space. 4978 // functions which may leave us with an object in old space.
4979 int adjusted_object_size = object_size; 4979 int adjusted_object_size = object_size;
4980 if (always_allocate()) { 4980 if (always_allocate()) {
4981 // We'll only track origin if we are certain to allocate in new space 4981 // We'll only track origin if we are certain to allocate in new space
4982 const int kMinFreeNewSpaceAfterGC = InitialSemiSpaceSize() * 3/4; 4982 const int kMinFreeNewSpaceAfterGC = InitialSemiSpaceSize() * 3/4;
4983 if ((object_size + AllocationMemento::kSize) < kMinFreeNewSpaceAfterGC) { 4983 if ((object_size + AllocationMemento::kSize) < kMinFreeNewSpaceAfterGC) {
(...skipping 3066 matching lines...) Expand 10 before | Expand all | Expand 10 after
8050 if (FLAG_concurrent_recompilation) { 8050 if (FLAG_concurrent_recompilation) {
8051 heap_->relocation_mutex_->Lock(); 8051 heap_->relocation_mutex_->Lock();
8052 #ifdef DEBUG 8052 #ifdef DEBUG
8053 heap_->relocation_mutex_locked_by_optimizer_thread_ = 8053 heap_->relocation_mutex_locked_by_optimizer_thread_ =
8054 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 8054 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
8055 #endif // DEBUG 8055 #endif // DEBUG
8056 } 8056 }
8057 } 8057 }
8058 8058
8059 } } // namespace v8::internal 8059 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | src/hydrogen-instructions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698