| Index: runtime/vm/flow_graph_compiler_x64.cc
|
| ===================================================================
|
| --- runtime/vm/flow_graph_compiler_x64.cc (revision 4963)
|
| +++ runtime/vm/flow_graph_compiler_x64.cc (working copy)
|
| @@ -32,9 +32,17 @@
|
| Isolate::Current()->long_jump_base()->Jump(1, error);
|
| }
|
|
|
| -
|
| #define __ assembler_->
|
|
|
| +
|
| +void FlowGraphCompiler::GenerateAssertAssignable(intptr_t node_id,
|
| + intptr_t token_index,
|
| + const AbstractType& dst_type,
|
| + const String& dst_name) {
|
| + Bailout("GenerateAssertAssignable");
|
| +}
|
| +
|
| +
|
| void FlowGraphCompiler::LoadValue(Value* value) {
|
| if (value->IsConstant()) {
|
| ConstantVal* constant = value->AsConstant();
|
| @@ -86,6 +94,15 @@
|
| }
|
|
|
|
|
| +// Truee iff. the v2 is above v1 on stack, or one of them is constant.
|
| +static bool VerifyValues(Value* v1, Value* v2) {
|
| + if (v1->IsTemp() && v2->IsTemp()) {
|
| + return (v1->AsTemp()->index() + 1) == v2->AsTemp()->index();
|
| + }
|
| + return true;
|
| +}
|
| +
|
| +
|
| void FlowGraphCompiler::EmitInstanceCall(intptr_t node_id,
|
| intptr_t token_index,
|
| const String& function_name,
|
| @@ -176,6 +193,35 @@
|
| }
|
|
|
|
|
| +void FlowGraphCompiler::VisitLoadInstanceField(LoadInstanceFieldComp* comp) {
|
| + LoadValue(comp->instance()); // -> RAX.
|
| + __ movq(RAX, FieldAddress(RAX, comp->field().Offset()));
|
| +}
|
| +
|
| +
|
| +void FlowGraphCompiler::VisitStoreInstanceField(StoreInstanceFieldComp* comp) {
|
| + VerifyValues(comp->instance(), comp->value());
|
| + LoadValue(comp->value());
|
| + __ movq(R10, RAX);
|
| + LoadValue(comp->instance()); // -> RAX.
|
| + __ StoreIntoObject(RAX, FieldAddress(RAX, comp->field().Offset()), R10);
|
| +}
|
| +
|
| +
|
| +
|
| +void FlowGraphCompiler::VisitLoadStaticField(LoadStaticFieldComp* comp) {
|
| + __ LoadObject(RDX, comp->field());
|
| + __ movq(RAX, FieldAddress(RDX, Field::value_offset()));
|
| +}
|
| +
|
| +
|
| +void FlowGraphCompiler::VisitStoreStaticField(StoreStaticFieldComp* comp) {
|
| + LoadValue(comp->value());
|
| + __ LoadObject(RDX, comp->field());
|
| + __ StoreIntoObject(RDX, FieldAddress(RDX, Field::value_offset()), RAX);
|
| +}
|
| +
|
| +
|
| void FlowGraphCompiler::VisitStoreIndexed(StoreIndexedComp* comp) {
|
| // Call operator []= but preserve the third argument value under the
|
| // arguments as the result of the computation.
|
|
|