| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 void FlowGraphCompiler::VisitTemp(TempVal* val) { | 54 void FlowGraphCompiler::VisitTemp(TempVal* val) { |
| 55 LoadValue(val); | 55 LoadValue(val); |
| 56 } | 56 } |
| 57 | 57 |
| 58 | 58 |
| 59 void FlowGraphCompiler::VisitConstant(ConstantVal* val) { | 59 void FlowGraphCompiler::VisitConstant(ConstantVal* val) { |
| 60 LoadValue(val); | 60 LoadValue(val); |
| 61 } | 61 } |
| 62 | 62 |
| 63 | 63 |
| 64 void FlowGraphCompiler::VisitCopyTemp(CopyTempComp* comp) { |
| 65 // Index is a stack index. Semantics is to produce a duplicate of the |
| 66 // temp at index. |
| 67 __ movq(RAX, Address(RSP, comp->index() * (-kWordSize))); |
| 68 } |
| 69 |
| 70 |
| 71 void FlowGraphCompiler::VisitSetTemp(SetTempComp* comp) { |
| 72 // Index is a stack index. Semantics is to store a (copy of) the TOS in |
| 73 // the temp at index. |
| 74 __ movq(RAX, Address(RSP, 0)); |
| 75 __ movq(Address(RSP, comp->index() * (-kWordSize)), RAX); |
| 76 } |
| 77 |
| 78 |
| 64 void FlowGraphCompiler::VisitAssertAssignable(AssertAssignableComp* comp) { | 79 void FlowGraphCompiler::VisitAssertAssignable(AssertAssignableComp* comp) { |
| 65 Bailout("AssertAssignableComp"); | 80 Bailout("AssertAssignableComp"); |
| 66 } | 81 } |
| 67 | 82 |
| 68 | 83 |
| 69 // True iff. the arguments to a call will be properly pushed and can | 84 // True iff. the arguments to a call will be properly pushed and can |
| 70 // be popped after the call. | 85 // be popped after the call. |
| 71 template <typename T> static bool VerifyCallComputation(T* comp) { | 86 template <typename T> static bool VerifyCallComputation(T* comp) { |
| 72 // Argument values should be consecutive temps. | 87 // Argument values should be consecutive temps. |
| 73 // | 88 // |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) { | 435 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) { |
| 421 // We don't compile exception handlers yet. | 436 // We don't compile exception handlers yet. |
| 422 code.set_exception_handlers( | 437 code.set_exception_handlers( |
| 423 ExceptionHandlers::Handle(ExceptionHandlers::New(0))); | 438 ExceptionHandlers::Handle(ExceptionHandlers::New(0))); |
| 424 } | 439 } |
| 425 | 440 |
| 426 | 441 |
| 427 } // namespace dart | 442 } // namespace dart |
| 428 | 443 |
| 429 #endif // defined TARGET_ARCH_X64 | 444 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |