| 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/code_generator.h" | 8 #include "vm/code_generator.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 __ LoadObject(EBX, function); | 652 __ LoadObject(EBX, function); |
| 653 __ incl(FieldAddress(EBX, Function::usage_counter_offset())); | 653 __ incl(FieldAddress(EBX, Function::usage_counter_offset())); |
| 654 if (CodeGenerator::CanOptimize()) { | 654 if (CodeGenerator::CanOptimize()) { |
| 655 // Do not optimize if usage count must be reported. | 655 // Do not optimize if usage count must be reported. |
| 656 __ cmpl(FieldAddress(EBX, Function::usage_counter_offset()), | 656 __ cmpl(FieldAddress(EBX, Function::usage_counter_offset()), |
| 657 Immediate(FLAG_optimization_counter_threshold)); | 657 Immediate(FLAG_optimization_counter_threshold)); |
| 658 Label not_yet_hot; | 658 Label not_yet_hot; |
| 659 __ j(LESS_EQUAL, ¬_yet_hot); | 659 __ j(LESS_EQUAL, ¬_yet_hot); |
| 660 __ pushl(EAX); // Preserve result. | 660 __ pushl(EAX); // Preserve result. |
| 661 __ pushl(EBX); // Argument for runtime: function to optimize. | 661 __ pushl(EBX); // Argument for runtime: function to optimize. |
| 662 __ CallRuntimeFromDart(kOptimizeInvokedFunctionRuntimeEntry); | 662 __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry); |
| 663 __ popl(EBX); // Remove argument. | 663 __ popl(EBX); // Remove argument. |
| 664 __ popl(EAX); // Restore result. | 664 __ popl(EAX); // Restore result. |
| 665 __ Bind(¬_yet_hot); | 665 __ Bind(¬_yet_hot); |
| 666 } | 666 } |
| 667 } | 667 } |
| 668 if (FLAG_trace_functions) { | 668 if (FLAG_trace_functions) { |
| 669 const Function& function = | 669 const Function& function = |
| 670 Function::ZoneHandle(parsed_function_.function().raw()); | 670 Function::ZoneHandle(parsed_function_.function().raw()); |
| 671 __ LoadObject(EBX, function); | 671 __ LoadObject(EBX, function); |
| 672 __ pushl(EAX); // Preserve result. | 672 __ pushl(EAX); // Preserve result. |
| (...skipping 2169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2842 const ExternalLabel* ext_label, | 2842 const ExternalLabel* ext_label, |
| 2843 PcDescriptors::Kind desc_kind) { | 2843 PcDescriptors::Kind desc_kind) { |
| 2844 __ call(ext_label); | 2844 __ call(ext_label); |
| 2845 AddCurrentDescriptor(desc_kind, AstNode::kNoId, token_index); | 2845 AddCurrentDescriptor(desc_kind, AstNode::kNoId, token_index); |
| 2846 } | 2846 } |
| 2847 | 2847 |
| 2848 | 2848 |
| 2849 void CodeGenerator::GenerateCallRuntime(intptr_t node_id, | 2849 void CodeGenerator::GenerateCallRuntime(intptr_t node_id, |
| 2850 intptr_t token_index, | 2850 intptr_t token_index, |
| 2851 const RuntimeEntry& entry) { | 2851 const RuntimeEntry& entry) { |
| 2852 __ CallRuntimeFromDart(entry); | 2852 __ CallRuntime(entry); |
| 2853 AddCurrentDescriptor(PcDescriptors::kOther, node_id, token_index); | 2853 AddCurrentDescriptor(PcDescriptors::kOther, node_id, token_index); |
| 2854 } | 2854 } |
| 2855 | 2855 |
| 2856 | 2856 |
| 2857 void CodeGenerator::MarkDeoptPoint(intptr_t node_id, | 2857 void CodeGenerator::MarkDeoptPoint(intptr_t node_id, |
| 2858 intptr_t token_index) { | 2858 intptr_t token_index) { |
| 2859 ASSERT(node_id != AstNode::kNoId); | 2859 ASSERT(node_id != AstNode::kNoId); |
| 2860 AddCurrentDescriptor(PcDescriptors::kDeopt, node_id, token_index); | 2860 AddCurrentDescriptor(PcDescriptors::kDeopt, node_id, token_index); |
| 2861 } | 2861 } |
| 2862 | 2862 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2881 const Error& error = Error::Handle( | 2881 const Error& error = Error::Handle( |
| 2882 Parser::FormatError(script, token_index, "Error", format, args)); | 2882 Parser::FormatError(script, token_index, "Error", format, args)); |
| 2883 va_end(args); | 2883 va_end(args); |
| 2884 Isolate::Current()->long_jump_base()->Jump(1, error); | 2884 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2885 UNREACHABLE(); | 2885 UNREACHABLE(); |
| 2886 } | 2886 } |
| 2887 | 2887 |
| 2888 } // namespace dart | 2888 } // namespace dart |
| 2889 | 2889 |
| 2890 #endif // defined TARGET_ARCH_IA32 | 2890 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |