| 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 | 
| 829 // Gets called from debug stub when code reaches a breakpoint. | 852 // Gets called from debug stub when code reaches a breakpoint. | 
| 830 DEFINE_RUNTIME_ENTRY(BreakpointStaticHandler, 0) { | 853 DEFINE_RUNTIME_ENTRY(BreakpointStaticHandler, 0) { | 
| 831   ASSERT(arguments.ArgCount() == | 854   ASSERT(arguments.ArgCount() == | 
| 832       kBreakpointStaticHandlerRuntimeEntry.argument_count()); | 855       kBreakpointStaticHandlerRuntimeEntry.argument_count()); | 
| 833   ASSERT(isolate->debugger() != NULL); | 856   ASSERT(isolate->debugger() != NULL); | 
| 834   isolate->debugger()->SignalBpReached(); | 857   isolate->debugger()->SignalBpReached(); | 
| 835   // Make sure the static function that is about to be called is | 858   // Make sure the static function that is about to be called is | 
| 836   // compiled. The stub will jump to the entry point without any | 859   // compiled. The stub will jump to the entry point without any | 
| 837   // further tests. | 860   // further tests. | 
| 838   DartFrameIterator iterator; | 861   DartFrameIterator iterator; | 
| (...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1870   Isolate* isolate = Isolate::Current(); | 1893   Isolate* isolate = Isolate::Current(); | 
| 1871   StackZone zone(isolate); | 1894   StackZone zone(isolate); | 
| 1872   HANDLESCOPE(isolate); | 1895   HANDLESCOPE(isolate); | 
| 1873   const Bigint& big_left = Bigint::Handle(left); | 1896   const Bigint& big_left = Bigint::Handle(left); | 
| 1874   const Bigint& big_right = Bigint::Handle(right); | 1897   const Bigint& big_right = Bigint::Handle(right); | 
| 1875   return BigintOperations::Compare(big_left, big_right); | 1898   return BigintOperations::Compare(big_left, big_right); | 
| 1876 } | 1899 } | 
| 1877 END_LEAF_RUNTIME_ENTRY | 1900 END_LEAF_RUNTIME_ENTRY | 
| 1878 | 1901 | 
| 1879 }  // namespace dart | 1902 }  // namespace dart | 
| OLD | NEW | 
|---|