| 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 __ PushObject(dst_name); // Push the name of the destination. | 610 __ PushObject(dst_name); // Push the name of the destination. |
| 611 __ PushObject(error_message); | 611 __ PushObject(error_message); |
| 612 GenerateCallRuntime(deopt_id, | 612 GenerateCallRuntime(deopt_id, |
| 613 token_pos, | 613 token_pos, |
| 614 try_index, | 614 try_index, |
| 615 kMalformedTypeErrorRuntimeEntry); | 615 kMalformedTypeErrorRuntimeEntry); |
| 616 // We should never return here. | 616 // We should never return here. |
| 617 __ int3(); | 617 __ int3(); |
| 618 | 618 |
| 619 __ Bind(&is_assignable); // For a null object. | 619 __ Bind(&is_assignable); // For a null object. |
| 620 __ popl(EDX); // Remove pushed instantiator type arguments. |
| 621 __ popl(ECX); // Remove pushed instantiator. |
| 620 return; | 622 return; |
| 621 } | 623 } |
| 622 | 624 |
| 623 // Generate inline type check, linking to runtime call if not assignable. | 625 // Generate inline type check, linking to runtime call if not assignable. |
| 624 SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(); | 626 SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(); |
| 625 test_cache = GenerateInlineInstanceof(token_pos, dst_type, | 627 test_cache = GenerateInlineInstanceof(token_pos, dst_type, |
| 626 &is_assignable, &runtime_call); | 628 &is_assignable, &runtime_call); |
| 627 | 629 |
| 628 __ Bind(&runtime_call); | 630 __ Bind(&runtime_call); |
| 629 __ movl(EDX, Address(ESP, 0)); // Get instantiator type arguments. | 631 __ movl(EDX, Address(ESP, 0)); // Get instantiator type arguments. |
| 630 __ movl(ECX, Address(ESP, kWordSize)); // Get instantiator. | 632 __ movl(ECX, Address(ESP, kWordSize)); // Get instantiator. |
| 631 __ PushObject(Object::ZoneHandle()); // Make room for the result. | 633 __ PushObject(Object::ZoneHandle()); // Make room for the result. |
| 632 __ pushl(EAX); // Push the source object. | 634 __ pushl(EAX); // Push the source object. |
| 633 __ PushObject(dst_type); // Push the type of the destination. | 635 __ PushObject(dst_type); // Push the type of the destination. |
| 634 __ pushl(ECX); // Instantiator. | 636 __ pushl(ECX); // Instantiator. |
| 635 __ pushl(EDX); // Instantiator type arguments. | 637 __ pushl(EDX); // Instantiator type arguments. |
| 636 __ PushObject(dst_name); // Push the name of the destination. | 638 __ PushObject(dst_name); // Push the name of the destination. |
| 637 __ LoadObject(EAX, test_cache); | 639 __ LoadObject(EAX, test_cache); |
| 638 __ pushl(EAX); | 640 __ pushl(EAX); |
| 639 GenerateCallRuntime(deopt_id, | 641 GenerateCallRuntime(deopt_id, |
| 640 token_pos, | 642 token_pos, |
| 641 try_index, | 643 try_index, |
| 642 kTypeCheckRuntimeEntry); | 644 kTypeCheckRuntimeEntry); |
| 643 // Pop the parameters supplied to the runtime entry. The result of the | 645 // Pop the parameters supplied to the runtime entry. The result of the |
| 644 // type check runtime call is the checked value. | 646 // type check runtime call is the checked value. |
| 645 __ Drop(6); | 647 __ Drop(6); |
| 646 __ popl(EAX); | 648 __ popl(EAX); |
| 647 | 649 |
| 648 __ Bind(&is_assignable); | 650 __ Bind(&is_assignable); |
| 649 __ popl(EDX); // Remove pushed instantiator type arguments.. | 651 __ popl(EDX); // Remove pushed instantiator type arguments. |
| 650 __ popl(ECX); // Remove pushed instantiator. | 652 __ popl(ECX); // Remove pushed instantiator. |
| 651 } | 653 } |
| 652 | 654 |
| 653 | 655 |
| 654 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) { | 656 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) { |
| 655 LocationSummary* locs = instr->locs(); | 657 LocationSummary* locs = instr->locs(); |
| 656 ASSERT(locs != NULL); | 658 ASSERT(locs != NULL); |
| 657 | 659 |
| 658 frame_register_allocator()->AllocateRegisters(instr); | 660 frame_register_allocator()->AllocateRegisters(instr); |
| 659 | 661 |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1251 __ popl(ECX); | 1253 __ popl(ECX); |
| 1252 __ popl(EAX); | 1254 __ popl(EAX); |
| 1253 } | 1255 } |
| 1254 | 1256 |
| 1255 | 1257 |
| 1256 #undef __ | 1258 #undef __ |
| 1257 | 1259 |
| 1258 } // namespace dart | 1260 } // namespace dart |
| 1259 | 1261 |
| 1260 #endif // defined TARGET_ARCH_IA32 | 1262 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |