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

Unified Diff: src/compiler/structured-machine-assembler.cc

Issue 535133002: Remove usages of alloca() according to style guide. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/machine-node-factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/structured-machine-assembler.cc
diff --git a/src/compiler/structured-machine-assembler.cc b/src/compiler/structured-machine-assembler.cc
index 6475809e0e8e2c0f52b77cf27000f593b870a712..432b84c64a9e8e89ed0a39e870efffbba97c0919 100644
--- a/src/compiler/structured-machine-assembler.cc
+++ b/src/compiler/structured-machine-assembler.cc
@@ -213,8 +213,7 @@ void StructuredMachineAssembler::Merge(EnvironmentVector* environments,
vars.reserve(n_vars);
Node** scratch = NULL;
size_t n_envs = environments->size();
- Environment** live_environments = reinterpret_cast<Environment**>(
- alloca(sizeof(environments->at(0)) * n_envs));
+ Environment** live_environments = zone()->NewArray<Environment*>(n_envs);
size_t n_live = 0;
for (size_t i = 0; i < n_envs; i++) {
if (environments->at(i)->is_dead_) continue;
@@ -250,7 +249,7 @@ void StructuredMachineAssembler::Merge(EnvironmentVector* environments,
CHECK(resolved != NULL);
// Init scratch buffer.
if (scratch == NULL) {
- scratch = static_cast<Node**>(alloca(n_envs * sizeof(resolved)));
+ scratch = zone()->NewArray<Node*>(n_envs);
}
for (size_t k = 0; k < i; k++) {
scratch[k] = resolved;
« no previous file with comments | « src/compiler/machine-node-factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698