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

Unified Diff: src/runtime.cc

Issue 3078033: Version 2.3.6 (Closed)
Patch Set: Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime.h ('k') | src/string.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 32c5dff78c5744969f116a22e780675d429f8dc9..c7d3ff7f1bfbef600176c806619a1e946fa703fb 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -7587,6 +7587,26 @@ static Object* Runtime_SetNewFunctionAttributes(Arguments args) {
}
+static Object* Runtime_AllocateInNewSpace(Arguments args) {
+ // Allocate a block of memory in NewSpace (filled with a filler).
+ // Use as fallback for allocation in generated code when NewSpace
+ // is full.
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_CHECKED(Smi, size_smi, 0);
+ int size = size_smi->value();
+ RUNTIME_ASSERT(IsAligned(size, kPointerSize));
+ RUNTIME_ASSERT(size > 0);
+ static const int kMinFreeNewSpaceAfterGC =
+ Heap::InitialSemiSpaceSize() * 3/4;
+ RUNTIME_ASSERT(size <= kMinFreeNewSpaceAfterGC);
+ Object* allocation = Heap::new_space()->AllocateRaw(size);
+ if (!allocation->IsFailure()) {
+ Heap::CreateFillerObjectAt(HeapObject::cast(allocation)->address(), size);
+ }
+ return allocation;
+}
+
+
// Push an array unto an array of arrays if it is not already in the
// array. Returns true if the element was pushed on the stack and
// false otherwise.
« no previous file with comments | « src/runtime.h ('k') | src/string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698