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/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
9 | 9 |
10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 // a transition sentinel can be seen here. | 681 // a transition sentinel can be seen here. |
682 const Immediate& raw_transition_sentinel = | 682 const Immediate& raw_transition_sentinel = |
683 Immediate(reinterpret_cast<intptr_t>( | 683 Immediate(reinterpret_cast<intptr_t>( |
684 Object::transition_sentinel().raw())); | 684 Object::transition_sentinel().raw())); |
685 __ cmpl(EAX, raw_transition_sentinel); | 685 __ cmpl(EAX, raw_transition_sentinel); |
686 __ j(EQUAL, &is_assignable); | 686 __ j(EQUAL, &is_assignable); |
687 } | 687 } |
688 | 688 |
689 // Generate throw new TypeError() if the type is malformed or malbounded. | 689 // Generate throw new TypeError() if the type is malformed or malbounded. |
690 if (dst_type.IsMalformed() || dst_type.IsMalbounded()) { | 690 if (dst_type.IsMalformed() || dst_type.IsMalbounded()) { |
691 Error& error = Error::Handle(); | |
692 if (dst_type.IsMalformed()) { | |
693 error = dst_type.malformed_error(); | |
694 } else { | |
695 const bool is_malbounded = dst_type.IsMalboundedWithError(&error); | |
696 ASSERT(is_malbounded); | |
697 } | |
698 const String& error_message = String::ZoneHandle( | |
699 Symbols::New(error.ToErrorCString())); | |
700 __ PushObject(Object::ZoneHandle()); // Make room for the result. | 691 __ PushObject(Object::ZoneHandle()); // Make room for the result. |
701 __ pushl(EAX); // Push the source object. | 692 __ pushl(EAX); // Push the source object. |
702 __ PushObject(dst_name); // Push the name of the destination. | 693 __ PushObject(dst_name); // Push the name of the destination. |
703 __ PushObject(error_message); | 694 __ PushObject(dst_type); // Push the type of the destination. |
704 GenerateRuntimeCall(token_pos, | 695 GenerateRuntimeCall(token_pos, |
705 deopt_id, | 696 deopt_id, |
706 kMalformedTypeErrorRuntimeEntry, | 697 kBadTypeErrorRuntimeEntry, |
707 3, | 698 3, |
708 locs); | 699 locs); |
709 // We should never return here. | 700 // We should never return here. |
710 __ int3(); | 701 __ int3(); |
711 | 702 |
712 __ Bind(&is_assignable); // For a null object. | 703 __ Bind(&is_assignable); // For a null object. |
713 __ popl(EDX); // Remove pushed instantiator type arguments. | 704 __ popl(EDX); // Remove pushed instantiator type arguments. |
714 __ popl(ECX); // Remove pushed instantiator. | 705 __ popl(ECX); // Remove pushed instantiator. |
715 return; | 706 return; |
716 } | 707 } |
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1928 __ movups(reg, Address(ESP, 0)); | 1919 __ movups(reg, Address(ESP, 0)); |
1929 __ addl(ESP, Immediate(kFpuRegisterSize)); | 1920 __ addl(ESP, Immediate(kFpuRegisterSize)); |
1930 } | 1921 } |
1931 | 1922 |
1932 | 1923 |
1933 #undef __ | 1924 #undef __ |
1934 | 1925 |
1935 } // namespace dart | 1926 } // namespace dart |
1936 | 1927 |
1937 #endif // defined TARGET_ARCH_IA32 | 1928 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |