| Index: runtime/vm/flow_graph_optimizer.cc
|
| ===================================================================
|
| --- runtime/vm/flow_graph_optimizer.cc (revision 43075)
|
| +++ runtime/vm/flow_graph_optimizer.cc (working copy)
|
| @@ -47,8 +47,9 @@
|
| DECLARE_FLAG(bool, trace_type_check_elimination);
|
| DECLARE_FLAG(bool, warn_on_javascript_compatibility);
|
|
|
| -// Quick access to the locally defined isolate() method.
|
| +// Quick access to the current isolate and zone.
|
| #define I (isolate())
|
| +#define Z (zone())
|
|
|
| static bool ShouldInlineSimd() {
|
| return FlowGraphCompiler::SupportsUnboxedSimd128();
|
| @@ -177,12 +178,12 @@
|
| }
|
| }
|
|
|
| - const Array& args_desc_array = Array::Handle(I,
|
| + const Array& args_desc_array = Array::Handle(Z,
|
| ArgumentsDescriptor::New(call->ArgumentCount(), call->argument_names()));
|
| ArgumentsDescriptor args_desc(args_desc_array);
|
| - const Class& receiver_class = Class::Handle(I,
|
| + const Class& receiver_class = Class::Handle(Z,
|
| isolate()->class_table()->At(class_ids[0]));
|
| - const Function& function = Function::Handle(I,
|
| + const Function& function = Function::Handle(Z,
|
| Resolver::ResolveDynamicForReceiverClass(
|
| receiver_class,
|
| call->function_name(),
|
| @@ -194,7 +195,7 @@
|
| // since it is attached to the assembly instruction itself.
|
| // TODO(srdjan): Prevent modification of ICData object that is
|
| // referenced in assembly code.
|
| - ICData& ic_data = ICData::ZoneHandle(I, ICData::New(
|
| + ICData& ic_data = ICData::ZoneHandle(Z, ICData::New(
|
| flow_graph_->parsed_function()->function(),
|
| call->function_name(),
|
| args_desc_array,
|
| @@ -220,13 +221,13 @@
|
| }
|
|
|
| const Function& function =
|
| - Function::Handle(I, ic_data.GetTargetForReceiverClassId(cid));
|
| + Function::Handle(Z, ic_data.GetTargetForReceiverClassId(cid));
|
| // TODO(fschneider): Try looking up the function on the class if it is
|
| // not found in the ICData.
|
| if (!function.IsNull()) {
|
| - const ICData& new_ic_data = ICData::ZoneHandle(I, ICData::New(
|
| - Function::Handle(I, ic_data.owner()),
|
| - String::Handle(I, ic_data.target_name()),
|
| + const ICData& new_ic_data = ICData::ZoneHandle(Z, ICData::New(
|
| + Function::Handle(Z, ic_data.owner()),
|
| + String::Handle(Z, ic_data.target_name()),
|
| Object::empty_array(), // Dummy argument descriptor.
|
| ic_data.deopt_id(),
|
| ic_data.NumArgsTested()));
|
| @@ -259,7 +260,7 @@
|
|
|
| const bool with_checks = false;
|
| PolymorphicInstanceCallInstr* specialized =
|
| - new(I) PolymorphicInstanceCallInstr(call->instance_call(),
|
| + new(Z) PolymorphicInstanceCallInstr(call->instance_call(),
|
| ic_data,
|
| with_checks);
|
| call->ReplaceWith(specialized, current_iterator());
|
| @@ -312,10 +313,10 @@
|
| ASSERT(bit_and_instr->IsBinarySmiOp() || bit_and_instr->IsBinaryMintOp());
|
| if (bit_and_instr->IsBinaryMintOp()) {
|
| // Replace Mint op with Smi op.
|
| - BinarySmiOpInstr* smi_op = new(I) BinarySmiOpInstr(
|
| + BinarySmiOpInstr* smi_op = new(Z) BinarySmiOpInstr(
|
| Token::kBIT_AND,
|
| - new(I) Value(left_instr),
|
| - new(I) Value(right_instr),
|
| + new(Z) Value(left_instr),
|
| + new(Z) Value(right_instr),
|
| Isolate::kNoDeoptId); // BIT_AND cannot deoptimize.
|
| bit_and_instr->ReplaceWith(smi_op, current_iterator());
|
| }
|
| @@ -331,10 +332,10 @@
|
| intptr_t cid) {
|
| const intptr_t index_scale = Instance::ElementSizeFor(cid);
|
| ConstantInstr* index_instr =
|
| - flow_graph()->GetConstant(Smi::Handle(I, Smi::New(ix)));
|
| + flow_graph()->GetConstant(Smi::Handle(Z, Smi::New(ix)));
|
| LoadIndexedInstr* load =
|
| - new(I) LoadIndexedInstr(new(I) Value(instr),
|
| - new(I) Value(index_instr),
|
| + new(Z) LoadIndexedInstr(new(Z) Value(instr),
|
| + new(Z) Value(index_instr),
|
| index_scale,
|
| cid,
|
| Isolate::kNoDeoptId,
|
| @@ -349,7 +350,7 @@
|
| Representation rep,
|
| intptr_t cid) {
|
| ExtractNthOutputInstr* extract =
|
| - new(I) ExtractNthOutputInstr(new(I) Value(instr), index, rep, cid);
|
| + new(Z) ExtractNthOutputInstr(new(Z) Value(instr), index, rep, cid);
|
| instr->ReplaceUsesWith(extract);
|
| flow_graph()->InsertAfter(instr, extract, NULL, FlowGraph::kValue);
|
| }
|
| @@ -410,12 +411,12 @@
|
| MergedMathInstr::OutputIndexOf(other_binop->op_kind()),
|
| kTagged, kSmiCid);
|
|
|
| - ZoneGrowableArray<Value*>* args = new(I) ZoneGrowableArray<Value*>(2);
|
| - args->Add(new(I) Value(curr_instr->left()->definition()));
|
| - args->Add(new(I) Value(curr_instr->right()->definition()));
|
| + ZoneGrowableArray<Value*>* args = new(Z) ZoneGrowableArray<Value*>(2);
|
| + args->Add(new(Z) Value(curr_instr->left()->definition()));
|
| + args->Add(new(Z) Value(curr_instr->right()->definition()));
|
|
|
| // Replace with TruncDivMod.
|
| - MergedMathInstr* div_mod = new(I) MergedMathInstr(
|
| + MergedMathInstr* div_mod = new(Z) MergedMathInstr(
|
| args,
|
| curr_instr->deopt_id(),
|
| MergedMathInstr::kTruncDivMod);
|
| @@ -470,11 +471,11 @@
|
| other_op,
|
| MergedMathInstr::OutputIndexOf(other_kind),
|
| kUnboxedDouble, kDoubleCid);
|
| - ZoneGrowableArray<Value*>* args = new(I) ZoneGrowableArray<Value*>(1);
|
| - args->Add(new(I) Value(curr_instr->value()->definition()));
|
| + ZoneGrowableArray<Value*>* args = new(Z) ZoneGrowableArray<Value*>(1);
|
| + args->Add(new(Z) Value(curr_instr->value()->definition()));
|
| // Replace with SinCos.
|
| MergedMathInstr* sin_cos =
|
| - new(I) MergedMathInstr(args,
|
| + new(Z) MergedMathInstr(args,
|
| curr_instr->DeoptimizationTarget(),
|
| MergedMathInstr::kSinCos);
|
| curr_instr->ReplaceWith(sin_cos, current_iterator());
|
| @@ -635,7 +636,7 @@
|
| if (IsUnboxedInteger(from) && IsUnboxedInteger(to)) {
|
| const intptr_t deopt_id = (to == kUnboxedInt32) && (deopt_target != NULL) ?
|
| deopt_target->DeoptimizationTarget() : Isolate::kNoDeoptId;
|
| - converted = new(I) UnboxedIntConverterInstr(from,
|
| + converted = new(Z) UnboxedIntConverterInstr(from,
|
| to,
|
| use->CopyWithType(),
|
| deopt_id);
|
| @@ -666,7 +667,7 @@
|
| Definition* boxed = BoxInstr::Create(from, use->CopyWithType());
|
| use->BindTo(boxed);
|
| InsertBefore(insert_before, boxed, NULL, FlowGraph::kValue);
|
| - converted = UnboxInstr::Create(to, new(I) Value(boxed), deopt_id);
|
| + converted = UnboxInstr::Create(to, new(Z) Value(boxed), deopt_id);
|
| }
|
| ASSERT(converted != NULL);
|
| InsertBefore(insert_before, converted, use->instruction()->env(),
|
| @@ -1017,7 +1018,7 @@
|
| Instruction* insert_before) {
|
| if (to_check->Type()->ToCid() != kSmiCid) {
|
| InsertBefore(insert_before,
|
| - new(I) CheckSmiInstr(new(I) Value(to_check),
|
| + new(Z) CheckSmiInstr(new(Z) Value(to_check),
|
| deopt_id,
|
| insert_before->token_pos()),
|
| deopt_environment,
|
| @@ -1032,12 +1033,12 @@
|
| intptr_t token_pos) {
|
| if ((unary_checks.NumberOfUsedChecks() == 1) &&
|
| unary_checks.HasReceiverClassId(kSmiCid)) {
|
| - return new(I) CheckSmiInstr(new(I) Value(to_check),
|
| + return new(Z) CheckSmiInstr(new(Z) Value(to_check),
|
| deopt_id,
|
| token_pos);
|
| }
|
| - return new(I) CheckClassInstr(
|
| - new(I) Value(to_check), deopt_id, unary_checks, token_pos);
|
| + return new(Z) CheckClassInstr(
|
| + new(Z) Value(to_check), deopt_id, unary_checks, token_pos);
|
| }
|
|
|
|
|
| @@ -1055,7 +1056,7 @@
|
|
|
| void FlowGraphOptimizer::AddReceiverCheck(InstanceCallInstr* call) {
|
| AddCheckClass(call->ArgumentAt(0),
|
| - ICData::ZoneHandle(I, call->ic_data()->AsUnaryClassChecks()),
|
| + ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecks()),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| @@ -1170,7 +1171,7 @@
|
| // Check for monomorphic IC data.
|
| if (!call->HasICData()) return false;
|
| const ICData& ic_data =
|
| - ICData::Handle(I, call->ic_data()->AsUnaryClassChecks());
|
| + ICData::Handle(Z, call->ic_data()->AsUnaryClassChecks());
|
| if (ic_data.NumberOfChecks() != 1) {
|
| return false;
|
| }
|
| @@ -1194,7 +1195,7 @@
|
| Definition* index = call->ArgumentAt(1);
|
| Definition* stored_value = call->ArgumentAt(2);
|
|
|
| - *entry = new(I) TargetEntryInstr(flow_graph()->allocate_block_id(),
|
| + *entry = new(Z) TargetEntryInstr(flow_graph()->allocate_block_id(),
|
| call->GetBlock()->try_index());
|
| (*entry)->InheritDeoptTarget(I, call);
|
| Instruction* cursor = *entry;
|
| @@ -1203,19 +1204,19 @@
|
| // needed here because we insert a deoptimizing smi-check for the case
|
| // the index is not a smi.
|
| const AbstractType& value_type =
|
| - AbstractType::ZoneHandle(I, target.ParameterTypeAt(2));
|
| + AbstractType::ZoneHandle(Z, target.ParameterTypeAt(2));
|
| Definition* instantiator = NULL;
|
| Definition* type_args = NULL;
|
| switch (array_cid) {
|
| case kArrayCid:
|
| case kGrowableObjectArrayCid: {
|
| - const Class& instantiator_class = Class::Handle(I, target.Owner());
|
| + const Class& instantiator_class = Class::Handle(Z, target.Owner());
|
| intptr_t type_arguments_field_offset =
|
| instantiator_class.type_arguments_field_offset();
|
| LoadFieldInstr* load_type_args =
|
| - new(I) LoadFieldInstr(new(I) Value(array),
|
| + new(Z) LoadFieldInstr(new(Z) Value(array),
|
| type_arguments_field_offset,
|
| - Type::ZoneHandle(I), // No type.
|
| + Type::ZoneHandle(Z), // No type.
|
| call->token_pos());
|
| cursor = flow_graph()->AppendTo(cursor,
|
| load_type_args,
|
| @@ -1266,10 +1267,10 @@
|
| UNREACHABLE();
|
| }
|
| AssertAssignableInstr* assert_value =
|
| - new(I) AssertAssignableInstr(token_pos,
|
| - new(I) Value(stored_value),
|
| - new(I) Value(instantiator),
|
| - new(I) Value(type_args),
|
| + new(Z) AssertAssignableInstr(token_pos,
|
| + new(Z) Value(stored_value),
|
| + new(Z) Value(instantiator),
|
| + new(Z) Value(type_args),
|
| value_type,
|
| Symbols::Value(),
|
| call->deopt_id());
|
| @@ -1310,16 +1311,16 @@
|
|
|
| if (array_cid == kTypedDataFloat32ArrayCid) {
|
| stored_value =
|
| - new(I) DoubleToFloatInstr(
|
| - new(I) Value(stored_value), call->deopt_id());
|
| + new(Z) DoubleToFloatInstr(
|
| + new(Z) Value(stored_value), call->deopt_id());
|
| cursor = flow_graph()->AppendTo(cursor,
|
| stored_value,
|
| NULL,
|
| FlowGraph::kValue);
|
| } else if (array_cid == kTypedDataInt32ArrayCid) {
|
| - stored_value = new(I) UnboxInt32Instr(
|
| + stored_value = new(Z) UnboxInt32Instr(
|
| UnboxInt32Instr::kTruncate,
|
| - new(I) Value(stored_value),
|
| + new(Z) Value(stored_value),
|
| call->deopt_id());
|
| cursor = flow_graph()->AppendTo(cursor,
|
| stored_value,
|
| @@ -1326,8 +1327,8 @@
|
| call->env(),
|
| FlowGraph::kValue);
|
| } else if (array_cid == kTypedDataUint32ArrayCid) {
|
| - stored_value = new(I) UnboxUint32Instr(
|
| - new(I) Value(stored_value),
|
| + stored_value = new(Z) UnboxUint32Instr(
|
| + new(Z) Value(stored_value),
|
| call->deopt_id());
|
| ASSERT(stored_value->AsUnboxInteger()->is_truncating());
|
| cursor = flow_graph()->AppendTo(cursor,
|
| @@ -1337,9 +1338,9 @@
|
| }
|
|
|
| const intptr_t index_scale = Instance::ElementSizeFor(array_cid);
|
| - *last = new(I) StoreIndexedInstr(new(I) Value(array),
|
| - new(I) Value(index),
|
| - new(I) Value(stored_value),
|
| + *last = new(Z) StoreIndexedInstr(new(Z) Value(array),
|
| + new(Z) Value(index),
|
| + new(Z) Value(stored_value),
|
| needs_store_barrier,
|
| index_scale,
|
| array_cid,
|
| @@ -1361,7 +1362,7 @@
|
| const ICData& ic_data,
|
| TargetEntryInstr** entry,
|
| Definition** last) {
|
| - ICData& value_check = ICData::ZoneHandle(I);
|
| + ICData& value_check = ICData::ZoneHandle(Z);
|
| MethodRecognizer::Kind kind = MethodRecognizer::RecognizeKind(target);
|
| switch (kind) {
|
| // Recognized [] operators.
|
| @@ -1605,7 +1606,7 @@
|
| // Insert index smi check.
|
| *cursor = flow_graph()->AppendTo(
|
| *cursor,
|
| - new(I) CheckSmiInstr(new(I) Value(index),
|
| + new(Z) CheckSmiInstr(new(Z) Value(index),
|
| call->deopt_id(),
|
| call->token_pos()),
|
| call->env(),
|
| @@ -1613,10 +1614,10 @@
|
|
|
| // Insert array length load and bounds check.
|
| LoadFieldInstr* length =
|
| - new(I) LoadFieldInstr(
|
| - new(I) Value(*array),
|
| + new(Z) LoadFieldInstr(
|
| + new(Z) Value(*array),
|
| CheckArrayBoundInstr::LengthOffsetFor(array_cid),
|
| - Type::ZoneHandle(I, Type::SmiType()),
|
| + Type::ZoneHandle(Z, Type::SmiType()),
|
| call->token_pos());
|
| length->set_is_immutable(
|
| CheckArrayBoundInstr::IsFixedLengthArrayType(array_cid));
|
| @@ -1629,9 +1630,9 @@
|
| FlowGraph::kValue);
|
|
|
| *cursor = flow_graph()->AppendTo(*cursor,
|
| - new(I) CheckArrayBoundInstr(
|
| - new(I) Value(length),
|
| - new(I) Value(index),
|
| + new(Z) CheckArrayBoundInstr(
|
| + new(Z) Value(length),
|
| + new(Z) Value(index),
|
| call->deopt_id()),
|
| call->env(),
|
| FlowGraph::kEffect);
|
| @@ -1639,10 +1640,10 @@
|
| if (array_cid == kGrowableObjectArrayCid) {
|
| // Insert data elements load.
|
| LoadFieldInstr* elements =
|
| - new(I) LoadFieldInstr(
|
| - new(I) Value(*array),
|
| + new(Z) LoadFieldInstr(
|
| + new(Z) Value(*array),
|
| GrowableObjectArray::data_offset(),
|
| - Type::ZoneHandle(I, Type::DynamicType()),
|
| + Type::ZoneHandle(Z, Type::DynamicType()),
|
| call->token_pos());
|
| elements->set_result_cid(kArrayCid);
|
| *cursor = flow_graph()->AppendTo(*cursor,
|
| @@ -1654,7 +1655,7 @@
|
| array_cid = kArrayCid;
|
| } else if (RawObject::IsExternalTypedDataClassId(array_cid)) {
|
| LoadUntaggedInstr* elements =
|
| - new(I) LoadUntaggedInstr(new(I) Value(*array),
|
| + new(Z) LoadUntaggedInstr(new(Z) Value(*array),
|
| ExternalTypedData::data_offset());
|
| *cursor = flow_graph()->AppendTo(*cursor,
|
| elements,
|
| @@ -1676,7 +1677,7 @@
|
|
|
| Definition* array = receiver;
|
| Definition* index = call->ArgumentAt(1);
|
| - *entry = new(I) TargetEntryInstr(flow_graph()->allocate_block_id(),
|
| + *entry = new(Z) TargetEntryInstr(flow_graph()->allocate_block_id(),
|
| call->GetBlock()->try_index());
|
| (*entry)->InheritDeoptTarget(I, call);
|
| Instruction* cursor = *entry;
|
| @@ -1696,8 +1697,8 @@
|
|
|
| // Array load and return.
|
| intptr_t index_scale = Instance::ElementSizeFor(array_cid);
|
| - *last = new(I) LoadIndexedInstr(new(I) Value(array),
|
| - new(I) Value(index),
|
| + *last = new(Z) LoadIndexedInstr(new(Z) Value(array),
|
| + new(Z) Value(index),
|
| index_scale,
|
| array_cid,
|
| deopt_id,
|
| @@ -1709,7 +1710,7 @@
|
| FlowGraph::kValue);
|
|
|
| if (array_cid == kTypedDataFloat32ArrayCid) {
|
| - *last = new(I) FloatToDoubleInstr(new(I) Value(*last), deopt_id);
|
| + *last = new(Z) FloatToDoubleInstr(new(Z) Value(*last), deopt_id);
|
| flow_graph()->AppendTo(cursor,
|
| *last,
|
| deopt_id != Isolate::kNoDeoptId ? call->env() : NULL,
|
| @@ -1762,12 +1763,12 @@
|
| const String& str = String::Cast(left_const->value());
|
| ASSERT(str.Length() == 1);
|
| ConstantInstr* char_code_left = flow_graph()->GetConstant(
|
| - Smi::ZoneHandle(I, Smi::New(static_cast<intptr_t>(str.CharAt(0)))));
|
| - left_val = new(I) Value(char_code_left);
|
| + Smi::ZoneHandle(Z, Smi::New(static_cast<intptr_t>(str.CharAt(0)))));
|
| + left_val = new(Z) Value(char_code_left);
|
| } else if (left->IsStringFromCharCode()) {
|
| // Use input of string-from-charcode as left value.
|
| StringFromCharCodeInstr* instr = left->AsStringFromCharCode();
|
| - left_val = new(I) Value(instr->char_code()->definition());
|
| + left_val = new(Z) Value(instr->char_code()->definition());
|
| to_remove_left = instr;
|
| } else {
|
| // IsLengthOneString(left) should have been false.
|
| @@ -1779,11 +1780,11 @@
|
| if (right->IsStringFromCharCode()) {
|
| // Skip string-from-char-code, and use its input as right value.
|
| StringFromCharCodeInstr* right_instr = right->AsStringFromCharCode();
|
| - right_val = new(I) Value(right_instr->char_code()->definition());
|
| + right_val = new(Z) Value(right_instr->char_code()->definition());
|
| to_remove_right = right_instr;
|
| } else {
|
| const ICData& unary_checks_1 =
|
| - ICData::ZoneHandle(I, call->ic_data()->AsUnaryClassChecksForArgNr(1));
|
| + ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecksForArgNr(1));
|
| AddCheckClass(right,
|
| unary_checks_1,
|
| call->deopt_id(),
|
| @@ -1792,14 +1793,14 @@
|
| // String-to-char-code instructions returns -1 (illegal charcode) if
|
| // string is not of length one.
|
| StringToCharCodeInstr* char_code_right =
|
| - new(I) StringToCharCodeInstr(new(I) Value(right), kOneByteStringCid);
|
| + new(Z) StringToCharCodeInstr(new(Z) Value(right), kOneByteStringCid);
|
| InsertBefore(call, char_code_right, call->env(), FlowGraph::kValue);
|
| - right_val = new(I) Value(char_code_right);
|
| + right_val = new(Z) Value(char_code_right);
|
| }
|
|
|
| // Comparing char-codes instead of strings.
|
| EqualityCompareInstr* comp =
|
| - new(I) EqualityCompareInstr(call->token_pos(),
|
| + new(Z) EqualityCompareInstr(call->token_pos(),
|
| op_kind,
|
| left_val,
|
| right_val,
|
| @@ -1844,13 +1845,13 @@
|
| }
|
| } else if (HasOnlyTwoOf(ic_data, kSmiCid)) {
|
| InsertBefore(call,
|
| - new(I) CheckSmiInstr(new(I) Value(left),
|
| + new(Z) CheckSmiInstr(new(Z) Value(left),
|
| call->deopt_id(),
|
| call->token_pos()),
|
| call->env(),
|
| FlowGraph::kEffect);
|
| InsertBefore(call,
|
| - new(I) CheckSmiInstr(new(I) Value(right),
|
| + new(Z) CheckSmiInstr(new(Z) Value(right),
|
| call->deopt_id(),
|
| call->token_pos()),
|
| call->env(),
|
| @@ -1870,9 +1871,9 @@
|
| return false;
|
| } else {
|
| InsertBefore(call,
|
| - new(I) CheckEitherNonSmiInstr(
|
| - new(I) Value(left),
|
| - new(I) Value(right),
|
| + new(Z) CheckEitherNonSmiInstr(
|
| + new(Z) Value(left),
|
| + new(Z) Value(right),
|
| call->deopt_id()),
|
| call->env(),
|
| FlowGraph::kEffect);
|
| @@ -1890,7 +1891,7 @@
|
| smi_or_null,
|
| smi_or_null)) {
|
| const ICData& unary_checks_0 =
|
| - ICData::ZoneHandle(I, call->ic_data()->AsUnaryClassChecks());
|
| + ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecks());
|
| AddCheckClass(left,
|
| unary_checks_0,
|
| call->deopt_id(),
|
| @@ -1898,7 +1899,7 @@
|
| call);
|
|
|
| const ICData& unary_checks_1 =
|
| - ICData::ZoneHandle(I, call->ic_data()->AsUnaryClassChecksForArgNr(1));
|
| + ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecksForArgNr(1));
|
| AddCheckClass(right,
|
| unary_checks_1,
|
| call->deopt_id(),
|
| @@ -1912,10 +1913,10 @@
|
| if ((right_const != NULL && right_const->value().IsNull()) ||
|
| (left_const != NULL && left_const->value().IsNull())) {
|
| StrictCompareInstr* comp =
|
| - new(I) StrictCompareInstr(call->token_pos(),
|
| + new(Z) StrictCompareInstr(call->token_pos(),
|
| Token::kEQ_STRICT,
|
| - new(I) Value(left),
|
| - new(I) Value(right),
|
| + new(Z) Value(left),
|
| + new(Z) Value(right),
|
| false); // No number check.
|
| ReplaceCall(call, comp);
|
| return true;
|
| @@ -1924,10 +1925,10 @@
|
| }
|
| }
|
| ASSERT(cid != kIllegalCid);
|
| - EqualityCompareInstr* comp = new(I) EqualityCompareInstr(call->token_pos(),
|
| + EqualityCompareInstr* comp = new(Z) EqualityCompareInstr(call->token_pos(),
|
| op_kind,
|
| - new(I) Value(left),
|
| - new(I) Value(right),
|
| + new(Z) Value(left),
|
| + new(Z) Value(right),
|
| cid,
|
| call->deopt_id());
|
| ReplaceCall(call, comp);
|
| @@ -1947,13 +1948,13 @@
|
| intptr_t cid = kIllegalCid;
|
| if (HasOnlyTwoOf(ic_data, kSmiCid)) {
|
| InsertBefore(call,
|
| - new(I) CheckSmiInstr(new(I) Value(left),
|
| + new(Z) CheckSmiInstr(new(Z) Value(left),
|
| call->deopt_id(),
|
| call->token_pos()),
|
| call->env(),
|
| FlowGraph::kEffect);
|
| InsertBefore(call,
|
| - new(I) CheckSmiInstr(new(I) Value(right),
|
| + new(Z) CheckSmiInstr(new(Z) Value(right),
|
| call->deopt_id(),
|
| call->token_pos()),
|
| call->env(),
|
| @@ -1973,9 +1974,9 @@
|
| return false;
|
| } else {
|
| InsertBefore(call,
|
| - new(I) CheckEitherNonSmiInstr(
|
| - new(I) Value(left),
|
| - new(I) Value(right),
|
| + new(Z) CheckEitherNonSmiInstr(
|
| + new(Z) Value(left),
|
| + new(Z) Value(right),
|
| call->deopt_id()),
|
| call->env(),
|
| FlowGraph::kEffect);
|
| @@ -1986,10 +1987,10 @@
|
| return false;
|
| }
|
| ASSERT(cid != kIllegalCid);
|
| - RelationalOpInstr* comp = new(I) RelationalOpInstr(call->token_pos(),
|
| + RelationalOpInstr* comp = new(Z) RelationalOpInstr(call->token_pos(),
|
| op_kind,
|
| - new(I) Value(left),
|
| - new(I) Value(right),
|
| + new(Z) Value(left),
|
| + new(Z) Value(right),
|
| cid,
|
| call->deopt_id());
|
| ReplaceCall(call, comp);
|
| @@ -2069,7 +2070,7 @@
|
| ? kMintCid
|
| : kSmiCid;
|
| } else if (HasTwoMintOrSmi(ic_data) &&
|
| - HasOnlyOneSmi(ICData::Handle(I,
|
| + HasOnlyOneSmi(ICData::Handle(Z,
|
| ic_data.AsUnaryClassChecksForArgNr(1)))) {
|
| // Don't generate mint code if the IC data is marked because of an
|
| // overflow.
|
| @@ -2109,9 +2110,9 @@
|
| // returns a double for two smis.
|
| if (op_kind != Token::kDIV) {
|
| InsertBefore(call,
|
| - new(I) CheckEitherNonSmiInstr(
|
| - new(I) Value(left),
|
| - new(I) Value(right),
|
| + new(Z) CheckEitherNonSmiInstr(
|
| + new(Z) Value(left),
|
| + new(Z) Value(right),
|
| call->deopt_id()),
|
| call->env(),
|
| FlowGraph::kEffect);
|
| @@ -2118,9 +2119,9 @@
|
| }
|
|
|
| BinaryDoubleOpInstr* double_bin_op =
|
| - new(I) BinaryDoubleOpInstr(op_kind,
|
| - new(I) Value(left),
|
| - new(I) Value(right),
|
| + new(Z) BinaryDoubleOpInstr(op_kind,
|
| + new(Z) Value(left),
|
| + new(Z) Value(right),
|
| call->deopt_id(), call->token_pos());
|
| ReplaceCall(call, double_bin_op);
|
| } else if (operands_type == kMintCid) {
|
| @@ -2127,14 +2128,14 @@
|
| if (!FlowGraphCompiler::SupportsUnboxedMints()) return false;
|
| if ((op_kind == Token::kSHR) || (op_kind == Token::kSHL)) {
|
| ShiftMintOpInstr* shift_op =
|
| - new(I) ShiftMintOpInstr(
|
| - op_kind, new(I) Value(left), new(I) Value(right),
|
| + new(Z) ShiftMintOpInstr(
|
| + op_kind, new(Z) Value(left), new(Z) Value(right),
|
| call->deopt_id());
|
| ReplaceCall(call, shift_op);
|
| } else {
|
| BinaryMintOpInstr* bin_op =
|
| - new(I) BinaryMintOpInstr(
|
| - op_kind, new(I) Value(left), new(I) Value(right),
|
| + new(Z) BinaryMintOpInstr(
|
| + op_kind, new(Z) Value(left), new(Z) Value(right),
|
| call->deopt_id());
|
| ReplaceCall(call, bin_op);
|
| }
|
| @@ -2152,18 +2153,18 @@
|
| // Insert smi check and attach a copy of the original environment
|
| // because the smi operation can still deoptimize.
|
| InsertBefore(call,
|
| - new(I) CheckSmiInstr(new(I) Value(left),
|
| + new(Z) CheckSmiInstr(new(Z) Value(left),
|
| call->deopt_id(),
|
| call->token_pos()),
|
| call->env(),
|
| FlowGraph::kEffect);
|
| ConstantInstr* constant =
|
| - flow_graph()->GetConstant(Smi::Handle(I,
|
| + flow_graph()->GetConstant(Smi::Handle(Z,
|
| Smi::New(Smi::Cast(obj).Value() - 1)));
|
| BinarySmiOpInstr* bin_op =
|
| - new(I) BinarySmiOpInstr(Token::kBIT_AND,
|
| - new(I) Value(left),
|
| - new(I) Value(constant),
|
| + new(Z) BinarySmiOpInstr(Token::kBIT_AND,
|
| + new(Z) Value(left),
|
| + new(Z) Value(constant),
|
| call->deopt_id());
|
| ReplaceCall(call, bin_op);
|
| return true;
|
| @@ -2174,9 +2175,9 @@
|
| AddCheckSmi(left, call->deopt_id(), call->env(), call);
|
| AddCheckSmi(right, call->deopt_id(), call->env(), call);
|
| BinarySmiOpInstr* bin_op =
|
| - new(I) BinarySmiOpInstr(op_kind,
|
| - new(I) Value(left),
|
| - new(I) Value(right),
|
| + new(Z) BinarySmiOpInstr(op_kind,
|
| + new(Z) Value(left),
|
| + new(Z) Value(right),
|
| call->deopt_id());
|
| ReplaceCall(call, bin_op);
|
| } else {
|
| @@ -2193,10 +2194,10 @@
|
| right = temp;
|
| }
|
| BinarySmiOpInstr* bin_op =
|
| - new(I) BinarySmiOpInstr(
|
| + new(Z) BinarySmiOpInstr(
|
| op_kind,
|
| - new(I) Value(left),
|
| - new(I) Value(right),
|
| + new(Z) Value(left),
|
| + new(Z) Value(right),
|
| call->deopt_id());
|
| ReplaceCall(call, bin_op);
|
| }
|
| @@ -2211,24 +2212,24 @@
|
| Definition* unary_op = NULL;
|
| if (HasOnlyOneSmi(*call->ic_data())) {
|
| InsertBefore(call,
|
| - new(I) CheckSmiInstr(new(I) Value(input),
|
| + new(Z) CheckSmiInstr(new(Z) Value(input),
|
| call->deopt_id(),
|
| call->token_pos()),
|
| call->env(),
|
| FlowGraph::kEffect);
|
| - unary_op = new(I) UnarySmiOpInstr(
|
| - op_kind, new(I) Value(input), call->deopt_id());
|
| + unary_op = new(Z) UnarySmiOpInstr(
|
| + op_kind, new(Z) Value(input), call->deopt_id());
|
| } else if ((op_kind == Token::kBIT_NOT) &&
|
| HasOnlySmiOrMint(*call->ic_data()) &&
|
| FlowGraphCompiler::SupportsUnboxedMints()) {
|
| - unary_op = new(I) UnaryMintOpInstr(
|
| - op_kind, new(I) Value(input), call->deopt_id());
|
| + unary_op = new(Z) UnaryMintOpInstr(
|
| + op_kind, new(Z) Value(input), call->deopt_id());
|
| } else if (HasOnlyOneDouble(*call->ic_data()) &&
|
| (op_kind == Token::kNEGATE) &&
|
| CanUnboxDouble()) {
|
| AddReceiverCheck(call);
|
| - unary_op = new(I) UnaryDoubleOpInstr(
|
| - Token::kNEGATE, new(I) Value(input), call->deopt_id());
|
| + unary_op = new(Z) UnaryDoubleOpInstr(
|
| + Token::kNEGATE, new(Z) Value(input), call->deopt_id());
|
| } else {
|
| return false;
|
| }
|
| @@ -2267,9 +2268,9 @@
|
| callee_receiver->IsParameter() &&
|
| (callee_receiver->AsParameter()->index() == 0)) {
|
| const String& name = (kind == RawFunction::kMethodExtractor)
|
| - ? String::Handle(I, Field::NameFromGetter(call->function_name()))
|
| + ? String::Handle(Z, Field::NameFromGetter(call->function_name()))
|
| : call->function_name();
|
| - return isolate()->cha()->HasOverride(Class::Handle(I, function.Owner()),
|
| + return isolate()->cha()->HasOverride(Class::Handle(Z, function.Owner()),
|
| name);
|
| }
|
| return true;
|
| @@ -2280,24 +2281,24 @@
|
| ASSERT(call->HasICData());
|
| const ICData& ic_data = *call->ic_data();
|
| ASSERT(ic_data.HasOneTarget());
|
| - Function& target = Function::Handle(I);
|
| + Function& target = Function::Handle(Z);
|
| GrowableArray<intptr_t> class_ids;
|
| ic_data.GetCheckAt(0, &class_ids, &target);
|
| ASSERT(class_ids.length() == 1);
|
| // Inline implicit instance getter.
|
| const String& field_name =
|
| - String::Handle(I, Field::NameFromGetter(call->function_name()));
|
| + String::Handle(Z, Field::NameFromGetter(call->function_name()));
|
| const Field& field =
|
| - Field::ZoneHandle(I, GetField(class_ids[0], field_name));
|
| + Field::ZoneHandle(Z, GetField(class_ids[0], field_name));
|
| ASSERT(!field.IsNull());
|
|
|
| if (InstanceCallNeedsClassCheck(call, RawFunction::kImplicitGetter)) {
|
| AddReceiverCheck(call);
|
| }
|
| - LoadFieldInstr* load = new(I) LoadFieldInstr(
|
| - new(I) Value(call->ArgumentAt(0)),
|
| + LoadFieldInstr* load = new(Z) LoadFieldInstr(
|
| + new(Z) Value(call->ArgumentAt(0)),
|
| &field,
|
| - AbstractType::ZoneHandle(I, field.type()),
|
| + AbstractType::ZoneHandle(Z, field.type()),
|
| call->token_pos());
|
| load->set_is_immutable(field.is_final());
|
| if (field.guarded_cid() != kIllegalCid) {
|
| @@ -2330,7 +2331,7 @@
|
| }
|
| AddCheckClass(call->ArgumentAt(0),
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| @@ -2364,17 +2365,17 @@
|
| }
|
| }
|
| if (getter == MethodRecognizer::kFloat32x4GetSignMask) {
|
| - Simd32x4GetSignMaskInstr* instr = new(I) Simd32x4GetSignMaskInstr(
|
| + Simd32x4GetSignMaskInstr* instr = new(Z) Simd32x4GetSignMaskInstr(
|
| getter,
|
| - new(I) Value(call->ArgumentAt(0)),
|
| + new(Z) Value(call->ArgumentAt(0)),
|
| call->deopt_id());
|
| ReplaceCall(call, instr);
|
| return true;
|
| } else if (getter == MethodRecognizer::kFloat32x4ShuffleMix) {
|
| - Simd32x4ShuffleMixInstr* instr = new(I) Simd32x4ShuffleMixInstr(
|
| + Simd32x4ShuffleMixInstr* instr = new(Z) Simd32x4ShuffleMixInstr(
|
| getter,
|
| - new(I) Value(call->ArgumentAt(0)),
|
| - new(I) Value(call->ArgumentAt(1)),
|
| + new(Z) Value(call->ArgumentAt(0)),
|
| + new(Z) Value(call->ArgumentAt(1)),
|
| mask,
|
| call->deopt_id());
|
| ReplaceCall(call, instr);
|
| @@ -2385,9 +2386,9 @@
|
| (getter == MethodRecognizer::kFloat32x4ShuffleY) ||
|
| (getter == MethodRecognizer::kFloat32x4ShuffleZ) ||
|
| (getter == MethodRecognizer::kFloat32x4ShuffleW));
|
| - Simd32x4ShuffleInstr* instr = new(I) Simd32x4ShuffleInstr(
|
| + Simd32x4ShuffleInstr* instr = new(Z) Simd32x4ShuffleInstr(
|
| getter,
|
| - new(I) Value(call->ArgumentAt(0)),
|
| + new(Z) Value(call->ArgumentAt(0)),
|
| mask,
|
| call->deopt_id());
|
| ReplaceCall(call, instr);
|
| @@ -2405,15 +2406,15 @@
|
| }
|
| AddCheckClass(call->ArgumentAt(0),
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| if ((getter == MethodRecognizer::kFloat64x2GetX) ||
|
| (getter == MethodRecognizer::kFloat64x2GetY)) {
|
| - Simd64x2ShuffleInstr* instr = new(I) Simd64x2ShuffleInstr(
|
| + Simd64x2ShuffleInstr* instr = new(Z) Simd64x2ShuffleInstr(
|
| getter,
|
| - new(I) Value(call->ArgumentAt(0)),
|
| + new(Z) Value(call->ArgumentAt(0)),
|
| 0,
|
| call->deopt_id());
|
| ReplaceCall(call, instr);
|
| @@ -2431,7 +2432,7 @@
|
| }
|
| AddCheckClass(call->ArgumentAt(0),
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| @@ -2465,33 +2466,33 @@
|
| }
|
| }
|
| if (getter == MethodRecognizer::kInt32x4GetSignMask) {
|
| - Simd32x4GetSignMaskInstr* instr = new(I) Simd32x4GetSignMaskInstr(
|
| + Simd32x4GetSignMaskInstr* instr = new(Z) Simd32x4GetSignMaskInstr(
|
| getter,
|
| - new(I) Value(call->ArgumentAt(0)),
|
| + new(Z) Value(call->ArgumentAt(0)),
|
| call->deopt_id());
|
| ReplaceCall(call, instr);
|
| return true;
|
| } else if (getter == MethodRecognizer::kInt32x4ShuffleMix) {
|
| - Simd32x4ShuffleMixInstr* instr = new(I) Simd32x4ShuffleMixInstr(
|
| + Simd32x4ShuffleMixInstr* instr = new(Z) Simd32x4ShuffleMixInstr(
|
| getter,
|
| - new(I) Value(call->ArgumentAt(0)),
|
| - new(I) Value(call->ArgumentAt(1)),
|
| + new(Z) Value(call->ArgumentAt(0)),
|
| + new(Z) Value(call->ArgumentAt(1)),
|
| mask,
|
| call->deopt_id());
|
| ReplaceCall(call, instr);
|
| return true;
|
| } else if (getter == MethodRecognizer::kInt32x4Shuffle) {
|
| - Simd32x4ShuffleInstr* instr = new(I) Simd32x4ShuffleInstr(
|
| + Simd32x4ShuffleInstr* instr = new(Z) Simd32x4ShuffleInstr(
|
| getter,
|
| - new(I) Value(call->ArgumentAt(0)),
|
| + new(Z) Value(call->ArgumentAt(0)),
|
| mask,
|
| call->deopt_id());
|
| ReplaceCall(call, instr);
|
| return true;
|
| } else {
|
| - Int32x4GetFlagInstr* instr = new(I) Int32x4GetFlagInstr(
|
| + Int32x4GetFlagInstr* instr = new(Z) Int32x4GetFlagInstr(
|
| getter,
|
| - new(I) Value(call->ArgumentAt(0)),
|
| + new(Z) Value(call->ArgumentAt(0)),
|
| call->deopt_id());
|
| ReplaceCall(call, instr);
|
| return true;
|
| @@ -2510,7 +2511,7 @@
|
| // Type check left.
|
| AddCheckClass(left,
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| @@ -2517,14 +2518,14 @@
|
| // Type check right.
|
| AddCheckClass(right,
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(1)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(1)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| // Replace call.
|
| BinaryFloat32x4OpInstr* float32x4_bin_op =
|
| - new(I) BinaryFloat32x4OpInstr(
|
| - op_kind, new(I) Value(left), new(I) Value(right),
|
| + new(Z) BinaryFloat32x4OpInstr(
|
| + op_kind, new(Z) Value(left), new(Z) Value(right),
|
| call->deopt_id());
|
| ReplaceCall(call, float32x4_bin_op);
|
|
|
| @@ -2543,13 +2544,13 @@
|
| // Type check left.
|
| AddCheckClass(left,
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| // Type check right.
|
| AddCheckClass(right,
|
| - ICData::ZoneHandle(I,
|
| + ICData::ZoneHandle(Z,
|
| call->ic_data()->AsUnaryClassChecksForArgNr(1)),
|
| call->deopt_id(),
|
| call->env(),
|
| @@ -2556,8 +2557,8 @@
|
| call);
|
| // Replace call.
|
| BinaryInt32x4OpInstr* int32x4_bin_op =
|
| - new(I) BinaryInt32x4OpInstr(
|
| - op_kind, new(I) Value(left), new(I) Value(right),
|
| + new(Z) BinaryInt32x4OpInstr(
|
| + op_kind, new(Z) Value(left), new(Z) Value(right),
|
| call->deopt_id());
|
| ReplaceCall(call, int32x4_bin_op);
|
| return true;
|
| @@ -2588,8 +2589,8 @@
|
| call);
|
| // Replace call.
|
| BinaryFloat64x2OpInstr* float64x2_bin_op =
|
| - new(I) BinaryFloat64x2OpInstr(
|
| - op_kind, new(I) Value(left), new(I) Value(right),
|
| + new(Z) BinaryFloat64x2OpInstr(
|
| + op_kind, new(Z) Value(left), new(Z) Value(right),
|
| call->deopt_id());
|
| ReplaceCall(call, float64x2_bin_op);
|
| return true;
|
| @@ -2611,7 +2612,7 @@
|
| return false;
|
| }
|
|
|
| - const Function& target = Function::Handle(I, ic_data.GetTargetAt(0));
|
| + const Function& target = Function::Handle(Z, ic_data.GetTargetAt(0));
|
| if (target.kind() != RawFunction::kImplicitGetter) {
|
| // Non-implicit getters are inlined like normal methods by conventional
|
| // inlining in FlowGraphInliner.
|
| @@ -2624,7 +2625,7 @@
|
|
|
| bool FlowGraphOptimizer::TryReplaceInstanceCallWithInline(
|
| InstanceCallInstr* call) {
|
| - Function& target = Function::Handle(I);
|
| + Function& target = Function::Handle(Z);
|
| GrowableArray<intptr_t> class_ids;
|
| call->ic_data()->GetCheckAt(0, &class_ids, &target);
|
| const intptr_t receiver_cid = class_ids[0];
|
| @@ -2674,8 +2675,8 @@
|
| Instruction* cursor) {
|
|
|
| cursor = flow_graph()->AppendTo(cursor,
|
| - new(I) CheckSmiInstr(
|
| - new(I) Value(index),
|
| + new(Z) CheckSmiInstr(
|
| + new(Z) Value(index),
|
| call->deopt_id(),
|
| call->token_pos()),
|
| call->env(),
|
| @@ -2685,10 +2686,10 @@
|
| // Treat length loads as mutable (i.e. affected by side effects) to avoid
|
| // hoisting them since we can't hoist the preceding class-check. This
|
| // is because of externalization of strings that affects their class-id.
|
| - LoadFieldInstr* length = new(I) LoadFieldInstr(
|
| - new(I) Value(str),
|
| + LoadFieldInstr* length = new(Z) LoadFieldInstr(
|
| + new(Z) Value(str),
|
| String::length_offset(),
|
| - Type::ZoneHandle(I, Type::SmiType()),
|
| + Type::ZoneHandle(Z, Type::SmiType()),
|
| str->token_pos());
|
| length->set_result_cid(kSmiCid);
|
| length->set_recognized_kind(MethodRecognizer::kStringBaseLength);
|
| @@ -2696,16 +2697,16 @@
|
| cursor = flow_graph()->AppendTo(cursor, length, NULL, FlowGraph::kValue);
|
| // Bounds check.
|
| cursor = flow_graph()->AppendTo(cursor,
|
| - new(I) CheckArrayBoundInstr(
|
| - new(I) Value(length),
|
| - new(I) Value(index),
|
| + new(Z) CheckArrayBoundInstr(
|
| + new(Z) Value(length),
|
| + new(Z) Value(index),
|
| call->deopt_id()),
|
| call->env(),
|
| FlowGraph::kEffect);
|
|
|
| - LoadIndexedInstr* load_indexed = new(I) LoadIndexedInstr(
|
| - new(I) Value(str),
|
| - new(I) Value(index),
|
| + LoadIndexedInstr* load_indexed = new(Z) LoadIndexedInstr(
|
| + new(Z) Value(str),
|
| + new(Z) Value(index),
|
| Instance::ElementSizeFor(cid),
|
| cid,
|
| Isolate::kNoDeoptId,
|
| @@ -2733,7 +2734,7 @@
|
| Definition* str = call->ArgumentAt(0);
|
| Definition* index = call->ArgumentAt(1);
|
|
|
| - *entry = new(I) TargetEntryInstr(flow_graph()->allocate_block_id(),
|
| + *entry = new(Z) TargetEntryInstr(flow_graph()->allocate_block_id(),
|
| call->GetBlock()->try_index());
|
| (*entry)->InheritDeoptTarget(I, call);
|
|
|
| @@ -2755,14 +2756,14 @@
|
| Definition* str = call->ArgumentAt(0);
|
| Definition* index = call->ArgumentAt(1);
|
|
|
| - *entry = new(I) TargetEntryInstr(flow_graph()->allocate_block_id(),
|
| + *entry = new(Z) TargetEntryInstr(flow_graph()->allocate_block_id(),
|
| call->GetBlock()->try_index());
|
| (*entry)->InheritDeoptTarget(I, call);
|
|
|
| *last = PrepareInlineStringIndexOp(call, cid, str, index, *entry);
|
|
|
| - StringFromCharCodeInstr* char_at = new(I) StringFromCharCodeInstr(
|
| - new(I) Value(*last), cid);
|
| + StringFromCharCodeInstr* char_at = new(Z) StringFromCharCodeInstr(
|
| + new(Z) Value(*last), cid);
|
|
|
| flow_graph()->AppendTo(*last, char_at, NULL, FlowGraph::kValue);
|
| *last = char_at;
|
| @@ -2779,14 +2780,14 @@
|
| Definition* left = call->ArgumentAt(0);
|
| Definition* right = call->ArgumentAt(1);
|
|
|
| - *entry = new(I) TargetEntryInstr(flow_graph()->allocate_block_id(),
|
| + *entry = new(Z) TargetEntryInstr(flow_graph()->allocate_block_id(),
|
| call->GetBlock()->try_index());
|
| (*entry)->InheritDeoptTarget(I, call);
|
| // Arguments are checked. No need for class check.
|
| BinaryDoubleOpInstr* double_bin_op =
|
| - new(I) BinaryDoubleOpInstr(op_kind,
|
| - new(I) Value(left),
|
| - new(I) Value(right),
|
| + new(Z) BinaryDoubleOpInstr(op_kind,
|
| + new(Z) Value(left),
|
| + new(Z) Value(right),
|
| call->deopt_id(), call->token_pos());
|
| flow_graph()->AppendTo(*entry, double_bin_op, call->env(), FlowGraph::kValue);
|
| *last = double_bin_op;
|
| @@ -2800,12 +2801,12 @@
|
| MethodRecognizer::Kind recognized_kind) {
|
| AddReceiverCheck(call);
|
| ZoneGrowableArray<Value*>* args =
|
| - new(I) ZoneGrowableArray<Value*>(call->ArgumentCount());
|
| + new(Z) ZoneGrowableArray<Value*>(call->ArgumentCount());
|
| for (intptr_t i = 0; i < call->ArgumentCount(); i++) {
|
| - args->Add(new(I) Value(call->ArgumentAt(i)));
|
| + args->Add(new(Z) Value(call->ArgumentAt(i)));
|
| }
|
| InvokeMathCFunctionInstr* invoke =
|
| - new(I) InvokeMathCFunctionInstr(args,
|
| + new(Z) InvokeMathCFunctionInstr(args,
|
| call->deopt_id(),
|
| recognized_kind,
|
| call->token_pos());
|
| @@ -2844,7 +2845,7 @@
|
| return false;
|
| }
|
|
|
| - Function& target = Function::Handle(I);
|
| + Function& target = Function::Handle(Z);
|
| GrowableArray<intptr_t> class_ids;
|
| ic_data.GetCheckAt(0, &class_ids, &target);
|
| MethodRecognizer::Kind recognized_kind =
|
| @@ -2856,10 +2857,10 @@
|
| // This is an internal method, no need to check argument types.
|
| Definition* array = call->ArgumentAt(0);
|
| Definition* value = call->ArgumentAt(1);
|
| - StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr(
|
| + StoreInstanceFieldInstr* store = new(Z) StoreInstanceFieldInstr(
|
| GrowableObjectArray::data_offset(),
|
| - new(I) Value(array),
|
| - new(I) Value(value),
|
| + new(Z) Value(array),
|
| + new(Z) Value(value),
|
| kEmitStoreBarrier,
|
| call->token_pos());
|
| ReplaceCall(call, store);
|
| @@ -2873,10 +2874,10 @@
|
| // range.
|
| Definition* array = call->ArgumentAt(0);
|
| Definition* value = call->ArgumentAt(1);
|
| - StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr(
|
| + StoreInstanceFieldInstr* store = new(Z) StoreInstanceFieldInstr(
|
| GrowableObjectArray::length_offset(),
|
| - new(I) Value(array),
|
| - new(I) Value(value),
|
| + new(Z) Value(array),
|
| + new(Z) Value(value),
|
| kNoStoreBarrier,
|
| call->token_pos());
|
| ReplaceCall(call, store);
|
| @@ -2898,10 +2899,10 @@
|
| Definition* str = call->ArgumentAt(0);
|
| Definition* index = call->ArgumentAt(1);
|
| Definition* value = call->ArgumentAt(2);
|
| - StoreIndexedInstr* store_op = new(I) StoreIndexedInstr(
|
| - new(I) Value(str),
|
| - new(I) Value(index),
|
| - new(I) Value(value),
|
| + StoreIndexedInstr* store_op = new(Z) StoreIndexedInstr(
|
| + new(Z) Value(str),
|
| + new(Z) Value(index),
|
| + new(Z) Value(value),
|
| kNoStoreBarrier,
|
| 1, // Index scale
|
| kOneByteStringCid,
|
| @@ -2919,14 +2920,14 @@
|
| if (class_ids[0] == kSmiCid) {
|
| AddReceiverCheck(call);
|
| ReplaceCall(call,
|
| - new(I) SmiToDoubleInstr(
|
| - new(I) Value(call->ArgumentAt(0)),
|
| + new(Z) SmiToDoubleInstr(
|
| + new(Z) Value(call->ArgumentAt(0)),
|
| call->token_pos()));
|
| return true;
|
| } else if ((class_ids[0] == kMintCid) && CanConvertUnboxedMintToDouble()) {
|
| AddReceiverCheck(call);
|
| ReplaceCall(call,
|
| - new(I) MintToDoubleInstr(new(I) Value(call->ArgumentAt(0)),
|
| + new(Z) MintToDoubleInstr(new(Z) Value(call->ArgumentAt(0)),
|
| call->deopt_id()));
|
| return true;
|
| }
|
| @@ -2945,12 +2946,12 @@
|
| Definition* d2i_instr = NULL;
|
| if (ic_data.HasDeoptReason(ICData::kDeoptDoubleToSmi)) {
|
| // Do not repeatedly deoptimize because result didn't fit into Smi.
|
| - d2i_instr = new(I) DoubleToIntegerInstr(
|
| - new(I) Value(input), call);
|
| + d2i_instr = new(Z) DoubleToIntegerInstr(
|
| + new(Z) Value(input), call);
|
| } else {
|
| // Optimistically assume result fits into Smi.
|
| - d2i_instr = new(I) DoubleToSmiInstr(
|
| - new(I) Value(input), call->deopt_id());
|
| + d2i_instr = new(Z) DoubleToSmiInstr(
|
| + new(Z) Value(input), call->deopt_id());
|
| }
|
| ReplaceCall(call, d2i_instr);
|
| return true;
|
| @@ -2967,7 +2968,7 @@
|
| } else {
|
| AddReceiverCheck(call);
|
| DoubleToDoubleInstr* d2d_instr =
|
| - new(I) DoubleToDoubleInstr(new(I) Value(call->ArgumentAt(0)),
|
| + new(Z) DoubleToDoubleInstr(new(Z) Value(call->ArgumentAt(0)),
|
| recognized_kind, call->deopt_id());
|
| ReplaceCall(call, d2d_instr);
|
| }
|
| @@ -3090,9 +3091,9 @@
|
| return false;
|
| }
|
| BinarySmiOpInstr* left_shift =
|
| - new(I) BinarySmiOpInstr(Token::kSHL,
|
| - new(I) Value(value),
|
| - new(I) Value(count),
|
| + new(Z) BinarySmiOpInstr(Token::kSHL,
|
| + new(Z) Value(value),
|
| + new(Z) Value(count),
|
| call->deopt_id());
|
| left_shift->mark_truncating();
|
| if ((kBitsPerWord == 32) && (mask_value == 0xffffffffLL)) {
|
| @@ -3101,9 +3102,9 @@
|
| } else {
|
| InsertBefore(call, left_shift, call->env(), FlowGraph::kValue);
|
| BinarySmiOpInstr* bit_and =
|
| - new(I) BinarySmiOpInstr(Token::kBIT_AND,
|
| - new(I) Value(left_shift),
|
| - new(I) Value(int32_mask),
|
| + new(Z) BinarySmiOpInstr(Token::kBIT_AND,
|
| + new(Z) Value(left_shift),
|
| + new(Z) Value(int32_mask),
|
| call->deopt_id());
|
| ReplaceCall(call, bit_and);
|
| }
|
| @@ -3111,7 +3112,7 @@
|
| }
|
|
|
| if (HasTwoMintOrSmi(ic_data) &&
|
| - HasOnlyOneSmi(ICData::Handle(I,
|
| + HasOnlyOneSmi(ICData::Handle(Z,
|
| ic_data.AsUnaryClassChecksForArgNr(1)))) {
|
| if (!FlowGraphCompiler::SupportsUnboxedMints() ||
|
| ic_data.HasDeoptReason(ICData::kDeoptBinaryMintOp)) {
|
| @@ -3118,15 +3119,15 @@
|
| return false;
|
| }
|
| ShiftMintOpInstr* left_shift =
|
| - new(I) ShiftMintOpInstr(Token::kSHL,
|
| - new(I) Value(value),
|
| - new(I) Value(count),
|
| + new(Z) ShiftMintOpInstr(Token::kSHL,
|
| + new(Z) Value(value),
|
| + new(Z) Value(count),
|
| call->deopt_id());
|
| InsertBefore(call, left_shift, call->env(), FlowGraph::kValue);
|
| BinaryMintOpInstr* bit_and =
|
| - new(I) BinaryMintOpInstr(Token::kBIT_AND,
|
| - new(I) Value(left_shift),
|
| - new(I) Value(int32_mask),
|
| + new(Z) BinaryMintOpInstr(Token::kBIT_AND,
|
| + new(Z) Value(left_shift),
|
| + new(Z) Value(int32_mask),
|
| call->deopt_id());
|
| ReplaceCall(call, bit_and);
|
| return true;
|
| @@ -3143,35 +3144,35 @@
|
| return false;
|
| }
|
| if (recognized_kind == MethodRecognizer::kFloat32x4Zero) {
|
| - Float32x4ZeroInstr* zero = new(I) Float32x4ZeroInstr();
|
| + Float32x4ZeroInstr* zero = new(Z) Float32x4ZeroInstr();
|
| ReplaceCall(call, zero);
|
| return true;
|
| } else if (recognized_kind == MethodRecognizer::kFloat32x4Splat) {
|
| Float32x4SplatInstr* splat =
|
| - new(I) Float32x4SplatInstr(
|
| - new(I) Value(call->ArgumentAt(1)), call->deopt_id());
|
| + new(Z) Float32x4SplatInstr(
|
| + new(Z) Value(call->ArgumentAt(1)), call->deopt_id());
|
| ReplaceCall(call, splat);
|
| return true;
|
| } else if (recognized_kind == MethodRecognizer::kFloat32x4Constructor) {
|
| Float32x4ConstructorInstr* con =
|
| - new(I) Float32x4ConstructorInstr(
|
| - new(I) Value(call->ArgumentAt(1)),
|
| - new(I) Value(call->ArgumentAt(2)),
|
| - new(I) Value(call->ArgumentAt(3)),
|
| - new(I) Value(call->ArgumentAt(4)),
|
| + new(Z) Float32x4ConstructorInstr(
|
| + new(Z) Value(call->ArgumentAt(1)),
|
| + new(Z) Value(call->ArgumentAt(2)),
|
| + new(Z) Value(call->ArgumentAt(3)),
|
| + new(Z) Value(call->ArgumentAt(4)),
|
| call->deopt_id());
|
| ReplaceCall(call, con);
|
| return true;
|
| } else if (recognized_kind == MethodRecognizer::kFloat32x4FromInt32x4Bits) {
|
| Int32x4ToFloat32x4Instr* cast =
|
| - new(I) Int32x4ToFloat32x4Instr(
|
| - new(I) Value(call->ArgumentAt(1)), call->deopt_id());
|
| + new(Z) Int32x4ToFloat32x4Instr(
|
| + new(Z) Value(call->ArgumentAt(1)), call->deopt_id());
|
| ReplaceCall(call, cast);
|
| return true;
|
| } else if (recognized_kind == MethodRecognizer::kFloat32x4FromFloat64x2) {
|
| Float64x2ToFloat32x4Instr* cast =
|
| - new(I) Float64x2ToFloat32x4Instr(
|
| - new(I) Value(call->ArgumentAt(1)), call->deopt_id());
|
| + new(Z) Float64x2ToFloat32x4Instr(
|
| + new(Z) Value(call->ArgumentAt(1)), call->deopt_id());
|
| ReplaceCall(call, cast);
|
| return true;
|
| }
|
| @@ -3186,27 +3187,27 @@
|
| return false;
|
| }
|
| if (recognized_kind == MethodRecognizer::kFloat64x2Zero) {
|
| - Float64x2ZeroInstr* zero = new(I) Float64x2ZeroInstr();
|
| + Float64x2ZeroInstr* zero = new(Z) Float64x2ZeroInstr();
|
| ReplaceCall(call, zero);
|
| return true;
|
| } else if (recognized_kind == MethodRecognizer::kFloat64x2Splat) {
|
| Float64x2SplatInstr* splat =
|
| - new(I) Float64x2SplatInstr(
|
| - new(I) Value(call->ArgumentAt(1)), call->deopt_id());
|
| + new(Z) Float64x2SplatInstr(
|
| + new(Z) Value(call->ArgumentAt(1)), call->deopt_id());
|
| ReplaceCall(call, splat);
|
| return true;
|
| } else if (recognized_kind == MethodRecognizer::kFloat64x2Constructor) {
|
| Float64x2ConstructorInstr* con =
|
| - new(I) Float64x2ConstructorInstr(
|
| - new(I) Value(call->ArgumentAt(1)),
|
| - new(I) Value(call->ArgumentAt(2)),
|
| + new(Z) Float64x2ConstructorInstr(
|
| + new(Z) Value(call->ArgumentAt(1)),
|
| + new(Z) Value(call->ArgumentAt(2)),
|
| call->deopt_id());
|
| ReplaceCall(call, con);
|
| return true;
|
| } else if (recognized_kind == MethodRecognizer::kFloat64x2FromFloat32x4) {
|
| Float32x4ToFloat64x2Instr* cast =
|
| - new(I) Float32x4ToFloat64x2Instr(
|
| - new(I) Value(call->ArgumentAt(1)), call->deopt_id());
|
| + new(Z) Float32x4ToFloat64x2Instr(
|
| + new(Z) Value(call->ArgumentAt(1)), call->deopt_id());
|
| ReplaceCall(call, cast);
|
| return true;
|
| }
|
| @@ -3222,27 +3223,27 @@
|
| }
|
| if (recognized_kind == MethodRecognizer::kInt32x4BoolConstructor) {
|
| Int32x4BoolConstructorInstr* con =
|
| - new(I) Int32x4BoolConstructorInstr(
|
| - new(I) Value(call->ArgumentAt(1)),
|
| - new(I) Value(call->ArgumentAt(2)),
|
| - new(I) Value(call->ArgumentAt(3)),
|
| - new(I) Value(call->ArgumentAt(4)),
|
| + new(Z) Int32x4BoolConstructorInstr(
|
| + new(Z) Value(call->ArgumentAt(1)),
|
| + new(Z) Value(call->ArgumentAt(2)),
|
| + new(Z) Value(call->ArgumentAt(3)),
|
| + new(Z) Value(call->ArgumentAt(4)),
|
| call->deopt_id());
|
| ReplaceCall(call, con);
|
| return true;
|
| } else if (recognized_kind == MethodRecognizer::kInt32x4FromFloat32x4Bits) {
|
| Float32x4ToInt32x4Instr* cast =
|
| - new(I) Float32x4ToInt32x4Instr(
|
| - new(I) Value(call->ArgumentAt(1)), call->deopt_id());
|
| + new(Z) Float32x4ToInt32x4Instr(
|
| + new(Z) Value(call->ArgumentAt(1)), call->deopt_id());
|
| ReplaceCall(call, cast);
|
| return true;
|
| } else if (recognized_kind == MethodRecognizer::kInt32x4Constructor) {
|
| Int32x4ConstructorInstr* con =
|
| - new(I) Int32x4ConstructorInstr(
|
| - new(I) Value(call->ArgumentAt(1)),
|
| - new(I) Value(call->ArgumentAt(2)),
|
| - new(I) Value(call->ArgumentAt(3)),
|
| - new(I) Value(call->ArgumentAt(4)),
|
| + new(Z) Int32x4ConstructorInstr(
|
| + new(Z) Value(call->ArgumentAt(1)),
|
| + new(Z) Value(call->ArgumentAt(2)),
|
| + new(Z) Value(call->ArgumentAt(3)),
|
| + new(Z) Value(call->ArgumentAt(4)),
|
| call->deopt_id());
|
| ReplaceCall(call, con);
|
| return true;
|
| @@ -3279,15 +3280,15 @@
|
| // Type check left.
|
| AddCheckClass(left,
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| // Replace call.
|
| Float32x4ComparisonInstr* cmp =
|
| - new(I) Float32x4ComparisonInstr(recognized_kind,
|
| - new(I) Value(left),
|
| - new(I) Value(right),
|
| + new(Z) Float32x4ComparisonInstr(recognized_kind,
|
| + new(Z) Value(left),
|
| + new(Z) Value(right),
|
| call->deopt_id());
|
| ReplaceCall(call, cmp);
|
| return true;
|
| @@ -3299,15 +3300,15 @@
|
| // Type check left.
|
| AddCheckClass(left,
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| Float32x4MinMaxInstr* minmax =
|
| - new(I) Float32x4MinMaxInstr(
|
| + new(Z) Float32x4MinMaxInstr(
|
| recognized_kind,
|
| - new(I) Value(left),
|
| - new(I) Value(right),
|
| + new(Z) Value(left),
|
| + new(Z) Value(right),
|
| call->deopt_id());
|
| ReplaceCall(call, minmax);
|
| return true;
|
| @@ -3318,7 +3319,7 @@
|
| // Type check left.
|
| AddCheckClass(left,
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| @@ -3326,9 +3327,9 @@
|
| // this is done so that the double value is loaded into the output
|
| // register and can be destroyed.
|
| Float32x4ScaleInstr* scale =
|
| - new(I) Float32x4ScaleInstr(recognized_kind,
|
| - new(I) Value(right),
|
| - new(I) Value(left),
|
| + new(Z) Float32x4ScaleInstr(recognized_kind,
|
| + new(Z) Value(right),
|
| + new(Z) Value(left),
|
| call->deopt_id());
|
| ReplaceCall(call, scale);
|
| return true;
|
| @@ -3339,13 +3340,13 @@
|
| Definition* left = call->ArgumentAt(0);
|
| AddCheckClass(left,
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| Float32x4SqrtInstr* sqrt =
|
| - new(I) Float32x4SqrtInstr(recognized_kind,
|
| - new(I) Value(left),
|
| + new(Z) Float32x4SqrtInstr(recognized_kind,
|
| + new(Z) Value(left),
|
| call->deopt_id());
|
| ReplaceCall(call, sqrt);
|
| return true;
|
| @@ -3359,13 +3360,13 @@
|
| // Type check left.
|
| AddCheckClass(left,
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| - Float32x4WithInstr* with = new(I) Float32x4WithInstr(recognized_kind,
|
| - new(I) Value(left),
|
| - new(I) Value(right),
|
| + Float32x4WithInstr* with = new(Z) Float32x4WithInstr(recognized_kind,
|
| + new(Z) Value(left),
|
| + new(Z) Value(right),
|
| call->deopt_id());
|
| ReplaceCall(call, with);
|
| return true;
|
| @@ -3376,13 +3377,13 @@
|
| // Type check left.
|
| AddCheckClass(left,
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| Float32x4ZeroArgInstr* zeroArg =
|
| - new(I) Float32x4ZeroArgInstr(
|
| - recognized_kind, new(I) Value(left), call->deopt_id());
|
| + new(Z) Float32x4ZeroArgInstr(
|
| + recognized_kind, new(Z) Value(left), call->deopt_id());
|
| ReplaceCall(call, zeroArg);
|
| return true;
|
| }
|
| @@ -3393,14 +3394,14 @@
|
| // Type check left.
|
| AddCheckClass(left,
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| - Float32x4ClampInstr* clamp = new(I) Float32x4ClampInstr(
|
| - new(I) Value(left),
|
| - new(I) Value(lower),
|
| - new(I) Value(upper),
|
| + Float32x4ClampInstr* clamp = new(Z) Float32x4ClampInstr(
|
| + new(Z) Value(left),
|
| + new(Z) Value(lower),
|
| + new(Z) Value(upper),
|
| call->deopt_id());
|
| ReplaceCall(call, clamp);
|
| return true;
|
| @@ -3436,13 +3437,13 @@
|
| // Type check left.
|
| AddCheckClass(left,
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| Float64x2ZeroArgInstr* zeroArg =
|
| - new(I) Float64x2ZeroArgInstr(
|
| - recognized_kind, new(I) Value(left), call->deopt_id());
|
| + new(Z) Float64x2ZeroArgInstr(
|
| + recognized_kind, new(Z) Value(left), call->deopt_id());
|
| ReplaceCall(call, zeroArg);
|
| return true;
|
| }
|
| @@ -3456,14 +3457,14 @@
|
| // Type check left.
|
| AddCheckClass(left,
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| Float64x2OneArgInstr* zeroArg =
|
| - new(I) Float64x2OneArgInstr(recognized_kind,
|
| - new(I) Value(left),
|
| - new(I) Value(right),
|
| + new(Z) Float64x2OneArgInstr(recognized_kind,
|
| + new(Z) Value(left),
|
| + new(Z) Value(right),
|
| call->deopt_id());
|
| ReplaceCall(call, zeroArg);
|
| return true;
|
| @@ -3500,14 +3501,14 @@
|
| // Type check left.
|
| AddCheckClass(mask,
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| - Int32x4SelectInstr* select = new(I) Int32x4SelectInstr(
|
| - new(I) Value(mask),
|
| - new(I) Value(trueValue),
|
| - new(I) Value(falseValue),
|
| + Int32x4SelectInstr* select = new(Z) Int32x4SelectInstr(
|
| + new(Z) Value(mask),
|
| + new(Z) Value(trueValue),
|
| + new(Z) Value(falseValue),
|
| call->deopt_id());
|
| ReplaceCall(call, select);
|
| return true;
|
| @@ -3521,14 +3522,14 @@
|
| // Type check left.
|
| AddCheckClass(left,
|
| ICData::ZoneHandle(
|
| - I, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| + Z, call->ic_data()->AsUnaryClassChecksForArgNr(0)),
|
| call->deopt_id(),
|
| call->env(),
|
| call);
|
| - Int32x4SetFlagInstr* setFlag = new(I) Int32x4SetFlagInstr(
|
| + Int32x4SetFlagInstr* setFlag = new(Z) Int32x4SetFlagInstr(
|
| recognized_kind,
|
| - new(I) Value(left),
|
| - new(I) Value(flag),
|
| + new(Z) Value(left),
|
| + new(Z) Value(flag),
|
| call->deopt_id());
|
| ReplaceCall(call, setFlag);
|
| return true;
|
| @@ -3549,7 +3550,7 @@
|
| ASSERT(array_cid != kIllegalCid);
|
| Definition* array = receiver;
|
| Definition* index = call->ArgumentAt(1);
|
| - *entry = new(I) TargetEntryInstr(flow_graph()->allocate_block_id(),
|
| + *entry = new(Z) TargetEntryInstr(flow_graph()->allocate_block_id(),
|
| call->GetBlock()->try_index());
|
| (*entry)->InheritDeoptTarget(I, call);
|
| Instruction* cursor = *entry;
|
| @@ -3568,8 +3569,8 @@
|
| deopt_id = (kSmiBits >= 32) ? Isolate::kNoDeoptId : call->deopt_id();
|
| }
|
|
|
| - *last = new(I) LoadIndexedInstr(new(I) Value(array),
|
| - new(I) Value(index),
|
| + *last = new(Z) LoadIndexedInstr(new(Z) Value(array),
|
| + new(Z) Value(index),
|
| 1,
|
| view_cid,
|
| deopt_id,
|
| @@ -3581,7 +3582,7 @@
|
| FlowGraph::kValue);
|
|
|
| if (view_cid == kTypedDataFloat32ArrayCid) {
|
| - *last = new(I) FloatToDoubleInstr(new(I) Value(*last), deopt_id);
|
| + *last = new(Z) FloatToDoubleInstr(new(Z) Value(*last), deopt_id);
|
| flow_graph()->AppendTo(cursor,
|
| *last,
|
| deopt_id != Isolate::kNoDeoptId ? call->env() : NULL,
|
| @@ -3602,7 +3603,7 @@
|
| ASSERT(array_cid != kIllegalCid);
|
| Definition* array = receiver;
|
| Definition* index = call->ArgumentAt(1);
|
| - *entry = new(I) TargetEntryInstr(flow_graph()->allocate_block_id(),
|
| + *entry = new(Z) TargetEntryInstr(flow_graph()->allocate_block_id(),
|
| call->GetBlock()->try_index());
|
| (*entry)->InheritDeoptTarget(I, call);
|
| Instruction* cursor = *entry;
|
| @@ -3624,7 +3625,7 @@
|
| i_call = call->AsInstanceCall();
|
| }
|
| ASSERT(i_call != NULL);
|
| - ICData& value_check = ICData::ZoneHandle(I);
|
| + ICData& value_check = ICData::ZoneHandle(Z);
|
| switch (view_cid) {
|
| case kTypedDataInt8ArrayCid:
|
| case kTypedDataUint8ArrayCid:
|
| @@ -3697,16 +3698,16 @@
|
| }
|
|
|
| if (view_cid == kTypedDataFloat32ArrayCid) {
|
| - stored_value = new(I) DoubleToFloatInstr(
|
| - new(I) Value(stored_value), call->deopt_id());
|
| + stored_value = new(Z) DoubleToFloatInstr(
|
| + new(Z) Value(stored_value), call->deopt_id());
|
| cursor = flow_graph()->AppendTo(cursor,
|
| stored_value,
|
| NULL,
|
| FlowGraph::kValue);
|
| } else if (view_cid == kTypedDataInt32ArrayCid) {
|
| - stored_value = new(I) UnboxInt32Instr(
|
| + stored_value = new(Z) UnboxInt32Instr(
|
| UnboxInt32Instr::kTruncate,
|
| - new(I) Value(stored_value),
|
| + new(Z) Value(stored_value),
|
| call->deopt_id());
|
| cursor = flow_graph()->AppendTo(cursor,
|
| stored_value,
|
| @@ -3713,8 +3714,8 @@
|
| call->env(),
|
| FlowGraph::kValue);
|
| } else if (view_cid == kTypedDataUint32ArrayCid) {
|
| - stored_value = new(I) UnboxUint32Instr(
|
| - new(I) Value(stored_value),
|
| + stored_value = new(Z) UnboxUint32Instr(
|
| + new(Z) Value(stored_value),
|
| call->deopt_id());
|
| ASSERT(stored_value->AsUnboxInteger()->is_truncating());
|
| cursor = flow_graph()->AppendTo(cursor,
|
| @@ -3724,9 +3725,9 @@
|
| }
|
|
|
| StoreBarrierType needs_store_barrier = kNoStoreBarrier;
|
| - *last = new(I) StoreIndexedInstr(new(I) Value(array),
|
| - new(I) Value(index),
|
| - new(I) Value(stored_value),
|
| + *last = new(Z) StoreIndexedInstr(new(Z) Value(array),
|
| + new(Z) Value(index),
|
| + new(Z) Value(stored_value),
|
| needs_store_barrier,
|
| 1, // Index scale
|
| view_cid,
|
| @@ -3752,8 +3753,8 @@
|
| Instruction** cursor) {
|
| // Insert byte_index smi check.
|
| *cursor = flow_graph()->AppendTo(*cursor,
|
| - new(I) CheckSmiInstr(
|
| - new(I) Value(byte_index),
|
| + new(Z) CheckSmiInstr(
|
| + new(Z) Value(byte_index),
|
| call->deopt_id(),
|
| call->token_pos()),
|
| call->env(),
|
| @@ -3760,10 +3761,10 @@
|
| FlowGraph::kEffect);
|
|
|
| LoadFieldInstr* length =
|
| - new(I) LoadFieldInstr(
|
| - new(I) Value(*array),
|
| + new(Z) LoadFieldInstr(
|
| + new(Z) Value(*array),
|
| CheckArrayBoundInstr::LengthOffsetFor(array_cid),
|
| - Type::ZoneHandle(I, Type::SmiType()),
|
| + Type::ZoneHandle(Z, Type::SmiType()),
|
| call->token_pos());
|
| length->set_is_immutable(true);
|
| length->set_result_cid(kSmiCid);
|
| @@ -3776,11 +3777,11 @@
|
|
|
| intptr_t element_size = Instance::ElementSizeFor(array_cid);
|
| ConstantInstr* bytes_per_element =
|
| - flow_graph()->GetConstant(Smi::Handle(I, Smi::New(element_size)));
|
| + flow_graph()->GetConstant(Smi::Handle(Z, Smi::New(element_size)));
|
| BinarySmiOpInstr* len_in_bytes =
|
| - new(I) BinarySmiOpInstr(Token::kMUL,
|
| - new(I) Value(length),
|
| - new(I) Value(bytes_per_element),
|
| + new(Z) BinarySmiOpInstr(Token::kMUL,
|
| + new(Z) Value(length),
|
| + new(Z) Value(bytes_per_element),
|
| call->deopt_id());
|
| *cursor = flow_graph()->AppendTo(*cursor, len_in_bytes, call->env(),
|
| FlowGraph::kValue);
|
| @@ -3790,11 +3791,11 @@
|
| intptr_t adjustment = Instance::ElementSizeFor(view_cid) - 1;
|
| if (adjustment > 0) {
|
| ConstantInstr* length_adjustment =
|
| - flow_graph()->GetConstant(Smi::Handle(I, Smi::New(adjustment)));
|
| + flow_graph()->GetConstant(Smi::Handle(Z, Smi::New(adjustment)));
|
| adjusted_length =
|
| - new(I) BinarySmiOpInstr(Token::kSUB,
|
| - new(I) Value(len_in_bytes),
|
| - new(I) Value(length_adjustment),
|
| + new(Z) BinarySmiOpInstr(Token::kSUB,
|
| + new(Z) Value(len_in_bytes),
|
| + new(Z) Value(length_adjustment),
|
| call->deopt_id());
|
| *cursor = flow_graph()->AppendTo(*cursor, adjusted_length, call->env(),
|
| FlowGraph::kValue);
|
| @@ -3802,19 +3803,19 @@
|
|
|
| // Check adjusted_length > 0.
|
| ConstantInstr* zero =
|
| - flow_graph()->GetConstant(Smi::Handle(I, Smi::New(0)));
|
| + flow_graph()->GetConstant(Smi::Handle(Z, Smi::New(0)));
|
| *cursor = flow_graph()->AppendTo(*cursor,
|
| - new(I) CheckArrayBoundInstr(
|
| - new(I) Value(adjusted_length),
|
| - new(I) Value(zero),
|
| + new(Z) CheckArrayBoundInstr(
|
| + new(Z) Value(adjusted_length),
|
| + new(Z) Value(zero),
|
| call->deopt_id()),
|
| call->env(),
|
| FlowGraph::kEffect);
|
| // Check 0 <= byte_index < adjusted_length.
|
| *cursor = flow_graph()->AppendTo(*cursor,
|
| - new(I) CheckArrayBoundInstr(
|
| - new(I) Value(adjusted_length),
|
| - new(I) Value(byte_index),
|
| + new(Z) CheckArrayBoundInstr(
|
| + new(Z) Value(adjusted_length),
|
| + new(Z) Value(byte_index),
|
| call->deopt_id()),
|
| call->env(),
|
| FlowGraph::kEffect);
|
| @@ -3821,7 +3822,7 @@
|
|
|
| if (RawObject::IsExternalTypedDataClassId(array_cid)) {
|
| LoadUntaggedInstr* elements =
|
| - new(I) LoadUntaggedInstr(new(I) Value(*array),
|
| + new(Z) LoadUntaggedInstr(new(Z) Value(*array),
|
| ExternalTypedData::data_offset());
|
| *cursor = flow_graph()->AppendTo(*cursor,
|
| elements,
|
| @@ -3880,7 +3881,7 @@
|
| if (!type.IsInstantiated() || type.IsMalformedOrMalbounded()) {
|
| return Bool::null();
|
| }
|
| - const Class& type_class = Class::Handle(I, type.type_class());
|
| + const Class& type_class = Class::Handle(Z, type.type_class());
|
| const intptr_t num_type_args = type_class.NumTypeArguments();
|
| if (num_type_args > 0) {
|
| // Only raw types can be directly compared, thus disregarding type
|
| @@ -3888,7 +3889,7 @@
|
| const intptr_t num_type_params = type_class.NumTypeParameters();
|
| const intptr_t from_index = num_type_args - num_type_params;
|
| const TypeArguments& type_arguments =
|
| - TypeArguments::Handle(I, type.arguments());
|
| + TypeArguments::Handle(Z, type.arguments());
|
| const bool is_raw_type = type_arguments.IsNull() ||
|
| type_arguments.IsRaw(from_index, num_type_params);
|
| if (!is_raw_type) {
|
| @@ -3898,8 +3899,8 @@
|
| }
|
|
|
| const ClassTable& class_table = *isolate()->class_table();
|
| - Bool& prev = Bool::Handle(I);
|
| - Class& cls = Class::Handle(I);
|
| + Bool& prev = Bool::Handle(Z);
|
| + Class& cls = Class::Handle(Z);
|
|
|
| bool results_differ = false;
|
| for (int i = 0; i < ic_data.NumberOfChecks(); i++) {
|
| @@ -3908,9 +3909,9 @@
|
| return Bool::null();
|
| }
|
| const bool is_subtype = cls.IsSubtypeOf(
|
| - TypeArguments::Handle(I),
|
| + TypeArguments::Handle(Z),
|
| type_class,
|
| - TypeArguments::Handle(I),
|
| + TypeArguments::Handle(Z),
|
| NULL);
|
| results->Add(cls.id());
|
| results->Add(is_subtype);
|
| @@ -4022,7 +4023,7 @@
|
| const bool negate = Bool::Cast(
|
| call->ArgumentAt(4)->OriginalDefinition()->AsConstant()->value()).value();
|
| const ICData& unary_checks =
|
| - ICData::ZoneHandle(I, call->ic_data()->AsUnaryClassChecks());
|
| + ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecks());
|
| if (FLAG_warn_on_javascript_compatibility &&
|
| !unary_checks.IssuedJSWarning() &&
|
| (type.IsIntType() || type.IsDoubleType() || !type.IsInstantiated())) {
|
| @@ -4034,16 +4035,16 @@
|
| }
|
| if (unary_checks.NumberOfChecks() <= FLAG_max_polymorphic_checks) {
|
| ZoneGrowableArray<intptr_t>* results =
|
| - new(I) ZoneGrowableArray<intptr_t>(unary_checks.NumberOfChecks() * 2);
|
| + new(Z) ZoneGrowableArray<intptr_t>(unary_checks.NumberOfChecks() * 2);
|
| Bool& as_bool =
|
| - Bool::ZoneHandle(I, InstanceOfAsBool(unary_checks, type, results));
|
| + Bool::ZoneHandle(Z, InstanceOfAsBool(unary_checks, type, results));
|
| if (as_bool.IsNull()) {
|
| if (results->length() == unary_checks.NumberOfChecks() * 2) {
|
| const bool can_deopt = TryExpandTestCidsResult(results, type);
|
| - TestCidsInstr* test_cids = new(I) TestCidsInstr(
|
| + TestCidsInstr* test_cids = new(Z) TestCidsInstr(
|
| call->token_pos(),
|
| negate ? Token::kISNOT : Token::kIS,
|
| - new(I) Value(left),
|
| + new(Z) Value(left),
|
| *results,
|
| can_deopt ? call->deopt_id() : Isolate::kNoDeoptId);
|
| // Remove type.
|
| @@ -4071,21 +4072,21 @@
|
| }
|
|
|
| if (TypeCheckAsClassEquality(type)) {
|
| - LoadClassIdInstr* left_cid = new(I) LoadClassIdInstr(new(I) Value(left));
|
| + LoadClassIdInstr* left_cid = new(Z) LoadClassIdInstr(new(Z) Value(left));
|
| InsertBefore(call,
|
| left_cid,
|
| NULL,
|
| FlowGraph::kValue);
|
| - const intptr_t type_cid = Class::Handle(I, type.type_class()).id();
|
| + const intptr_t type_cid = Class::Handle(Z, type.type_class()).id();
|
| ConstantInstr* cid =
|
| - flow_graph()->GetConstant(Smi::Handle(I, Smi::New(type_cid)));
|
| + flow_graph()->GetConstant(Smi::Handle(Z, Smi::New(type_cid)));
|
|
|
| StrictCompareInstr* check_cid =
|
| - new(I) StrictCompareInstr(
|
| + new(Z) StrictCompareInstr(
|
| call->token_pos(),
|
| negate ? Token::kNE_STRICT : Token::kEQ_STRICT,
|
| - new(I) Value(left_cid),
|
| - new(I) Value(cid),
|
| + new(Z) Value(left_cid),
|
| + new(Z) Value(cid),
|
| false); // No number check.
|
| ReplaceCall(call, check_cid);
|
| return;
|
| @@ -4092,10 +4093,10 @@
|
| }
|
|
|
| InstanceOfInstr* instance_of =
|
| - new(I) InstanceOfInstr(call->token_pos(),
|
| - new(I) Value(left),
|
| - new(I) Value(instantiator),
|
| - new(I) Value(type_args),
|
| + new(Z) InstanceOfInstr(call->token_pos(),
|
| + new(Z) Value(left),
|
| + new(Z) Value(instantiator),
|
| + new(Z) Value(type_args),
|
| type,
|
| negate,
|
| call->deopt_id());
|
| @@ -4113,7 +4114,7 @@
|
| AbstractType::Cast(call->ArgumentAt(3)->AsConstant()->value());
|
| ASSERT(!type.IsMalformedOrMalbounded());
|
| const ICData& unary_checks =
|
| - ICData::ZoneHandle(I, call->ic_data()->AsUnaryClassChecks());
|
| + ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecks());
|
| if (FLAG_warn_on_javascript_compatibility &&
|
| !unary_checks.IssuedJSWarning() &&
|
| (type.IsIntType() || type.IsDoubleType() || !type.IsInstantiated())) {
|
| @@ -4125,8 +4126,8 @@
|
| }
|
| if (unary_checks.NumberOfChecks() <= FLAG_max_polymorphic_checks) {
|
| ZoneGrowableArray<intptr_t>* results =
|
| - new(I) ZoneGrowableArray<intptr_t>(unary_checks.NumberOfChecks() * 2);
|
| - const Bool& as_bool = Bool::ZoneHandle(I,
|
| + new(Z) ZoneGrowableArray<intptr_t>(unary_checks.NumberOfChecks() * 2);
|
| + const Bool& as_bool = Bool::ZoneHandle(Z,
|
| InstanceOfAsBool(unary_checks, type, results));
|
| if (as_bool.raw() == Bool::True().raw()) {
|
| AddReceiverCheck(call);
|
| @@ -4143,13 +4144,13 @@
|
| return;
|
| }
|
| }
|
| - const String& dst_name = String::ZoneHandle(I,
|
| + const String& dst_name = String::ZoneHandle(Z,
|
| Symbols::New(Exceptions::kCastErrorDstName));
|
| AssertAssignableInstr* assert_as =
|
| - new(I) AssertAssignableInstr(call->token_pos(),
|
| - new(I) Value(left),
|
| - new(I) Value(instantiator),
|
| - new(I) Value(type_args),
|
| + new(Z) AssertAssignableInstr(call->token_pos(),
|
| + new(Z) Value(left),
|
| + new(Z) Value(instantiator),
|
| + new(Z) Value(type_args),
|
| type,
|
| dst_name,
|
| call->deopt_id());
|
| @@ -4177,7 +4178,7 @@
|
| }
|
|
|
| const ICData& unary_checks =
|
| - ICData::ZoneHandle(I, instr->ic_data()->AsUnaryClassChecks());
|
| + ICData::ZoneHandle(Z, instr->ic_data()->AsUnaryClassChecks());
|
|
|
| const intptr_t max_checks = (op_kind == Token::kEQ)
|
| ? FLAG_max_equality_polymorphic_checks
|
| @@ -4230,7 +4231,7 @@
|
| // Check if the single target is a polymorphic target, if it is,
|
| // we don't have one target.
|
| const Function& target =
|
| - Function::Handle(I, unary_checks.GetTargetAt(0));
|
| + Function::Handle(Z, unary_checks.GetTargetAt(0));
|
| const bool polymorphic_target = MethodRecognizer::PolymorphicTarget(target);
|
| has_one_target = !polymorphic_target;
|
| }
|
| @@ -4237,11 +4238,11 @@
|
|
|
| if (has_one_target) {
|
| RawFunction::Kind function_kind =
|
| - Function::Handle(I, unary_checks.GetTargetAt(0)).kind();
|
| + Function::Handle(Z, unary_checks.GetTargetAt(0)).kind();
|
| if (!InstanceCallNeedsClassCheck(instr, function_kind)) {
|
| const bool call_with_checks = false;
|
| PolymorphicInstanceCallInstr* call =
|
| - new(I) PolymorphicInstanceCallInstr(instr, unary_checks,
|
| + new(Z) PolymorphicInstanceCallInstr(instr, unary_checks,
|
| call_with_checks);
|
| instr->ReplaceWith(call, current_iterator());
|
| return;
|
| @@ -4259,7 +4260,7 @@
|
| call_with_checks = true;
|
| }
|
| PolymorphicInstanceCallInstr* call =
|
| - new(I) PolymorphicInstanceCallInstr(instr, unary_checks,
|
| + new(Z) PolymorphicInstanceCallInstr(instr, unary_checks,
|
| call_with_checks);
|
| instr->ReplaceWith(call, current_iterator());
|
| }
|
| @@ -4289,8 +4290,8 @@
|
| }
|
| if (unary_kind != MathUnaryInstr::kIllegal) {
|
| MathUnaryInstr* math_unary =
|
| - new(I) MathUnaryInstr(unary_kind,
|
| - new(I) Value(call->ArgumentAt(0)),
|
| + new(Z) MathUnaryInstr(unary_kind,
|
| + new(Z) Value(call->ArgumentAt(0)),
|
| call->deopt_id());
|
| ReplaceCall(call, math_unary);
|
| } else if ((recognized_kind == MethodRecognizer::kFloat32x4Zero) ||
|
| @@ -4331,14 +4332,14 @@
|
| result_cid = kSmiCid;
|
| }
|
| if (result_cid != kIllegalCid) {
|
| - MathMinMaxInstr* min_max = new(I) MathMinMaxInstr(
|
| + MathMinMaxInstr* min_max = new(Z) MathMinMaxInstr(
|
| recognized_kind,
|
| - new(I) Value(call->ArgumentAt(0)),
|
| - new(I) Value(call->ArgumentAt(1)),
|
| + new(Z) Value(call->ArgumentAt(0)),
|
| + new(Z) Value(call->ArgumentAt(1)),
|
| call->deopt_id(),
|
| result_cid);
|
| const ICData& unary_checks =
|
| - ICData::ZoneHandle(I, ic_data.AsUnaryClassChecks());
|
| + ICData::ZoneHandle(Z, ic_data.AsUnaryClassChecks());
|
| AddCheckClass(min_max->left()->definition(),
|
| unary_checks,
|
| call->deopt_id(),
|
| @@ -4357,12 +4358,12 @@
|
| // InvokeMathCFunctionInstr requires unboxed doubles. UnboxDouble
|
| // instructions contain type checks and conversions to double.
|
| ZoneGrowableArray<Value*>* args =
|
| - new(I) ZoneGrowableArray<Value*>(call->ArgumentCount());
|
| + new(Z) ZoneGrowableArray<Value*>(call->ArgumentCount());
|
| for (intptr_t i = 0; i < call->ArgumentCount(); i++) {
|
| - args->Add(new(I) Value(call->ArgumentAt(i)));
|
| + args->Add(new(Z) Value(call->ArgumentAt(i)));
|
| }
|
| InvokeMathCFunctionInstr* invoke =
|
| - new(I) InvokeMathCFunctionInstr(args,
|
| + new(Z) InvokeMathCFunctionInstr(args,
|
| call->deopt_id(),
|
| recognized_kind,
|
| call->token_pos());
|
| @@ -4375,13 +4376,13 @@
|
| Definition* arg = call->ArgumentAt(1);
|
| AddCheckSmi(arg, call->deopt_id(), call->env(), call);
|
| ReplaceCall(call,
|
| - new(I) SmiToDoubleInstr(new(I) Value(arg),
|
| + new(Z) SmiToDoubleInstr(new(Z) Value(arg),
|
| call->token_pos()));
|
| } else if (ArgIsAlways(kMintCid, ic_data, 1) &&
|
| CanConvertUnboxedMintToDouble()) {
|
| Definition* arg = call->ArgumentAt(1);
|
| ReplaceCall(call,
|
| - new(I) MintToDoubleInstr(new(I) Value(arg),
|
| + new(Z) MintToDoubleInstr(new(Z) Value(arg),
|
| call->deopt_id()));
|
| }
|
| }
|
| @@ -4388,20 +4389,20 @@
|
| }
|
| } else if (call->function().IsFactory()) {
|
| const Class& function_class =
|
| - Class::Handle(I, call->function().Owner());
|
| + Class::Handle(Z, call->function().Owner());
|
| if ((function_class.library() == Library::CoreLibrary()) ||
|
| (function_class.library() == Library::TypedDataLibrary())) {
|
| intptr_t cid = FactoryRecognizer::ResultCid(call->function());
|
| switch (cid) {
|
| case kArrayCid: {
|
| - Value* type = new(I) Value(call->ArgumentAt(0));
|
| - Value* num_elements = new(I) Value(call->ArgumentAt(1));
|
| + Value* type = new(Z) Value(call->ArgumentAt(0));
|
| + Value* num_elements = new(Z) Value(call->ArgumentAt(1));
|
| if (num_elements->BindsToConstant() &&
|
| num_elements->BoundConstant().IsSmi()) {
|
| intptr_t length = Smi::Cast(num_elements->BoundConstant()).Value();
|
| if (length >= 0 && length <= Array::kMaxElements) {
|
| CreateArrayInstr* create_array =
|
| - new(I) CreateArrayInstr(
|
| + new(Z) CreateArrayInstr(
|
| call->token_pos(), type, num_elements);
|
| ReplaceCall(call, create_array);
|
| }
|
| @@ -4424,13 +4425,13 @@
|
| // usage count of at least 1/kGetterSetterRatio of the getter usage count.
|
| // This is to avoid unboxing fields where the setter is never or rarely
|
| // executed.
|
| - const Field& field = Field::ZoneHandle(I, instr->field().raw());
|
| - const String& field_name = String::Handle(I, field.name());
|
| - const Class& owner = Class::Handle(I, field.owner());
|
| + const Field& field = Field::ZoneHandle(Z, instr->field().raw());
|
| + const String& field_name = String::Handle(Z, field.name());
|
| + const Class& owner = Class::Handle(Z, field.owner());
|
| const Function& getter =
|
| - Function::Handle(I, owner.LookupGetterFunction(field_name));
|
| + Function::Handle(Z, owner.LookupGetterFunction(field_name));
|
| const Function& setter =
|
| - Function::Handle(I, owner.LookupSetterFunction(field_name));
|
| + Function::Handle(Z, owner.LookupSetterFunction(field_name));
|
| bool result = !getter.IsNull()
|
| && !setter.IsNull()
|
| && (setter.usage_counter() > 0)
|
| @@ -4458,7 +4459,7 @@
|
| instr->ReplaceWith(replacement, current_iterator());
|
|
|
| StoreInstanceFieldInstr* store =
|
| - new(I) StoreInstanceFieldInstr(Context::parent_offset(),
|
| + new(Z) StoreInstanceFieldInstr(Context::parent_offset(),
|
| new Value(replacement),
|
| new Value(flow_graph_->constant_null()),
|
| kNoStoreBarrier,
|
| @@ -4470,7 +4471,7 @@
|
| Definition* cursor = store;
|
| for (intptr_t i = 0; i < instr->num_context_variables(); ++i) {
|
| store =
|
| - new(I) StoreInstanceFieldInstr(Context::variable_offset(i),
|
| + new(Z) StoreInstanceFieldInstr(Context::variable_offset(i),
|
| new Value(replacement),
|
| new Value(flow_graph_->constant_null()),
|
| kNoStoreBarrier,
|
| @@ -4513,7 +4514,7 @@
|
| // inlining.
|
| return false;
|
| }
|
| - Function& target = Function::Handle(I);
|
| + Function& target = Function::Handle(Z);
|
| intptr_t class_id;
|
| unary_ic_data.GetOneClassCheckAt(0, &class_id, &target);
|
| if (target.kind() != RawFunction::kImplicitSetter) {
|
| @@ -4522,9 +4523,9 @@
|
| }
|
| // Inline implicit instance setter.
|
| const String& field_name =
|
| - String::Handle(I, Field::NameFromSetter(instr->function_name()));
|
| + String::Handle(Z, Field::NameFromSetter(instr->function_name()));
|
| const Field& field =
|
| - Field::ZoneHandle(I, GetField(class_id, field_name));
|
| + Field::ZoneHandle(Z, GetField(class_id, field_name));
|
| ASSERT(!field.IsNull());
|
|
|
| if (InstanceCallNeedsClassCheck(instr, RawFunction::kImplicitSetter)) {
|
| @@ -4533,8 +4534,8 @@
|
| StoreBarrierType needs_store_barrier = kEmitStoreBarrier;
|
| if (ArgIsAlways(kSmiCid, *instr->ic_data(), 1)) {
|
| InsertBefore(instr,
|
| - new(I) CheckSmiInstr(
|
| - new(I) Value(instr->ArgumentAt(1)),
|
| + new(Z) CheckSmiInstr(
|
| + new(Z) Value(instr->ArgumentAt(1)),
|
| instr->deopt_id(),
|
| instr->token_pos()),
|
| instr->env(),
|
| @@ -4544,8 +4545,8 @@
|
|
|
| if (field.guarded_cid() != kDynamicCid) {
|
| InsertBefore(instr,
|
| - new(I) GuardFieldClassInstr(
|
| - new(I) Value(instr->ArgumentAt(1)),
|
| + new(Z) GuardFieldClassInstr(
|
| + new(Z) Value(instr->ArgumentAt(1)),
|
| field,
|
| instr->deopt_id()),
|
| instr->env(),
|
| @@ -4554,8 +4555,8 @@
|
|
|
| if (field.needs_length_check()) {
|
| InsertBefore(instr,
|
| - new(I) GuardFieldLengthInstr(
|
| - new(I) Value(instr->ArgumentAt(1)),
|
| + new(Z) GuardFieldLengthInstr(
|
| + new(Z) Value(instr->ArgumentAt(1)),
|
| field,
|
| instr->deopt_id()),
|
| instr->env(),
|
| @@ -4563,10 +4564,10 @@
|
| }
|
|
|
| // Field guard was detached.
|
| - StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr(
|
| + StoreInstanceFieldInstr* store = new(Z) StoreInstanceFieldInstr(
|
| field,
|
| - new(I) Value(instr->ArgumentAt(0)),
|
| - new(I) Value(instr->ArgumentAt(1)),
|
| + new(Z) Value(instr->ArgumentAt(0)),
|
| + new(Z) Value(instr->ArgumentAt(1)),
|
| needs_store_barrier,
|
| instr->token_pos());
|
|
|
| @@ -4662,7 +4663,7 @@
|
| // BitVector containing SSA indexes of all processed definitions. Used to skip
|
| // those candidates that belong to dependency graph of another candidate.
|
| BitVector* processed =
|
| - new(I) BitVector(I, flow_graph_->current_ssa_temp_index());
|
| + new(Z) BitVector(Z, flow_graph_->current_ssa_temp_index());
|
|
|
| // Worklist used to collect dependency graph.
|
| DefinitionWorklist worklist(flow_graph_, candidates.length());
|
| @@ -4786,7 +4787,7 @@
|
|
|
| if (defn->IsBinarySmiOp()) {
|
| BinarySmiOpInstr* smi_op = defn->AsBinarySmiOp();
|
| - BinaryInt32OpInstr* int32_op = new(I) BinaryInt32OpInstr(
|
| + BinaryInt32OpInstr* int32_op = new(Z) BinaryInt32OpInstr(
|
| smi_op->op_kind(),
|
| smi_op->left()->CopyWithType(),
|
| smi_op->right()->CopyWithType(),
|
| @@ -5212,9 +5213,9 @@
|
| }
|
|
|
| // Create object representing *[*] alias.
|
| - static Place* CreateAnyInstanceAnyIndexAlias(Isolate* isolate,
|
| + static Place* CreateAnyInstanceAnyIndexAlias(Zone* zone,
|
| intptr_t id) {
|
| - return Wrap(isolate, Place(kIndexed, NULL, 0), id);
|
| + return Wrap(zone, Place(kIndexed, NULL, 0), id);
|
| }
|
|
|
| // Return least generic alias for this place. Given that aliases are
|
| @@ -5366,7 +5367,7 @@
|
| }
|
|
|
| // Create a zone allocated copy of this place and assign given id to it.
|
| - static Place* Wrap(Isolate* isolate, const Place& place, intptr_t id);
|
| + static Place* Wrap(Zone* zone, const Place& place, intptr_t id);
|
|
|
| static bool IsAllocation(Definition* defn) {
|
| return (defn != NULL) &&
|
| @@ -5433,8 +5434,8 @@
|
| };
|
|
|
|
|
| -Place* Place::Wrap(Isolate* isolate, const Place& place, intptr_t id) {
|
| - Place* wrapped = (new(isolate) ZonePlace(place))->place();
|
| +Place* Place::Wrap(Zone* zone, const Place& place, intptr_t id) {
|
| + Place* wrapped = (new(zone) ZonePlace(place))->place();
|
| wrapped->id_ = id;
|
| return wrapped;
|
| }
|
| @@ -5490,11 +5491,11 @@
|
| // those that are affected by calls.
|
| class AliasedSet : public ZoneAllocated {
|
| public:
|
| - AliasedSet(Isolate* isolate,
|
| + AliasedSet(Zone* zone,
|
| DirectChainedHashMap<PointerKeyValueTrait<Place> >* places_map,
|
| ZoneGrowableArray<Place*>* places,
|
| PhiPlaceMoves* phi_moves)
|
| - : isolate_(isolate),
|
| + : zone_(zone),
|
| places_map_(places_map),
|
| places_(*places),
|
| phi_moves_(phi_moves),
|
| @@ -5502,8 +5503,8 @@
|
| aliases_map_(),
|
| representatives_(),
|
| killed_(),
|
| - aliased_by_effects_(new(isolate) BitVector(isolate, places->length())) {
|
| - InsertAlias(Place::CreateAnyInstanceAnyIndexAlias(isolate_,
|
| + aliased_by_effects_(new(zone) BitVector(zone, places->length())) {
|
| + InsertAlias(Place::CreateAnyInstanceAnyIndexAlias(zone_,
|
| kAnyInstanceAnyIndexAlias));
|
| for (intptr_t i = 0; i < places_.length(); i++) {
|
| AddRepresentative(places_[i]);
|
| @@ -5651,7 +5652,7 @@
|
| const Place* CanonicalizeAlias(const Place& alias) {
|
| const Place* canonical = aliases_map_.Lookup(&alias);
|
| if (canonical == NULL) {
|
| - canonical = Place::Wrap(isolate_,
|
| + canonical = Place::Wrap(zone_,
|
| alias,
|
| kAnyInstanceAnyIndexAlias + aliases_.length());
|
| InsertAlias(canonical);
|
| @@ -5671,7 +5672,7 @@
|
|
|
| BitVector* set = (*sets)[alias];
|
| if (set == NULL) {
|
| - (*sets)[alias] = set = new(isolate_) BitVector(isolate_, max_place_id());
|
| + (*sets)[alias] = set = new(zone_) BitVector(zone_, max_place_id());
|
| }
|
| return set;
|
| }
|
| @@ -5904,7 +5905,7 @@
|
| }
|
| }
|
|
|
| - Isolate* isolate_;
|
| + Zone* zone_;
|
|
|
| DirectChainedHashMap<PointerKeyValueTrait<Place> >* places_map_;
|
|
|
| @@ -5977,8 +5978,10 @@
|
| static PhiPlaceMoves* ComputePhiMoves(
|
| DirectChainedHashMap<PointerKeyValueTrait<Place> >* map,
|
| ZoneGrowableArray<Place*>* places) {
|
| - Isolate* isolate = Isolate::Current();
|
| - PhiPlaceMoves* phi_moves = new(isolate) PhiPlaceMoves();
|
| + Thread* thread = Thread::Current();
|
| + Isolate* isolate = thread->isolate();
|
| + Zone* zone = thread->zone();
|
| + PhiPlaceMoves* phi_moves = new(zone) PhiPlaceMoves();
|
|
|
| for (intptr_t i = 0; i < places->length(); i++) {
|
| Place* place = (*places)[i];
|
| @@ -5997,7 +6000,7 @@
|
|
|
| Place* result = map->Lookup(&input_place);
|
| if (result == NULL) {
|
| - result = Place::Wrap(isolate, input_place, places->length());
|
| + result = Place::Wrap(zone, input_place, places->length());
|
| map->Insert(result);
|
| places->Add(result);
|
| if (FLAG_trace_optimization) {
|
| @@ -6030,9 +6033,9 @@
|
| CSEMode mode) {
|
| // Loads representing different expression ids will be collected and
|
| // used to build per offset kill sets.
|
| - Isolate* isolate = graph->isolate();
|
| + Zone* zone = graph->zone();
|
| ZoneGrowableArray<Place*>* places =
|
| - new(isolate) ZoneGrowableArray<Place*>(10);
|
| + new(zone) ZoneGrowableArray<Place*>(10);
|
|
|
| bool has_loads = false;
|
| bool has_stores = false;
|
| @@ -6052,7 +6055,7 @@
|
|
|
| Place* result = map->Lookup(&place);
|
| if (result == NULL) {
|
| - result = Place::Wrap(isolate, place, places->length());
|
| + result = Place::Wrap(zone, place, places->length());
|
| map->Insert(result);
|
| places->Add(result);
|
|
|
| @@ -6077,7 +6080,7 @@
|
| PhiPlaceMoves* phi_moves = ComputePhiMoves(map, places);
|
|
|
| // Build aliasing sets mapping aliases to loads.
|
| - return new(isolate) AliasedSet(isolate, map, places, phi_moves);
|
| + return new(zone) AliasedSet(zone, map, places, phi_moves);
|
| }
|
|
|
|
|
| @@ -6100,9 +6103,9 @@
|
| const intptr_t num_blocks = graph_->preorder().length();
|
| for (intptr_t i = 0; i < num_blocks; i++) {
|
| out_.Add(NULL);
|
| - gen_.Add(new(I) BitVector(I, aliased_set_->max_place_id()));
|
| - kill_.Add(new(I) BitVector(I, aliased_set_->max_place_id()));
|
| - in_.Add(new(I) BitVector(I, aliased_set_->max_place_id()));
|
| + gen_.Add(new(Z) BitVector(Z, aliased_set_->max_place_id()));
|
| + kill_.Add(new(Z) BitVector(Z, aliased_set_->max_place_id()));
|
| + in_.Add(new(Z) BitVector(Z, aliased_set_->max_place_id()));
|
|
|
| exposed_values_.Add(NULL);
|
| out_values_.Add(NULL);
|
| @@ -6114,6 +6117,7 @@
|
| }
|
|
|
| Isolate* isolate() const { return graph_->isolate(); }
|
| + Zone* zone() const { return graph_->zone(); }
|
|
|
| static bool OptimizeGraph(FlowGraph* graph) {
|
| ASSERT(FLAG_load_cse);
|
| @@ -6340,7 +6344,7 @@
|
| // the block entry.
|
| if (exposed_values == NULL) {
|
| static const intptr_t kMaxExposedValuesInitialSize = 5;
|
| - exposed_values = new(I) ZoneGrowableArray<Definition*>(
|
| + exposed_values = new(Z) ZoneGrowableArray<Definition*>(
|
| Utils::Minimum(kMaxExposedValuesInitialSize,
|
| aliased_set_->max_place_id()));
|
| }
|
| @@ -6388,10 +6392,10 @@
|
| // Compute OUT sets by propagating them iteratively until fix point
|
| // is reached.
|
| void ComputeOutSets() {
|
| - BitVector* temp = new(I) BitVector(I, aliased_set_->max_place_id());
|
| + BitVector* temp = new(Z) BitVector(Z, aliased_set_->max_place_id());
|
| BitVector* forwarded_loads =
|
| - new(I) BitVector(I, aliased_set_->max_place_id());
|
| - BitVector* temp_out = new(I) BitVector(I, aliased_set_->max_place_id());
|
| + new(Z) BitVector(Z, aliased_set_->max_place_id());
|
| + BitVector* temp_out = new(Z) BitVector(Z, aliased_set_->max_place_id());
|
|
|
| bool changed = true;
|
| while (changed) {
|
| @@ -6443,7 +6447,7 @@
|
| if ((block_out == NULL) || !block_out->Equals(*temp)) {
|
| if (block_out == NULL) {
|
| block_out = out_[preorder_number] =
|
| - new(I) BitVector(I, aliased_set_->max_place_id());
|
| + new(Z) BitVector(Z, aliased_set_->max_place_id());
|
| }
|
| block_out->CopyFrom(temp);
|
| changed = true;
|
| @@ -6496,7 +6500,7 @@
|
| MergeIncomingValues(block, place_id) : NULL;
|
| if ((in_value == NULL) &&
|
| (in_[preorder_number]->Contains(place_id))) {
|
| - PhiInstr* phi = new(I) PhiInstr(block->AsJoinEntry(),
|
| + PhiInstr* phi = new(Z) PhiInstr(block->AsJoinEntry(),
|
| block->PredecessorCount());
|
| phi->set_place_id(place_id);
|
| pending_phis.Add(phi);
|
| @@ -6570,7 +6574,7 @@
|
| graph_->LoopHeaders();
|
|
|
| ZoneGrowableArray<BitVector*>* invariant_loads =
|
| - new(I) ZoneGrowableArray<BitVector*>(loop_headers.length());
|
| + new(Z) ZoneGrowableArray<BitVector*>(loop_headers.length());
|
|
|
| for (intptr_t i = 0; i < loop_headers.length(); i++) {
|
| BlockEntryInstr* header = loop_headers[i];
|
| @@ -6580,7 +6584,7 @@
|
| continue;
|
| }
|
|
|
| - BitVector* loop_gen = new(I) BitVector(I, aliased_set_->max_place_id());
|
| + BitVector* loop_gen = new(Z) BitVector(Z, aliased_set_->max_place_id());
|
| for (BitVector::Iterator loop_it(header->loop_info());
|
| !loop_it.Done();
|
| loop_it.Advance()) {
|
| @@ -6636,7 +6640,7 @@
|
| }
|
|
|
| // Incoming values are different. Phi is required to merge.
|
| - PhiInstr* phi = new(I) PhiInstr(
|
| + PhiInstr* phi = new(Z) PhiInstr(
|
| block->AsJoinEntry(), block->PredecessorCount());
|
| phi->set_place_id(place_id);
|
| FillPhiInputs(phi);
|
| @@ -6659,7 +6663,7 @@
|
| // To prevent using them we additionally mark definitions themselves
|
| // as replaced and store a pointer to the replacement.
|
| Definition* replacement = (*pred_out_values)[place_id]->Replacement();
|
| - Value* input = new(I) Value(replacement);
|
| + Value* input = new(Z) Value(replacement);
|
| phi->SetInputAt(i, input);
|
| replacement->AddInputUse(input);
|
| }
|
| @@ -6732,7 +6736,7 @@
|
|
|
| worklist_.Clear();
|
| if (in_worklist_ == NULL) {
|
| - in_worklist_ = new(I) BitVector(I, graph_->current_ssa_temp_index());
|
| + in_worklist_ = new(Z) BitVector(Z, graph_->current_ssa_temp_index());
|
| } else {
|
| in_worklist_->Clear();
|
| }
|
| @@ -6855,7 +6859,7 @@
|
|
|
| congruency_worklist_.Clear();
|
| if (in_worklist_ == NULL) {
|
| - in_worklist_ = new(I) BitVector(I, graph_->current_ssa_temp_index());
|
| + in_worklist_ = new(Z) BitVector(Z, graph_->current_ssa_temp_index());
|
| } else {
|
| in_worklist_->Clear();
|
| }
|
| @@ -6960,7 +6964,7 @@
|
|
|
| ZoneGrowableArray<Definition*>* CreateBlockOutValues() {
|
| ZoneGrowableArray<Definition*>* out =
|
| - new(I) ZoneGrowableArray<Definition*>(aliased_set_->max_place_id());
|
| + new(Z) ZoneGrowableArray<Definition*>(aliased_set_->max_place_id());
|
| for (intptr_t i = 0; i < aliased_set_->max_place_id(); i++) {
|
| out->Add(NULL);
|
| }
|
| @@ -7066,8 +7070,8 @@
|
| }
|
|
|
| virtual void ComputeInitialSets() {
|
| - Isolate* isolate = graph_->isolate();
|
| - BitVector* all_places = new(isolate) BitVector(isolate,
|
| + Zone* zone = graph_->zone();
|
| + BitVector* all_places = new(zone) BitVector(zone,
|
| aliased_set_->max_place_id());
|
| all_places->SetAll();
|
| for (BlockIterator block_it = graph_->postorder_iterator();
|
| @@ -7113,7 +7117,7 @@
|
| // candidates for the global store elimination.
|
| if (exposed_stores == NULL) {
|
| const intptr_t kMaxExposedStoresInitialSize = 5;
|
| - exposed_stores = new(isolate) ZoneGrowableArray<Instruction*>(
|
| + exposed_stores = new(zone) ZoneGrowableArray<Instruction*>(
|
| Utils::Minimum(kMaxExposedStoresInitialSize,
|
| aliased_set_->max_place_id()));
|
| }
|
| @@ -8223,7 +8227,7 @@
|
| Definition* alloc,
|
| const ZoneGrowableArray<const Object*>& slots) {
|
| ZoneGrowableArray<Value*>* values =
|
| - new(I) ZoneGrowableArray<Value*>(slots.length());
|
| + new(Z) ZoneGrowableArray<Value*>(slots.length());
|
|
|
| // All loads should be inserted before the first materialization so that
|
| // IR follows the following pattern: loads, materializations, deoptimizing
|
| @@ -8233,28 +8237,28 @@
|
| // Insert load instruction for every field.
|
| for (intptr_t i = 0; i < slots.length(); i++) {
|
| LoadFieldInstr* load = slots[i]->IsField()
|
| - ? new(I) LoadFieldInstr(
|
| - new(I) Value(alloc),
|
| + ? new(Z) LoadFieldInstr(
|
| + new(Z) Value(alloc),
|
| &Field::Cast(*slots[i]),
|
| - AbstractType::ZoneHandle(I),
|
| + AbstractType::ZoneHandle(Z),
|
| alloc->token_pos())
|
| - : new(I) LoadFieldInstr(
|
| - new(I) Value(alloc),
|
| + : new(Z) LoadFieldInstr(
|
| + new(Z) Value(alloc),
|
| Smi::Cast(*slots[i]).Value(),
|
| - AbstractType::ZoneHandle(I),
|
| + AbstractType::ZoneHandle(Z),
|
| alloc->token_pos());
|
| flow_graph_->InsertBefore(
|
| load_point, load, NULL, FlowGraph::kValue);
|
| - values->Add(new(I) Value(load));
|
| + values->Add(new(Z) Value(load));
|
| }
|
|
|
| MaterializeObjectInstr* mat = NULL;
|
| if (alloc->IsAllocateObject()) {
|
| - mat = new(I) MaterializeObjectInstr(
|
| + mat = new(Z) MaterializeObjectInstr(
|
| alloc->AsAllocateObject(), slots, values);
|
| } else {
|
| ASSERT(alloc->IsAllocateUninitializedContext());
|
| - mat = new(I) MaterializeObjectInstr(
|
| + mat = new(Z) MaterializeObjectInstr(
|
| alloc->AsAllocateUninitializedContext(), slots, values);
|
| }
|
|
|
| @@ -8278,7 +8282,7 @@
|
| // Mark MaterializeObject as an environment use of this allocation.
|
| // This will allow us to discover it when we are looking for deoptimization
|
| // exits for another allocation that potentially flows into this one.
|
| - Value* val = new(I) Value(alloc);
|
| + Value* val = new(Z) Value(alloc);
|
| val->set_instruction(mat);
|
| alloc->AddEnvUse(val);
|
|
|
| @@ -8353,7 +8357,7 @@
|
| void AllocationSinking::InsertMaterializations(Definition* alloc) {
|
| // Collect all fields that are written for this instance.
|
| ZoneGrowableArray<const Object*>* slots =
|
| - new(I) ZoneGrowableArray<const Object*>(5);
|
| + new(Z) ZoneGrowableArray<const Object*>(5);
|
|
|
| for (Value* use = alloc->input_use_list();
|
| use != NULL;
|
| @@ -8363,7 +8367,7 @@
|
| if (!store->field().IsNull()) {
|
| AddSlot(slots, store->field());
|
| } else {
|
| - AddSlot(slots, Smi::ZoneHandle(I, Smi::New(store->offset_in_bytes())));
|
| + AddSlot(slots, Smi::ZoneHandle(Z, Smi::New(store->offset_in_bytes())));
|
| }
|
| }
|
| }
|
| @@ -8373,7 +8377,7 @@
|
| ASSERT(alloc_object->ArgumentCount() == 1);
|
| intptr_t type_args_offset =
|
| alloc_object->cls().type_arguments_field_offset();
|
| - AddSlot(slots, Smi::ZoneHandle(I, Smi::New(type_args_offset)));
|
| + AddSlot(slots, Smi::ZoneHandle(Z, Smi::New(type_args_offset)));
|
| }
|
|
|
| // Collect all instructions that mention this object in the environment.
|
|
|