VM: Don't inline array allocation in precompiled code

This reduces generated code size by around 3-4% on ARM and x64.

Performance impact is mostly neutral because precompiled code is generally
dominated by other factors, and especially ARM often benefits from smaller
generated code.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1512513002 .
This commit is contained in:
Florian Schneider 2015-12-09 11:40:32 +01:00
parent 116a96bea5
commit 12b0aa1ba8
4 changed files with 8 additions and 0 deletions

View file

@ -8,6 +8,7 @@
#include "vm/intermediate_language.h"
#include "vm/cpu.h"
#include "vm/compiler.h"
#include "vm/dart_entry.h"
#include "vm/flow_graph.h"
#include "vm/flow_graph_compiler.h"
@ -2379,6 +2380,7 @@ void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(locs()->in(kLengthPos).reg() == kLengthReg);
if (compiler->is_optimizing() &&
!Compiler::always_optimize() &&
num_elements()->BindsToConstant() &&
num_elements()->BoundConstant().IsSmi()) {
const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value();

View file

@ -7,6 +7,7 @@
#include "vm/intermediate_language.h"
#include "vm/compiler.h"
#include "vm/dart_entry.h"
#include "vm/flow_graph.h"
#include "vm/flow_graph_compiler.h"
@ -2102,6 +2103,7 @@ void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(locs()->in(kLengthPos).reg() == kLengthReg);
if (compiler->is_optimizing() &&
!Compiler::always_optimize() &&
num_elements()->BindsToConstant() &&
num_elements()->BoundConstant().IsSmi()) {
const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value();

View file

@ -7,6 +7,7 @@
#include "vm/intermediate_language.h"
#include "vm/compiler.h"
#include "vm/dart_entry.h"
#include "vm/flow_graph.h"
#include "vm/flow_graph_compiler.h"
@ -2233,6 +2234,7 @@ void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
Label slow_path, done;
if (compiler->is_optimizing() &&
!Compiler::always_optimize() &&
num_elements()->BindsToConstant() &&
num_elements()->BoundConstant().IsSmi()) {
const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value();

View file

@ -7,6 +7,7 @@
#include "vm/intermediate_language.h"
#include "vm/compiler.h"
#include "vm/dart_entry.h"
#include "vm/flow_graph.h"
#include "vm/flow_graph_compiler.h"
@ -2117,6 +2118,7 @@ void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
Label slow_path, done;
if (compiler->is_optimizing() &&
!Compiler::always_optimize() &&
num_elements()->BindsToConstant() &&
num_elements()->BoundConstant().IsSmi()) {
const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value();