Index: runtime/vm/intermediate_language_x64.cc |
=================================================================== |
--- runtime/vm/intermediate_language_x64.cc (revision 27208) |
+++ runtime/vm/intermediate_language_x64.cc (working copy) |
@@ -96,20 +96,8 @@ |
__ Bind(&done); |
} |
#endif |
- __ LeaveFrame(); |
- __ ret(); |
- // Generate 8 bytes of NOPs so that the debugger can patch the |
- // return pattern with a call to the debug stub. |
- // Note that the nop(8) byte pattern is not recognized by the debugger. |
- __ nop(1); |
- __ nop(1); |
- __ nop(1); |
- __ nop(1); |
- __ nop(1); |
- __ nop(1); |
- __ nop(1); |
- __ nop(1); |
+ __ ReturnPatchable(); |
compiler->AddCurrentDescriptor(PcDescriptors::kReturn, |
Isolate::kNoDeoptId, |
token_pos()); |
@@ -465,12 +453,11 @@ |
const Array& kNoArgumentNames = Object::null_array(); |
const int kNumArgumentsChecked = 2; |
- const Immediate& raw_null = |
- Immediate(reinterpret_cast<intptr_t>(Object::null())); |
Label check_identity; |
- __ cmpq(Address(RSP, 0 * kWordSize), raw_null); |
+ __ LoadObject(TMP, Object::Handle()); |
+ __ cmpq(Address(RSP, 0 * kWordSize), TMP); |
__ j(EQUAL, &check_identity); |
- __ cmpq(Address(RSP, 1 * kWordSize), raw_null); |
+ __ cmpq(Address(RSP, 1 * kWordSize), TMP); |
__ j(EQUAL, &check_identity); |
ICData& equality_ic_data = ICData::ZoneHandle(original_ic_data.raw()); |
@@ -666,12 +653,11 @@ |
__ testq(left, Immediate(kSmiTagMask)); |
__ j(ZERO, deopt); |
// 'left' is not Smi. |
- const Immediate& raw_null = |
- Immediate(reinterpret_cast<intptr_t>(Object::null())); |
+ |
Label identity_compare; |
- __ cmpq(right, raw_null); |
+ __ CompareObject(right, Object::Handle()); |
__ j(EQUAL, &identity_compare); |
- __ cmpq(left, raw_null); |
+ __ CompareObject(left, Object::Handle()); |
__ j(EQUAL, &identity_compare); |
__ LoadClassId(temp, left); |
@@ -718,12 +704,11 @@ |
ASSERT(!ic_data.IsNull() && (ic_data.NumberOfChecks() > 0)); |
Register left = locs->in(0).reg(); |
Register right = locs->in(1).reg(); |
- const Immediate& raw_null = |
- Immediate(reinterpret_cast<intptr_t>(Object::null())); |
+ |
Label done, identity_compare, non_null_compare; |
- __ cmpq(right, raw_null); |
+ __ CompareObject(right, Object::Handle()); |
__ j(EQUAL, &identity_compare, Assembler::kNearJump); |
- __ cmpq(left, raw_null); |
+ __ CompareObject(left, Object::Handle()); |
__ j(NOT_EQUAL, &non_null_compare, Assembler::kNearJump); |
// Comparison with NULL is "===". |
__ Bind(&identity_compare); |
@@ -1709,9 +1694,7 @@ |
if (field().is_nullable() && (field_cid != kNullCid)) { |
__ j(EQUAL, &ok); |
- const Immediate& raw_null = |
- Immediate(reinterpret_cast<intptr_t>(Object::null())); |
- __ cmpq(value_reg, raw_null); |
+ __ CompareObject(value_reg, Object::Handle()); |
} |
if (ok_is_fall_through) { |
@@ -1990,9 +1973,7 @@ |
Label type_arguments_instantiated; |
const intptr_t len = type_arguments().Length(); |
if (type_arguments().IsRawInstantiatedRaw(len)) { |
- const Immediate& raw_null = |
- Immediate(reinterpret_cast<intptr_t>(Object::null())); |
- __ cmpq(instantiator_reg, raw_null); |
+ __ CompareObject(instantiator_reg, Object::Handle()); |
__ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump); |
} |
// Instantiate non-null type arguments. |
@@ -2040,9 +2021,8 @@ |
// the type arguments. |
Label type_arguments_instantiated; |
ASSERT(type_arguments().IsRawInstantiatedRaw(type_arguments().Length())); |
- const Immediate& raw_null = |
- Immediate(reinterpret_cast<intptr_t>(Object::null())); |
- __ cmpq(instantiator_reg, raw_null); |
+ |
+ __ CompareObject(instantiator_reg, Object::Handle()); |
__ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump); |
// Instantiate non-null type arguments. |
// In the non-factory case, we rely on the allocation stub to |
@@ -2082,10 +2062,9 @@ |
// instantiated from null becomes a vector of dynamic, then use null as |
// the type arguments and do not pass the instantiator. |
ASSERT(type_arguments().IsRawInstantiatedRaw(type_arguments().Length())); |
- const Immediate& raw_null = |
- Immediate(reinterpret_cast<intptr_t>(Object::null())); |
+ |
Label instantiator_not_null; |
- __ cmpq(instantiator_reg, raw_null); |
+ __ CompareObject(instantiator_reg, Object::Handle()); |
__ j(NOT_EQUAL, &instantiator_not_null, Assembler::kNearJump); |
// Null was used in VisitExtractConstructorTypeArguments as the |
// instantiated type arguments, no proper instantiator needed. |
@@ -2161,6 +2140,10 @@ |
compiler->assembler()->CodeSize(), |
catch_handler_types_, |
needs_stacktrace()); |
+ |
+ // Restore the pool pointer. |
+ __ LoadPoolPointer(PP); |
+ |
if (HasParallelMove()) { |
compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
} |
@@ -4305,9 +4288,8 @@ |
if (IsNullCheck()) { |
Label* deopt = compiler->AddDeoptStub(deopt_id(), |
kDeoptCheckClass); |
- const Immediate& raw_null = |
- Immediate(reinterpret_cast<intptr_t>(Object::null())); |
- __ cmpq(locs()->in(0).reg(), raw_null); |
+ __ CompareObject(locs()->in(0).reg(), |
+ Object::Handle()); |
__ j(EQUAL, deopt); |
return; |
} |