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 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 } | 1116 } |
1117 } | 1117 } |
1118 | 1118 |
1119 EndCodeSourceRange(TokenPosition::kDartCodePrologue); | 1119 EndCodeSourceRange(TokenPosition::kDartCodePrologue); |
1120 ASSERT(!block_order().is_empty()); | 1120 ASSERT(!block_order().is_empty()); |
1121 VisitBlocks(); | 1121 VisitBlocks(); |
1122 | 1122 |
1123 __ int3(); | 1123 __ int3(); |
1124 ASSERT(assembler()->constant_pool_allowed()); | 1124 ASSERT(assembler()->constant_pool_allowed()); |
1125 GenerateDeferredCode(); | 1125 GenerateDeferredCode(); |
| 1126 // Emit function patching code. This will be swapped with the first 13 bytes |
| 1127 // at entry point. |
| 1128 |
| 1129 BeginCodeSourceRange(); |
| 1130 if (is_optimizing() && !FLAG_precompiled_mode) { |
| 1131 // Leave enough space for patching in case of lazy deoptimization. |
| 1132 __ nop(ShortCallPattern::pattern_length_in_bytes()); |
| 1133 lazy_deopt_return_pc_offset_ = assembler()->CodeSize(); |
| 1134 __ Jmp(*StubCode::DeoptimizeLazyFromReturn_entry(), PP); |
| 1135 lazy_deopt_throw_pc_offset_ = assembler()->CodeSize(); |
| 1136 __ Jmp(*StubCode::DeoptimizeLazyFromThrow_entry(), PP); |
| 1137 } |
| 1138 EndCodeSourceRange(TokenPosition::kDartCodeEpilogue); |
1126 } | 1139 } |
1127 | 1140 |
1128 | 1141 |
1129 void FlowGraphCompiler::GenerateCall(TokenPosition token_pos, | 1142 void FlowGraphCompiler::GenerateCall(TokenPosition token_pos, |
1130 const StubEntry& stub_entry, | 1143 const StubEntry& stub_entry, |
1131 RawPcDescriptors::Kind kind, | 1144 RawPcDescriptors::Kind kind, |
1132 LocationSummary* locs) { | 1145 LocationSummary* locs) { |
1133 __ Call(stub_entry); | 1146 __ Call(stub_entry); |
1134 AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos); | 1147 AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos); |
1135 RecordSafepoint(locs); | 1148 RecordSafepoint(locs); |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1840 __ movups(reg, Address(RSP, 0)); | 1853 __ movups(reg, Address(RSP, 0)); |
1841 __ AddImmediate(RSP, Immediate(kFpuRegisterSize)); | 1854 __ AddImmediate(RSP, Immediate(kFpuRegisterSize)); |
1842 } | 1855 } |
1843 | 1856 |
1844 | 1857 |
1845 #undef __ | 1858 #undef __ |
1846 | 1859 |
1847 } // namespace dart | 1860 } // namespace dart |
1848 | 1861 |
1849 #endif // defined TARGET_ARCH_X64 | 1862 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |