Index: runtime/vm/intermediate_language_x64.cc |
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc |
index cd36da8685b9597227d7194b611f993b59d15489..668c460b3c947e122905f6e675744a36814df039 100644 |
--- a/runtime/vm/intermediate_language_x64.cc |
+++ b/runtime/vm/intermediate_language_x64.cc |
@@ -91,7 +91,8 @@ void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
compiler->GenerateCallRuntime(Isolate::kNoDeoptId, |
0, |
CatchClauseNode::kInvalidTryIndex, |
- kTraceFunctionExitRuntimeEntry); |
+ kTraceFunctionExitRuntimeEntry, |
+ NULL); |
Vyacheslav Egorov (Google)
2012/08/13 12:54:46
ReturnInstr is marked as NoCall. This code is susp
|
__ popq(temp); // Remove argument. |
__ popq(result); // Restore result. |
} |
@@ -224,7 +225,8 @@ void AssertBooleanComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
compiler->GenerateCallRuntime(deopt_id(), |
token_pos(), |
try_index(), |
- kConditionTypeErrorRuntimeEntry); |
+ kConditionTypeErrorRuntimeEntry, |
+ locs()->stack_bitmap()); |
// We should never return here. |
__ int3(); |
@@ -299,7 +301,8 @@ static void EmitEqualityAsInstanceCall(FlowGraphCompiler* compiler, |
operator_name, |
kNumberOfArguments, |
kNoArgumentNames, |
- kNumArgumentsChecked); |
+ kNumArgumentsChecked, |
+ comp->locs()->stack_bitmap()); |
ASSERT(comp->locs()->out().reg() == RAX); |
if (comp->kind() == Token::kNE) { |
Label done, false_label; |
@@ -321,7 +324,8 @@ static void EmitEqualityAsPolymorphicCall(FlowGraphCompiler* compiler, |
Token::Kind kind, |
intptr_t deopt_id, |
intptr_t token_pos, |
- intptr_t try_index) { |
+ intptr_t try_index, |
+ BitmapBuilder* stack_bitmap) { |
ASSERT((kind == Token::kEQ) || (kind == Token::kNE)); |
const ICData& ic_data = ICData::Handle(orig_ic_data.AsUnaryClassChecks()); |
ASSERT(ic_data.NumberOfChecks() > 0); |
@@ -376,7 +380,8 @@ static void EmitEqualityAsPolymorphicCall(FlowGraphCompiler* compiler, |
try_index, |
target, |
kNumberOfArguments, |
- kNoArgumentNames); |
+ kNoArgumentNames, |
+ stack_bitmap); |
if (branch == NULL) { |
if (kind == Token::kNE) { |
Label false_label; |
@@ -441,7 +446,8 @@ static void EmitGenericEqualityCompare(FlowGraphCompiler* compiler, |
__ pushq(left); |
__ pushq(right); |
EmitEqualityAsPolymorphicCall(compiler, ic_data, locs, branch, kind, |
- deopt_id, token_pos, try_index); |
+ deopt_id, token_pos, try_index, |
+ locs.stack_bitmap()); |
__ Bind(&done); |
} |
@@ -602,7 +608,8 @@ void RelationalOpComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
NULL, // Fallthrough when done. |
deopt_id(), |
token_pos(), |
- try_index()); |
+ try_index(), |
+ locs()->stack_bitmap()); |
return; |
} |
const String& function_name = |
@@ -619,7 +626,8 @@ void RelationalOpComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
function_name, |
kNumArguments, |
Array::ZoneHandle(), // No optional arguments. |
- kNumArgsChecked); |
+ kNumArgsChecked, |
+ locs()->stack_bitmap()); |
ASSERT(locs()->out().reg() == RAX); |
} |
@@ -661,7 +669,8 @@ void NativeCallComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
compiler->GenerateCall(token_pos(), |
try_index(), |
&StubCode::CallNativeCFunctionLabel(), |
- PcDescriptors::kOther); |
+ PcDescriptors::kOther, |
+ locs()->stack_bitmap()); |
__ popq(result); |
} |
@@ -690,7 +699,7 @@ LocationSummary* LoadIndexedComp::MakeLocationSummary() const { |
static void EmitLoadIndexedPolymorphic(FlowGraphCompiler* compiler, |
- LoadIndexedComp* comp) { |
+ LoadIndexedComp* comp) { |
Label* deopt = compiler->AddDeoptStub(comp->deopt_id(), |
comp->try_index(), |
kDeoptLoadIndexedPolymorphic); |
@@ -714,7 +723,8 @@ static void EmitLoadIndexedPolymorphic(FlowGraphCompiler* compiler, |
NULL, // Fallthrough when done. |
comp->deopt_id(), |
comp->token_pos(), |
- comp->try_index()); |
+ comp->try_index(), |
+ comp->locs()->stack_bitmap()); |
} |
@@ -822,7 +832,8 @@ static void EmitStoreIndexedGeneric(FlowGraphCompiler* compiler, |
function_name, |
kNumArguments, |
Array::ZoneHandle(), // No named arguments. |
- kNumArgsChecked); |
+ kNumArgsChecked, |
+ comp->locs()->stack_bitmap()); |
} |
@@ -851,7 +862,8 @@ static void EmitStoreIndexedPolymorphic(FlowGraphCompiler* compiler, |
NULL, // fallthrough when done. |
comp->deopt_id(), |
comp->token_pos(), |
- comp->try_index()); |
+ comp->try_index(), |
+ comp->locs()->stack_bitmap()); |
} |
@@ -984,7 +996,8 @@ void InstanceOfComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
token_pos(), |
try_index(), |
type(), |
- negate_result()); |
+ negate_result(), |
+ locs()->stack_bitmap()); |
ASSERT(locs()->out().reg() == RAX); |
} |
@@ -1007,7 +1020,8 @@ void CreateArrayComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
compiler->GenerateCall(token_pos(), |
try_index(), |
&StubCode::AllocateArrayLabel(), |
- PcDescriptors::kOther); |
+ PcDescriptors::kOther, |
+ locs()->stack_bitmap()); |
ASSERT(locs()->out().reg() == RAX); |
// Pop the element values from the stack into the array. |
@@ -1047,7 +1061,8 @@ void AllocateObjectWithBoundsCheckComp::EmitNativeCode( |
compiler->GenerateCallRuntime(deopt_id(), |
token_pos(), |
try_index(), |
- kAllocateObjectWithBoundsCheckRuntimeEntry); |
+ kAllocateObjectWithBoundsCheckRuntimeEntry, |
+ locs()->stack_bitmap()); |
// Pop instantiator type arguments, type arguments, and class. |
__ Drop(3); |
__ popq(result); // Pop new instance. |
@@ -1132,7 +1147,8 @@ void InstantiateTypeArgumentsComp::EmitNativeCode( |
compiler->GenerateCallRuntime(deopt_id(), |
token_pos(), |
try_index(), |
- kInstantiateTypeArgumentsRuntimeEntry); |
+ kInstantiateTypeArgumentsRuntimeEntry, |
+ locs()->stack_bitmap()); |
__ Drop(2); // Drop instantiator and uninstantiated type arguments. |
__ popq(result_reg); // Pop instantiated type arguments. |
__ Bind(&type_arguments_instantiated); |
@@ -1284,7 +1300,8 @@ void AllocateContextComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
compiler->GenerateCall(token_pos(), |
try_index(), |
&label, |
- PcDescriptors::kOther); |
+ PcDescriptors::kOther, |
+ locs()->stack_bitmap()); |
} |
@@ -1308,7 +1325,8 @@ void CloneContextComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
compiler->GenerateCallRuntime(deopt_id(), |
token_pos(), |
try_index(), |
- kCloneContextRuntimeEntry); |
+ kCloneContextRuntimeEntry, |
+ locs()->stack_bitmap()); |
__ popq(result); // Remove argument. |
__ popq(result); // Get result (cloned context). |
} |
@@ -1364,7 +1382,8 @@ void CheckStackOverflowComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
compiler->GenerateCallRuntime(deopt_id(), |
token_pos(), |
try_index(), |
- kStackOverflowRuntimeEntry); |
+ kStackOverflowRuntimeEntry, |
+ locs()->stack_bitmap()); |
__ Bind(&no_stack_overflow); |
} |
@@ -1549,12 +1568,14 @@ static void EmitSmiBinaryOp(FlowGraphCompiler* compiler, BinaryOpComp* comp) { |
const intptr_t kArgumentCount = 2; |
__ pushq(temp); |
__ pushq(right); |
- compiler->GenerateStaticCall(comp->instance_call()->deopt_id(), |
- comp->instance_call()->token_pos(), |
- comp->instance_call()->try_index(), |
- target, |
- kArgumentCount, |
- Array::Handle()); // No argument names. |
+ compiler->GenerateStaticCall( |
+ comp->instance_call()->deopt_id(), |
+ comp->instance_call()->token_pos(), |
+ comp->instance_call()->try_index(), |
+ target, |
+ kArgumentCount, |
+ Array::Handle(), // No argument names. |
+ comp->locs()->stack_bitmap()); |
ASSERT(result == RAX); |
} |
__ Bind(&done); |
@@ -1642,12 +1663,14 @@ static void EmitMintBinaryOp(FlowGraphCompiler* compiler, BinaryOpComp* comp) { |
} else { |
__ pushq(left); |
__ pushq(right); |
- compiler->GenerateStaticCall(comp->instance_call()->deopt_id(), |
- comp->instance_call()->token_pos(), |
- comp->instance_call()->try_index(), |
- target, |
- comp->instance_call()->ArgumentCount(), |
- comp->instance_call()->argument_names()); |
+ compiler->GenerateStaticCall( |
+ comp->instance_call()->deopt_id(), |
+ comp->instance_call()->token_pos(), |
+ comp->instance_call()->try_index(), |
+ target, |
+ comp->instance_call()->ArgumentCount(), |
+ comp->instance_call()->argument_names(), |
+ comp->locs()->stack_bitmap()); |
ASSERT(result == RAX); |
__ jmp(&done); |
} |
@@ -1662,12 +1685,14 @@ static void EmitMintBinaryOp(FlowGraphCompiler* compiler, BinaryOpComp* comp) { |
} else { |
__ pushq(left); |
__ pushq(right); |
- compiler->GenerateStaticCall(comp->instance_call()->deopt_id(), |
- comp->instance_call()->token_pos(), |
- comp->instance_call()->try_index(), |
- target, |
- comp->instance_call()->ArgumentCount(), |
- comp->instance_call()->argument_names()); |
+ compiler->GenerateStaticCall( |
+ comp->instance_call()->deopt_id(), |
+ comp->instance_call()->token_pos(), |
+ comp->instance_call()->try_index(), |
+ target, |
+ comp->instance_call()->ArgumentCount(), |
+ comp->instance_call()->argument_names(), |
+ comp->locs()->stack_bitmap()); |
ASSERT(result == RAX); |
} |
} |
@@ -1709,7 +1734,8 @@ void DoubleBinaryOpComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
compiler->GenerateCall(instance_call()->token_pos(), |
instance_call()->try_index(), |
&label, |
- PcDescriptors::kOther); |
+ PcDescriptors::kOther, |
+ locs()->stack_bitmap()); |
// Newly allocated object is now in the result register (RAX). |
ASSERT(result == RAX); |
__ popq(right); |
@@ -1836,7 +1862,8 @@ void NumberNegateComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
compiler->GenerateCall(instance_call()->token_pos(), |
instance_call()->try_index(), |
&label, |
- PcDescriptors::kOther); |
+ PcDescriptors::kOther, |
+ instance_call()->locs()->stack_bitmap()); |
// Result is in RAX. |
ASSERT(result != temp); |
__ movq(result, RAX); |
@@ -1897,7 +1924,8 @@ void ToDoubleComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
compiler->GenerateCall(instance_call()->token_pos(), |
instance_call()->try_index(), |
&label, |
- PcDescriptors::kOther); |
+ PcDescriptors::kOther, |
+ locs()->stack_bitmap()); |
ASSERT(result == RAX); |
__ popq(value); |
@@ -1943,7 +1971,8 @@ void PolymorphicInstanceCallComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
(is_smi_label == &handle_smi) ? &done : NULL, |
instance_call()->deopt_id(), |
instance_call()->token_pos(), |
- instance_call()->try_index()); |
+ instance_call()->try_index(), |
+ locs()->stack_bitmap()); |
if (is_smi_label == &handle_smi) { |
__ Bind(&handle_smi); |
ASSERT(ic_data()->GetReceiverClassIdAt(0) == kSmiCid); |
@@ -1953,7 +1982,8 @@ void PolymorphicInstanceCallComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
instance_call()->try_index(), |
target, |
instance_call()->ArgumentCount(), |
- instance_call()->argument_names()); |
+ instance_call()->argument_names(), |
+ locs()->stack_bitmap()); |
} |
__ Bind(&done); |
} |
@@ -2055,7 +2085,8 @@ void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
function_name, |
kNumArguments, |
Array::ZoneHandle(), // No optional arguments. |
- kNumArgsChecked); |
+ kNumArgsChecked, |
+ locs()->stack_bitmap()); |
ASSERT(locs()->out().reg() == RAX); |
__ CompareObject(locs()->out().reg(), compiler->bool_true()); |
EmitBranchOnCondition(compiler, branch_condition); |