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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
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 EAX. | 26 // on the stack and return the result in a fixed register EAX. |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 } | 297 } |
297 } | 298 } |
298 | 299 |
299 | 300 |
300 static void EmitEqualityAsInstanceCall(FlowGraphCompiler* compiler, | 301 static void EmitEqualityAsInstanceCall(FlowGraphCompiler* compiler, |
301 EqualityCompareComp* comp) { | 302 EqualityCompareComp* comp) { |
302 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 303 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
303 comp->cid(), | 304 comp->cid(), |
304 comp->token_pos(), | 305 comp->token_pos(), |
305 comp->try_index()); | 306 comp->try_index()); |
306 const String& operator_name = String::ZoneHandle(String::NewSymbol("==")); | 307 const String& operator_name = String::ZoneHandle(Symbols::New("==")); |
307 const int kNumberOfArguments = 2; | 308 const int kNumberOfArguments = 2; |
308 const Array& kNoArgumentNames = Array::Handle(); | 309 const Array& kNoArgumentNames = Array::Handle(); |
309 const int kNumArgumentsChecked = 2; | 310 const int kNumArgumentsChecked = 2; |
310 | 311 |
311 compiler->GenerateInstanceCall(comp->cid(), | 312 compiler->GenerateInstanceCall(comp->cid(), |
312 comp->token_pos(), | 313 comp->token_pos(), |
313 comp->try_index(), | 314 comp->try_index(), |
314 operator_name, | 315 operator_name, |
315 kNumberOfArguments, | 316 kNumberOfArguments, |
316 kNoArgumentNames, | 317 kNoArgumentNames, |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 kNumArguments, | 590 kNumArguments, |
590 Array::Handle(), // No named arguments. | 591 Array::Handle(), // No named arguments. |
591 deopt, // Deoptimize target. | 592 deopt, // Deoptimize target. |
592 NULL, // Fallthrough when done. | 593 NULL, // Fallthrough when done. |
593 cid(), | 594 cid(), |
594 token_pos(), | 595 token_pos(), |
595 try_index()); | 596 try_index()); |
596 return; | 597 return; |
597 } | 598 } |
598 const String& function_name = | 599 const String& function_name = |
599 String::ZoneHandle(String::NewSymbol(Token::Str(kind()))); | 600 String::ZoneHandle(Symbols::New(Token::Str(kind()))); |
600 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 601 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
601 cid(), | 602 cid(), |
602 token_pos(), | 603 token_pos(), |
603 try_index()); | 604 try_index()); |
604 const intptr_t kNumArguments = 2; | 605 const intptr_t kNumArguments = 2; |
605 const intptr_t kNumArgsChecked = 2; // Type-feedback. | 606 const intptr_t kNumArgsChecked = 2; // Type-feedback. |
606 compiler->GenerateInstanceCall(cid(), | 607 compiler->GenerateInstanceCall(cid(), |
607 token_pos(), | 608 token_pos(), |
608 try_index(), | 609 try_index(), |
609 function_name, | 610 function_name, |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 } else { | 786 } else { |
786 ASSERT(receiver_type() == kIllegalObjectKind); | 787 ASSERT(receiver_type() == kIllegalObjectKind); |
787 return MakeCallSummary(); | 788 return MakeCallSummary(); |
788 } | 789 } |
789 } | 790 } |
790 | 791 |
791 | 792 |
792 static void EmitStoreIndexedGeneric(FlowGraphCompiler* compiler, | 793 static void EmitStoreIndexedGeneric(FlowGraphCompiler* compiler, |
793 StoreIndexedComp* comp) { | 794 StoreIndexedComp* comp) { |
794 const String& function_name = | 795 const String& function_name = |
795 String::ZoneHandle(String::NewSymbol(Token::Str(Token::kASSIGN_INDEX))); | 796 String::ZoneHandle(Symbols::New(Token::Str(Token::kASSIGN_INDEX))); |
796 | 797 |
797 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 798 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
798 comp->cid(), | 799 comp->cid(), |
799 comp->token_pos(), | 800 comp->token_pos(), |
800 comp->try_index()); | 801 comp->try_index()); |
801 | 802 |
802 const intptr_t kNumArguments = 3; | 803 const intptr_t kNumArguments = 3; |
803 const intptr_t kNumArgsChecked = 1; // Type-feedback. | 804 const intptr_t kNumArgsChecked = 1; // Type-feedback. |
804 compiler->GenerateInstanceCall(comp->cid(), | 805 compiler->GenerateInstanceCall(comp->cid(), |
805 comp->token_pos(), | 806 comp->token_pos(), |
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2026 instance_call()->argument_names()); | 2027 instance_call()->argument_names()); |
2027 } | 2028 } |
2028 __ Bind(&done); | 2029 __ Bind(&done); |
2029 } | 2030 } |
2030 | 2031 |
2031 } // namespace dart | 2032 } // namespace dart |
2032 | 2033 |
2033 #undef __ | 2034 #undef __ |
2034 | 2035 |
2035 #endif // defined TARGET_ARCH_X64 | 2036 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |