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

Side by Side Diff: src/heap.cc

Issue 11093074: Get rid of static module allocation, do it in code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed last comments; added other back-ends Created 8 years, 1 month 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 | « src/full-codegen.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
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 4959 matching lines...) Expand 10 before | Expand all | Expand 10 after
4970 4970
4971 4971
4972 MaybeObject* Heap::AllocateModuleContext(ScopeInfo* scope_info) { 4972 MaybeObject* Heap::AllocateModuleContext(ScopeInfo* scope_info) {
4973 Object* result; 4973 Object* result;
4974 { MaybeObject* maybe_result = 4974 { MaybeObject* maybe_result =
4975 AllocateFixedArray(scope_info->ContextLength(), TENURED); 4975 AllocateFixedArray(scope_info->ContextLength(), TENURED);
4976 if (!maybe_result->ToObject(&result)) return maybe_result; 4976 if (!maybe_result->ToObject(&result)) return maybe_result;
4977 } 4977 }
4978 Context* context = reinterpret_cast<Context*>(result); 4978 Context* context = reinterpret_cast<Context*>(result);
4979 context->set_map_no_write_barrier(module_context_map()); 4979 context->set_map_no_write_barrier(module_context_map());
4980 // Context links will be set later. 4980 // Instance link will be set later.
4981 context->set_extension(Smi::FromInt(0)); 4981 context->set_extension(Smi::FromInt(0));
4982 return context; 4982 return context;
4983 } 4983 }
4984 4984
4985 4985
4986 MaybeObject* Heap::AllocateFunctionContext(int length, JSFunction* function) { 4986 MaybeObject* Heap::AllocateFunctionContext(int length, JSFunction* function) {
4987 ASSERT(length >= Context::MIN_CONTEXT_SLOTS); 4987 ASSERT(length >= Context::MIN_CONTEXT_SLOTS);
4988 Object* result; 4988 Object* result;
4989 { MaybeObject* maybe_result = AllocateFixedArray(length); 4989 { MaybeObject* maybe_result = AllocateFixedArray(length);
4990 if (!maybe_result->ToObject(&result)) return maybe_result; 4990 if (!maybe_result->ToObject(&result)) return maybe_result;
(...skipping 2336 matching lines...) Expand 10 before | Expand all | Expand 10 after
7327 static_cast<int>(object_sizes_last_time_[index])); 7327 static_cast<int>(object_sizes_last_time_[index]));
7328 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 7328 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
7329 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7329 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7330 7330
7331 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7331 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7332 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7332 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7333 ClearObjectStats(); 7333 ClearObjectStats();
7334 } 7334 }
7335 7335
7336 } } // namespace v8::internal 7336 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/full-codegen.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698