| 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/code_generator.h" | 5 #include "vm/code_generator.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.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 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 ASSERT(!target_function.IsNull()); | 996 ASSERT(!target_function.IsNull()); |
| 997 // Insert function found into cache and return it. | 997 // Insert function found into cache and return it. |
| 998 cache.EnsureCapacity(); | 998 cache.EnsureCapacity(); |
| 999 const Smi& class_id = Smi::Handle(Smi::New(cls.id())); | 999 const Smi& class_id = Smi::Handle(Smi::New(cls.id())); |
| 1000 cache.Insert(class_id, target_function); | 1000 cache.Insert(class_id, target_function); |
| 1001 arguments.SetReturn(target_function); | 1001 arguments.SetReturn(target_function); |
| 1002 } | 1002 } |
| 1003 | 1003 |
| 1004 | 1004 |
| 1005 // Invoke appropriate noSuchMethod function. | 1005 // Invoke appropriate noSuchMethod function. |
| 1006 // Arg0: receiver. | 1006 // Arg0: receiver (closure object) |
| 1007 // Arg1: ic-data. | 1007 // Arg1: arguments descriptor array. |
| 1008 // Arg2: arguments descriptor array. | 1008 // Arg2: arguments array. |
| 1009 // Arg3: arguments array. | 1009 DEFINE_RUNTIME_ENTRY(InvokeClosureNoSuchMethod, 3) { |
| 1010 DEFINE_RUNTIME_ENTRY(InvokeNoSuchMethodFunction, 4) { | |
| 1011 const Instance& receiver = Instance::CheckedHandle(arguments.ArgAt(0)); | 1010 const Instance& receiver = Instance::CheckedHandle(arguments.ArgAt(0)); |
| 1012 const ICData& ic_data = ICData::CheckedHandle(arguments.ArgAt(1)); | 1011 const Array& orig_arguments_desc = Array::CheckedHandle(arguments.ArgAt(1)); |
| 1013 const Array& orig_arguments_desc = Array::CheckedHandle(arguments.ArgAt(2)); | 1012 const Array& orig_arguments = Array::CheckedHandle(arguments.ArgAt(2)); |
| 1014 const Array& orig_arguments = Array::CheckedHandle(arguments.ArgAt(3)); | |
| 1015 | 1013 |
| 1016 String& original_function_name = String::Handle(ic_data.target_name()); | 1014 // For closure the function name is always 'call'. Replace it with the |
| 1017 if (receiver.IsClosure()) { | 1015 // name of the closurized function so that exception contains more |
| 1018 // For closure the function name is always 'call'. Replace it with the | 1016 // relevant information. |
| 1019 // name of the closurized function so that exception contains more | 1017 ASSERT(receiver.IsClosure()); |
| 1020 // relevant information. | 1018 const Function& function = Function::Handle(Closure::function(receiver)); |
| 1021 const Function& function = Function::Handle(Closure::function(receiver)); | 1019 const String& original_function_name = |
| 1022 original_function_name = function.QualifiedUserVisibleName(); | 1020 String::Handle(function.QualifiedUserVisibleName()); |
| 1023 } | |
| 1024 const Object& result = Object::Handle( | 1021 const Object& result = Object::Handle( |
| 1025 DartEntry::InvokeNoSuchMethod(receiver, | 1022 DartEntry::InvokeNoSuchMethod(receiver, |
| 1026 original_function_name, | 1023 original_function_name, |
| 1027 orig_arguments, | 1024 orig_arguments, |
| 1028 orig_arguments_desc)); | 1025 orig_arguments_desc)); |
| 1029 CheckResultError(result); | 1026 CheckResultError(result); |
| 1030 arguments.SetReturn(result); | 1027 arguments.SetReturn(result); |
| 1031 } | 1028 } |
| 1032 | 1029 |
| 1033 | 1030 |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1584 field.RecordStore(value); | 1581 field.RecordStore(value); |
| 1585 } | 1582 } |
| 1586 | 1583 |
| 1587 | 1584 |
| 1588 DEFINE_RUNTIME_ENTRY(InitStaticField, 1) { | 1585 DEFINE_RUNTIME_ENTRY(InitStaticField, 1) { |
| 1589 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); | 1586 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); |
| 1590 field.EvaluateInitializer(); | 1587 field.EvaluateInitializer(); |
| 1591 } | 1588 } |
| 1592 | 1589 |
| 1593 } // namespace dart | 1590 } // namespace dart |
| OLD | NEW |