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/code_generator.h" | 5 #include "vm/code_generator.h" |
6 | 6 |
7 #include "vm/assembler_macros.h" | 7 #include "vm/assembler_macros.h" |
8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 | 819 |
820 // Result of an invoke may be an unhandled exception, in which case we | 820 // Result of an invoke may be an unhandled exception, in which case we |
821 // rethrow it. | 821 // rethrow it. |
822 static void CheckResultError(const Object& result) { | 822 static void CheckResultError(const Object& result) { |
823 if (result.IsError()) { | 823 if (result.IsError()) { |
824 Exceptions::PropagateError(Error::Cast(result)); | 824 Exceptions::PropagateError(Error::Cast(result)); |
825 } | 825 } |
826 } | 826 } |
827 | 827 |
828 | 828 |
829 // Resolves an instance function and compiles it if necessary. | |
830 // Arg0: receiver object. | |
831 // Arg1: IC data object. | |
832 // Arg2: Arguments descriptor array. | |
833 // Returns: RawCode object or NULL (method not found or not compileable). | |
834 // This is called by the megamorphic stub when instance call does not need to be | |
835 // patched. | |
836 // Used by megamorphic lookup/no-such-method-handling. | |
837 DEFINE_RUNTIME_ENTRY(ResolveCompileInstanceFunction, 3) { | |
838 ASSERT(arguments.ArgCount() == | |
839 kResolveCompileInstanceFunctionRuntimeEntry.argument_count()); | |
840 const Instance& receiver = Instance::CheckedHandle(arguments.ArgAt(0)); | |
841 const ICData& ic_data = ICData::CheckedHandle(arguments.ArgAt(1)); | |
842 const Array& arg_desc_array = Array::CheckedHandle(arguments.ArgAt(2)); | |
843 ArgumentsDescriptor arg_descriptor(arg_desc_array); | |
844 const Code& code = | |
845 Code::Handle(ResolveCompileInstanceCallTarget(receiver, | |
846 ic_data, | |
847 arg_descriptor)); | |
848 arguments.SetReturn(code); | |
849 } | |
850 | |
851 | |
852 // Gets called from debug stub when code reaches a breakpoint. | 829 // Gets called from debug stub when code reaches a breakpoint. |
853 DEFINE_RUNTIME_ENTRY(BreakpointStaticHandler, 0) { | 830 DEFINE_RUNTIME_ENTRY(BreakpointStaticHandler, 0) { |
854 ASSERT(arguments.ArgCount() == | 831 ASSERT(arguments.ArgCount() == |
855 kBreakpointStaticHandlerRuntimeEntry.argument_count()); | 832 kBreakpointStaticHandlerRuntimeEntry.argument_count()); |
856 ASSERT(isolate->debugger() != NULL); | 833 ASSERT(isolate->debugger() != NULL); |
857 isolate->debugger()->SignalBpReached(); | 834 isolate->debugger()->SignalBpReached(); |
858 // Make sure the static function that is about to be called is | 835 // Make sure the static function that is about to be called is |
859 // compiled. The stub will jump to the entry point without any | 836 // compiled. The stub will jump to the entry point without any |
860 // further tests. | 837 // further tests. |
861 DartFrameIterator iterator; | 838 DartFrameIterator iterator; |
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1893 Isolate* isolate = Isolate::Current(); | 1870 Isolate* isolate = Isolate::Current(); |
1894 StackZone zone(isolate); | 1871 StackZone zone(isolate); |
1895 HANDLESCOPE(isolate); | 1872 HANDLESCOPE(isolate); |
1896 const Bigint& big_left = Bigint::Handle(left); | 1873 const Bigint& big_left = Bigint::Handle(left); |
1897 const Bigint& big_right = Bigint::Handle(right); | 1874 const Bigint& big_right = Bigint::Handle(right); |
1898 return BigintOperations::Compare(big_left, big_right); | 1875 return BigintOperations::Compare(big_left, big_right); |
1899 } | 1876 } |
1900 END_LEAF_RUNTIME_ENTRY | 1877 END_LEAF_RUNTIME_ENTRY |
1901 | 1878 |
1902 } // namespace dart | 1879 } // namespace dart |
OLD | NEW |