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/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
9 | 9 |
10 #include "lib/error.h" | 10 #include "lib/error.h" |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 if (StackSize() != 0) { | 805 if (StackSize() != 0) { |
806 // We need to unwind the space we reserved for locals and copied parameters. | 806 // We need to unwind the space we reserved for locals and copied parameters. |
807 // The NoSuchMethodFunction stub does not expect to see that area on the | 807 // The NoSuchMethodFunction stub does not expect to see that area on the |
808 // stack. | 808 // stack. |
809 __ addl(ESP, Immediate(StackSize() * kWordSize)); | 809 __ addl(ESP, Immediate(StackSize() * kWordSize)); |
810 } | 810 } |
811 // The calls immediately below have empty stackmaps because we have just | 811 // The calls immediately below have empty stackmaps because we have just |
812 // dropped the spill slots. | 812 // dropped the spill slots. |
813 BitmapBuilder* empty_stack_bitmap = new BitmapBuilder(); | 813 BitmapBuilder* empty_stack_bitmap = new BitmapBuilder(); |
814 if (function.IsClosureFunction()) { | 814 if (function.IsClosureFunction()) { |
| 815 // TODO(regis): Call NoSuchMethod with "call" as name of original function. |
815 // We do not use GenerateCallRuntime because of the non-standard (empty) | 816 // We do not use GenerateCallRuntime because of the non-standard (empty) |
816 // stackmap used here. | 817 // stackmap used here. |
817 __ CallRuntime(kClosureArgumentMismatchRuntimeEntry); | 818 __ CallRuntime(kClosureArgumentMismatchRuntimeEntry); |
818 AddCurrentDescriptor(PcDescriptors::kOther, | 819 AddCurrentDescriptor(PcDescriptors::kOther, |
819 Isolate::kNoDeoptId, | 820 Isolate::kNoDeoptId, |
820 0); // No token position. | 821 0); // No token position. |
821 } else { | 822 } else { |
822 // Invoke noSuchMethod function. | 823 // Invoke noSuchMethod function. |
823 const int kNumArgsChecked = 1; | 824 const int kNumArgsChecked = 1; |
824 ICData& ic_data = ICData::ZoneHandle(); | 825 ICData& ic_data = ICData::ZoneHandle(); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 #endif | 953 #endif |
953 if (check_arguments) { | 954 if (check_arguments) { |
954 __ Comment("Check argument count"); | 955 __ Comment("Check argument count"); |
955 // Check that num_fixed <= argc <= num_params. | 956 // Check that num_fixed <= argc <= num_params. |
956 Label argc_in_range; | 957 Label argc_in_range; |
957 // Total number of args is the first Smi in args descriptor array (EDX). | 958 // Total number of args is the first Smi in args descriptor array (EDX). |
958 __ movl(EAX, FieldAddress(EDX, Array::data_offset())); | 959 __ movl(EAX, FieldAddress(EDX, Array::data_offset())); |
959 __ cmpl(EAX, Immediate(Smi::RawValue(num_fixed_params))); | 960 __ cmpl(EAX, Immediate(Smi::RawValue(num_fixed_params))); |
960 __ j(EQUAL, &argc_in_range, Assembler::kNearJump); | 961 __ j(EQUAL, &argc_in_range, Assembler::kNearJump); |
961 if (function.IsClosureFunction()) { | 962 if (function.IsClosureFunction()) { |
| 963 // TODO(regis): Call NoSuchMethod with "call" as name of original |
| 964 // function. |
962 GenerateCallRuntime(function.token_pos(), | 965 GenerateCallRuntime(function.token_pos(), |
963 kClosureArgumentMismatchRuntimeEntry, | 966 kClosureArgumentMismatchRuntimeEntry, |
964 prologue_locs); | 967 prologue_locs); |
965 } else { | 968 } else { |
966 __ Stop("Wrong number of arguments"); | 969 __ Stop("Wrong number of arguments"); |
967 } | 970 } |
968 __ Bind(&argc_in_range); | 971 __ Bind(&argc_in_range); |
969 } | 972 } |
970 // The arguments descriptor is never saved in the absence of optional | 973 // The arguments descriptor is never saved in the absence of optional |
971 // parameters, since any argument definition test would always yield true. | 974 // parameters, since any argument definition test would always yield true. |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1384 __ popl(ECX); | 1387 __ popl(ECX); |
1385 __ popl(EAX); | 1388 __ popl(EAX); |
1386 } | 1389 } |
1387 | 1390 |
1388 | 1391 |
1389 #undef __ | 1392 #undef __ |
1390 | 1393 |
1391 } // namespace dart | 1394 } // namespace dart |
1392 | 1395 |
1393 #endif // defined TARGET_ARCH_IA32 | 1396 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |