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

Unified Diff: src/runtime.cc

Issue 7374002: Refactor allocation policies. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 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/profile-generator.cc ('k') | src/safepoint-table.h » ('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 c6b26493ce9bcdf709248177842db4348d6736be..8a98542524b38df5e7c6c14feeee6e75ba590c7d 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -2332,8 +2332,8 @@ class ReplacementStringBuilder {
class CompiledReplacement {
public:
- CompiledReplacement()
- : parts_(1), replacement_substrings_(0) {}
+ explicit CompiledReplacement(Zone* zone)
+ : parts_(zone, 1), replacement_substrings_(zone, 0) {}
void Compile(Handle<String> replacement,
int capture_count,
@@ -2625,8 +2625,8 @@ MUST_USE_RESULT static MaybeObject* StringReplaceRegExpWithString(
int capture_count = regexp_handle->CaptureCount();
// CompiledReplacement uses zone allocation.
- ZoneScope zone(isolate, DELETE_ON_EXIT);
- CompiledReplacement compiled_replacement;
+ ZoneScope zone_scope(isolate, DELETE_ON_EXIT);
+ CompiledReplacement compiled_replacement(isolate->zone());
compiled_replacement.Compile(replacement_handle,
capture_count,
length);
@@ -3140,7 +3140,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringMatch) {
int length = subject->length();
ZoneScope zone_space(isolate, DELETE_ON_EXIT);
- ZoneList<int> offsets(8);
+ ZoneList<int> offsets(isolate->zone(), 8);
int start;
int end;
do {
@@ -5810,7 +5810,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringSplit) {
// Find (up to limit) indices of separator and end-of-string in subject
int initial_capacity = Min<uint32_t>(kMaxInitialListCapacity, limit);
- ZoneList<int> indices(initial_capacity);
+ ZoneList<int> indices(isolate->zone(), initial_capacity);
if (!pattern->IsFlat()) FlattenString(pattern);
// No allocation block.
« no previous file with comments | « src/profile-generator.cc ('k') | src/safepoint-table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698