| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   143  |   143  | 
|   144   const DeoptInfo& deopt_info = |   144   const DeoptInfo& deopt_info = | 
|   145       DeoptInfo::Handle(builder->CreateDeoptInfo(deopt_table)); |   145       DeoptInfo::Handle(builder->CreateDeoptInfo(deopt_table)); | 
|   146   return deopt_info.raw(); |   146   return deopt_info.raw(); | 
|   147 } |   147 } | 
|   148  |   148  | 
|   149  |   149  | 
|   150 void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler, |   150 void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler, | 
|   151                                              intptr_t stub_ix) { |   151                                              intptr_t stub_ix) { | 
|   152   // Calls do not need stubs, they share a deoptimization trampoline. |   152   // Calls do not need stubs, they share a deoptimization trampoline. | 
|   153   ASSERT(reason() != kDeoptAtCall); |   153   ASSERT(reason() != ICData::kDeoptAtCall); | 
|   154   Assembler* assem = compiler->assembler(); |   154   Assembler* assem = compiler->assembler(); | 
|   155 #define __ assem-> |   155 #define __ assem-> | 
|   156   __ Comment("Deopt stub for id %" Pd "", deopt_id()); |   156   __ Comment("Deopt stub for id %" Pd "", deopt_id()); | 
|   157   __ Bind(entry_label()); |   157   __ Bind(entry_label()); | 
|   158   if (FLAG_trap_on_deoptimization) __ int3(); |   158   if (FLAG_trap_on_deoptimization) __ int3(); | 
|   159  |   159  | 
|   160   ASSERT(deopt_env() != NULL); |   160   ASSERT(deopt_env() != NULL); | 
|   161  |   161  | 
|   162   __ Call(&StubCode::DeoptimizeLabel(), PP); |   162   __ Call(&StubCode::DeoptimizeLabel(), PP); | 
|   163   set_pc_offset(assem->CodeSize()); |   163   set_pc_offset(assem->CodeSize()); | 
| (...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1227     num_args_checked = 2; |  1227     num_args_checked = 2; | 
|  1228   } |  1228   } | 
|  1229   const ICData& ic_data = ICData::ZoneHandle( |  1229   const ICData& ic_data = ICData::ZoneHandle( | 
|  1230       ICData::New(parsed_function().function(),  // Caller function. |  1230       ICData::New(parsed_function().function(),  // Caller function. | 
|  1231                   String::Handle(target_function.name()), |  1231                   String::Handle(target_function.name()), | 
|  1232                   arguments_descriptor, |  1232                   arguments_descriptor, | 
|  1233                   deopt_id, |  1233                   deopt_id, | 
|  1234                   num_args_checked));  // No arguments checked. |  1234                   num_args_checked));  // No arguments checked. | 
|  1235   ic_data.AddTarget(target_function); |  1235   ic_data.AddTarget(target_function); | 
|  1236   uword label_address = 0; |  1236   uword label_address = 0; | 
|  1237   if (ic_data.num_args_tested() == 0) { |  1237   if (ic_data.NumArgsTested() == 0) { | 
|  1238     label_address = StubCode::ZeroArgsUnoptimizedStaticCallEntryPoint(); |  1238     label_address = StubCode::ZeroArgsUnoptimizedStaticCallEntryPoint(); | 
|  1239   } else if (ic_data.num_args_tested() == 2) { |  1239   } else if (ic_data.NumArgsTested() == 2) { | 
|  1240     label_address = StubCode::TwoArgsUnoptimizedStaticCallEntryPoint(); |  1240     label_address = StubCode::TwoArgsUnoptimizedStaticCallEntryPoint(); | 
|  1241   } else { |  1241   } else { | 
|  1242     UNIMPLEMENTED(); |  1242     UNIMPLEMENTED(); | 
|  1243   } |  1243   } | 
|  1244   ExternalLabel target_label("StaticCallICStub", label_address); |  1244   ExternalLabel target_label("StaticCallICStub", label_address); | 
|  1245   __ LoadObject(RBX, ic_data, PP); |  1245   __ LoadObject(RBX, ic_data, PP); | 
|  1246   GenerateDartCall(deopt_id, |  1246   GenerateDartCall(deopt_id, | 
|  1247                    token_pos, |  1247                    token_pos, | 
|  1248                    &target_label, |  1248                    &target_label, | 
|  1249                    PcDescriptors::kUnoptStaticCall, |  1249                    PcDescriptors::kUnoptStaticCall, | 
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1822   __ movups(reg, Address(RSP, 0)); |  1822   __ movups(reg, Address(RSP, 0)); | 
|  1823   __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); |  1823   __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); | 
|  1824 } |  1824 } | 
|  1825  |  1825  | 
|  1826  |  1826  | 
|  1827 #undef __ |  1827 #undef __ | 
|  1828  |  1828  | 
|  1829 }  // namespace dart |  1829 }  // namespace dart | 
|  1830  |  1830  | 
|  1831 #endif  // defined TARGET_ARCH_X64 |  1831 #endif  // defined TARGET_ARCH_X64 | 
| OLD | NEW |