Chromium Code Reviews| 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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 656 // Performance notes: positive checks must be quick, negative checks can be slow | 656 // Performance notes: positive checks must be quick, negative checks can be slow |
| 657 // as they throw an exception. | 657 // as they throw an exception. |
| 658 void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos, | 658 void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos, |
| 659 intptr_t deopt_id, | 659 intptr_t deopt_id, |
| 660 const AbstractType& dst_type, | 660 const AbstractType& dst_type, |
| 661 const String& dst_name, | 661 const String& dst_name, |
| 662 LocationSummary* locs) { | 662 LocationSummary* locs) { |
| 663 ASSERT(token_pos >= 0); | 663 ASSERT(token_pos >= 0); |
| 664 ASSERT(!dst_type.IsNull()); | 664 ASSERT(!dst_type.IsNull()); |
| 665 ASSERT(dst_type.IsFinalized()); | 665 ASSERT(dst_type.IsFinalized()); |
| 666 // Assignable check is skipped in FlowGraphBuilder, not here. | 666 // Assignable check is skipped in FlowGraphBuilder, when possible. |
| 667 ASSERT(dst_type.IsMalformed() || dst_type.IsMalbounded() || | 667 // The optimizer may have instantiated dst_type to dynamic or Object. |
| 668 (!dst_type.IsDynamicType() && !dst_type.IsObjectType())); | 668 if (!dst_type.IsMalformed() && !dst_type.IsMalbounded() && |
| 669 (dst_type.IsDynamicType() || dst_type.IsObjectType())) { | |
| 670 return; | |
| 671 } | |
|
srdjan
2013/10/03 18:00:09
This elimination belongs in AssertAssignableInstr:
regis
2013/10/03 18:20:53
Done.
| |
| 669 __ pushl(ECX); // Store instantiator. | 672 __ pushl(ECX); // Store instantiator. |
| 670 __ pushl(EDX); // Store instantiator type arguments. | 673 __ pushl(EDX); // Store instantiator type arguments. |
| 671 // A null object is always assignable and is returned as result. | 674 // A null object is always assignable and is returned as result. |
| 672 const Immediate& raw_null = | 675 const Immediate& raw_null = |
| 673 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 676 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 674 Label is_assignable, runtime_call; | 677 Label is_assignable, runtime_call; |
| 675 __ cmpl(EAX, raw_null); | 678 __ cmpl(EAX, raw_null); |
| 676 __ j(EQUAL, &is_assignable); | 679 __ j(EQUAL, &is_assignable); |
| 677 | 680 |
| 678 if (!FLAG_eliminate_type_checks || dst_type.IsMalformed()) { | 681 if (!FLAG_eliminate_type_checks || dst_type.IsMalformed()) { |
| (...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1915 __ movups(reg, Address(ESP, 0)); | 1918 __ movups(reg, Address(ESP, 0)); |
| 1916 __ addl(ESP, Immediate(kFpuRegisterSize)); | 1919 __ addl(ESP, Immediate(kFpuRegisterSize)); |
| 1917 } | 1920 } |
| 1918 | 1921 |
| 1919 | 1922 |
| 1920 #undef __ | 1923 #undef __ |
| 1921 | 1924 |
| 1922 } // namespace dart | 1925 } // namespace dart |
| 1923 | 1926 |
| 1924 #endif // defined TARGET_ARCH_IA32 | 1927 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |