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/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "lib/error.h" | 10 #include "lib/error.h" |
11 #include "vm/flow_graph_compiler.h" | 11 #include "vm/flow_graph_compiler.h" |
12 #include "vm/locations.h" | 12 #include "vm/locations.h" |
13 #include "vm/object_store.h" | 13 #include "vm/object_store.h" |
14 #include "vm/parser.h" | 14 #include "vm/parser.h" |
15 #include "vm/stub_code.h" | 15 #include "vm/stub_code.h" |
| 16 #include "vm/symbols.h" |
16 | 17 |
17 #define __ compiler->assembler()-> | 18 #define __ compiler->assembler()-> |
18 | 19 |
19 namespace dart { | 20 namespace dart { |
20 | 21 |
21 DECLARE_FLAG(int, optimization_counter_threshold); | 22 DECLARE_FLAG(int, optimization_counter_threshold); |
22 DECLARE_FLAG(bool, trace_functions); | 23 DECLARE_FLAG(bool, trace_functions); |
23 | 24 |
24 // Generic summary for call instructions that have all arguments pushed | 25 // Generic summary for call instructions that have all arguments pushed |
25 // on the stack and return the result in a fixed register RAX. | 26 // on the stack and return the result in a fixed register RAX. |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 } | 306 } |
306 } | 307 } |
307 | 308 |
308 | 309 |
309 static void EmitEqualityAsInstanceCall(FlowGraphCompiler* compiler, | 310 static void EmitEqualityAsInstanceCall(FlowGraphCompiler* compiler, |
310 EqualityCompareComp* comp) { | 311 EqualityCompareComp* comp) { |
311 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 312 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
312 comp->cid(), | 313 comp->cid(), |
313 comp->token_pos(), | 314 comp->token_pos(), |
314 comp->try_index()); | 315 comp->try_index()); |
315 const String& operator_name = String::ZoneHandle(String::NewSymbol("==")); | 316 const String& operator_name = String::ZoneHandle(Symbols::New("==")); |
316 const int kNumberOfArguments = 2; | 317 const int kNumberOfArguments = 2; |
317 const Array& kNoArgumentNames = Array::Handle(); | 318 const Array& kNoArgumentNames = Array::Handle(); |
318 const int kNumArgumentsChecked = 2; | 319 const int kNumArgumentsChecked = 2; |
319 | 320 |
320 compiler->GenerateInstanceCall(comp->cid(), | 321 compiler->GenerateInstanceCall(comp->cid(), |
321 comp->token_pos(), | 322 comp->token_pos(), |
322 comp->try_index(), | 323 comp->try_index(), |
323 operator_name, | 324 operator_name, |
324 kNumberOfArguments, | 325 kNumberOfArguments, |
325 kNoArgumentNames, | 326 kNoArgumentNames, |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 kNumArguments, | 599 kNumArguments, |
599 Array::Handle(), // No named arguments. | 600 Array::Handle(), // No named arguments. |
600 deopt, // Deoptimize target. | 601 deopt, // Deoptimize target. |
601 NULL, // Fallthrough when done. | 602 NULL, // Fallthrough when done. |
602 cid(), | 603 cid(), |
603 token_pos(), | 604 token_pos(), |
604 try_index()); | 605 try_index()); |
605 return; | 606 return; |
606 } | 607 } |
607 const String& function_name = | 608 const String& function_name = |
608 String::ZoneHandle(String::NewSymbol(Token::Str(kind()))); | 609 String::ZoneHandle(Symbols::New(Token::Str(kind()))); |
609 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 610 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
610 cid(), | 611 cid(), |
611 token_pos(), | 612 token_pos(), |
612 try_index()); | 613 try_index()); |
613 const intptr_t kNumArguments = 2; | 614 const intptr_t kNumArguments = 2; |
614 const intptr_t kNumArgsChecked = 2; // Type-feedback. | 615 const intptr_t kNumArgsChecked = 2; // Type-feedback. |
615 compiler->GenerateInstanceCall(cid(), | 616 compiler->GenerateInstanceCall(cid(), |
616 token_pos(), | 617 token_pos(), |
617 try_index(), | 618 try_index(), |
618 function_name, | 619 function_name, |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 } else { | 796 } else { |
796 ASSERT(receiver_type() == kIllegalObjectKind); | 797 ASSERT(receiver_type() == kIllegalObjectKind); |
797 return MakeCallSummary(); | 798 return MakeCallSummary(); |
798 } | 799 } |
799 } | 800 } |
800 | 801 |
801 | 802 |
802 static void EmitStoreIndexedGeneric(FlowGraphCompiler* compiler, | 803 static void EmitStoreIndexedGeneric(FlowGraphCompiler* compiler, |
803 StoreIndexedComp* comp) { | 804 StoreIndexedComp* comp) { |
804 const String& function_name = | 805 const String& function_name = |
805 String::ZoneHandle(String::NewSymbol(Token::Str(Token::kASSIGN_INDEX))); | 806 String::ZoneHandle(Symbols::New(Token::Str(Token::kASSIGN_INDEX))); |
806 | 807 |
807 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 808 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
808 comp->cid(), | 809 comp->cid(), |
809 comp->token_pos(), | 810 comp->token_pos(), |
810 comp->try_index()); | 811 comp->try_index()); |
811 | 812 |
812 const intptr_t kNumArguments = 3; | 813 const intptr_t kNumArguments = 3; |
813 const intptr_t kNumArgsChecked = 1; // Type-feedback. | 814 const intptr_t kNumArgsChecked = 1; // Type-feedback. |
814 compiler->GenerateInstanceCall(comp->cid(), | 815 compiler->GenerateInstanceCall(comp->cid(), |
815 comp->token_pos(), | 816 comp->token_pos(), |
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2032 } | 2033 } |
2033 __ Bind(&done); | 2034 __ Bind(&done); |
2034 } | 2035 } |
2035 | 2036 |
2036 | 2037 |
2037 } // namespace dart | 2038 } // namespace dart |
2038 | 2039 |
2039 #undef __ | 2040 #undef __ |
2040 | 2041 |
2041 #endif // defined TARGET_ARCH_X64 | 2042 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |