mirror of
https://github.com/dart-lang/sdk
synced 2024-09-21 21:31:19 +00:00
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:
parent
116a96bea5
commit
12b0aa1ba8
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue