| 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_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 "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 6743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6754 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6754 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6755 // Load arguments descriptors. | 6755 // Load arguments descriptors. |
| 6756 intptr_t argument_count = ArgumentCount(); | 6756 intptr_t argument_count = ArgumentCount(); |
| 6757 const Array& arguments_descriptor = | 6757 const Array& arguments_descriptor = |
| 6758 Array::ZoneHandle(ArgumentsDescriptor::New(argument_count, | 6758 Array::ZoneHandle(ArgumentsDescriptor::New(argument_count, |
| 6759 argument_names())); | 6759 argument_names())); |
| 6760 __ LoadObject(EDX, arguments_descriptor); | 6760 __ LoadObject(EDX, arguments_descriptor); |
| 6761 | 6761 |
| 6762 // EBX: Code (compiled code or lazy compile stub). | 6762 // EBX: Code (compiled code or lazy compile stub). |
| 6763 ASSERT(locs()->in(0).reg() == EAX); | 6763 ASSERT(locs()->in(0).reg() == EAX); |
| 6764 __ movl(EBX, FieldAddress(EAX, Function::instructions_offset())); | 6764 __ movl(EBX, FieldAddress(EAX, Function::entry_point_offset())); |
| 6765 | 6765 |
| 6766 // EAX: Function. | 6766 // EAX: Function. |
| 6767 // EDX: Arguments descriptor array. | 6767 // EDX: Arguments descriptor array. |
| 6768 // ECX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). | 6768 // ECX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). |
| 6769 __ xorl(ECX, ECX); | 6769 __ xorl(ECX, ECX); |
| 6770 __ addl(EBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); | |
| 6771 __ call(EBX); | 6770 __ call(EBX); |
| 6772 compiler->RecordSafepoint(locs()); | 6771 compiler->RecordSafepoint(locs()); |
| 6773 // Marks either the continuation point in unoptimized code or the | 6772 // Marks either the continuation point in unoptimized code or the |
| 6774 // deoptimization point in optimized code, after call. | 6773 // deoptimization point in optimized code, after call. |
| 6775 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id()); | 6774 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id()); |
| 6776 if (compiler->is_optimizing()) { | 6775 if (compiler->is_optimizing()) { |
| 6777 compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos()); | 6776 compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos()); |
| 6778 } | 6777 } |
| 6779 // Add deoptimization continuation point after the call and before the | 6778 // Add deoptimization continuation point after the call and before the |
| 6780 // arguments are removed. | 6779 // arguments are removed. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6862 __ Drop(1); | 6861 __ Drop(1); |
| 6863 __ popl(result); | 6862 __ popl(result); |
| 6864 } | 6863 } |
| 6865 | 6864 |
| 6866 | 6865 |
| 6867 } // namespace dart | 6866 } // namespace dart |
| 6868 | 6867 |
| 6869 #undef __ | 6868 #undef __ |
| 6870 | 6869 |
| 6871 #endif // defined TARGET_ARCH_IA32 | 6870 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |