Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 53583003: Implement latest spec changes regarding malformed types (see issue 14006): (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698