| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 } | 1128 } |
| 1129 } | 1129 } |
| 1130 | 1130 |
| 1131 EndCodeSourceRange(TokenPosition::kDartCodePrologue); | 1131 EndCodeSourceRange(TokenPosition::kDartCodePrologue); |
| 1132 ASSERT(!block_order().is_empty()); | 1132 ASSERT(!block_order().is_empty()); |
| 1133 VisitBlocks(); | 1133 VisitBlocks(); |
| 1134 | 1134 |
| 1135 __ int3(); | 1135 __ int3(); |
| 1136 ASSERT(assembler()->constant_pool_allowed()); | 1136 ASSERT(assembler()->constant_pool_allowed()); |
| 1137 GenerateDeferredCode(); | 1137 GenerateDeferredCode(); |
| 1138 // Emit function patching code. This will be swapped with the first 13 bytes | |
| 1139 // at entry point. | |
| 1140 | |
| 1141 BeginCodeSourceRange(); | |
| 1142 if (is_optimizing() && !FLAG_precompiled_mode) { | |
| 1143 // Leave enough space for patching in case of lazy deoptimization. | |
| 1144 __ nop(ShortCallPattern::pattern_length_in_bytes()); | |
| 1145 lazy_deopt_return_pc_offset_ = assembler()->CodeSize(); | |
| 1146 __ Jmp(*StubCode::DeoptimizeLazyFromReturn_entry(), PP); | |
| 1147 lazy_deopt_throw_pc_offset_ = assembler()->CodeSize(); | |
| 1148 __ Jmp(*StubCode::DeoptimizeLazyFromThrow_entry(), PP); | |
| 1149 } | |
| 1150 EndCodeSourceRange(TokenPosition::kDartCodeEpilogue); | |
| 1151 } | 1138 } |
| 1152 | 1139 |
| 1153 | 1140 |
| 1154 void FlowGraphCompiler::GenerateCall(TokenPosition token_pos, | 1141 void FlowGraphCompiler::GenerateCall(TokenPosition token_pos, |
| 1155 const StubEntry& stub_entry, | 1142 const StubEntry& stub_entry, |
| 1156 RawPcDescriptors::Kind kind, | 1143 RawPcDescriptors::Kind kind, |
| 1157 LocationSummary* locs) { | 1144 LocationSummary* locs) { |
| 1158 __ Call(stub_entry); | 1145 __ Call(stub_entry); |
| 1159 AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos); | 1146 AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos); |
| 1160 RecordSafepoint(locs); | 1147 RecordSafepoint(locs); |
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1865 __ movups(reg, Address(RSP, 0)); | 1852 __ movups(reg, Address(RSP, 0)); |
| 1866 __ AddImmediate(RSP, Immediate(kFpuRegisterSize)); | 1853 __ AddImmediate(RSP, Immediate(kFpuRegisterSize)); |
| 1867 } | 1854 } |
| 1868 | 1855 |
| 1869 | 1856 |
| 1870 #undef __ | 1857 #undef __ |
| 1871 | 1858 |
| 1872 } // namespace dart | 1859 } // namespace dart |
| 1873 | 1860 |
| 1874 #endif // defined TARGET_ARCH_X64 | 1861 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |