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

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

Issue 10829222: Fix a stack state error in checked mode. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 months 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_ia32.cc ('k') | no next file » | 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) 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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 __ PushObject(dst_name); // Push the name of the destination. 591 __ PushObject(dst_name); // Push the name of the destination.
592 __ PushObject(error_message); 592 __ PushObject(error_message);
593 GenerateCallRuntime(deopt_id, 593 GenerateCallRuntime(deopt_id,
594 token_pos, 594 token_pos,
595 try_index, 595 try_index,
596 kMalformedTypeErrorRuntimeEntry); 596 kMalformedTypeErrorRuntimeEntry);
597 // We should never return here. 597 // We should never return here.
598 __ int3(); 598 __ int3();
599 599
600 __ Bind(&is_assignable); // For a null object. 600 __ Bind(&is_assignable); // For a null object.
601 __ popq(RDX); // Remove pushed instantiator type arguments.
602 __ popq(RCX); // Remove pushed instantiator.
601 return; 603 return;
602 } 604 }
603 605
604 // Generate inline type check, linking to runtime call if not assignable. 606 // Generate inline type check, linking to runtime call if not assignable.
605 SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(); 607 SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle();
606 test_cache = GenerateInlineInstanceof(token_pos, dst_type, 608 test_cache = GenerateInlineInstanceof(token_pos, dst_type,
607 &is_assignable, &runtime_call); 609 &is_assignable, &runtime_call);
608 610
609 __ Bind(&runtime_call); 611 __ Bind(&runtime_call);
610 __ movq(RDX, Address(RSP, 0)); // Get instantiator type arguments. 612 __ movq(RDX, Address(RSP, 0)); // Get instantiator type arguments.
611 __ movq(RCX, Address(RSP, kWordSize)); // Get instantiator. 613 __ movq(RCX, Address(RSP, kWordSize)); // Get instantiator.
612 __ PushObject(Object::ZoneHandle()); // Make room for the result. 614 __ PushObject(Object::ZoneHandle()); // Make room for the result.
613 __ pushq(RAX); // Push the source object. 615 __ pushq(RAX); // Push the source object.
614 __ PushObject(dst_type); // Push the type of the destination. 616 __ PushObject(dst_type); // Push the type of the destination.
615 __ pushq(RCX); // Instantiator. 617 __ pushq(RCX); // Instantiator.
616 __ pushq(RDX); // Instantiator type arguments. 618 __ pushq(RDX); // Instantiator type arguments.
617 __ PushObject(dst_name); // Push the name of the destination. 619 __ PushObject(dst_name); // Push the name of the destination.
618 __ LoadObject(RAX, test_cache); 620 __ LoadObject(RAX, test_cache);
619 __ pushq(RAX); 621 __ pushq(RAX);
620 GenerateCallRuntime(deopt_id, 622 GenerateCallRuntime(deopt_id,
621 token_pos, 623 token_pos,
622 try_index, 624 try_index,
623 kTypeCheckRuntimeEntry); 625 kTypeCheckRuntimeEntry);
624 // Pop the parameters supplied to the runtime entry. The result of the 626 // Pop the parameters supplied to the runtime entry. The result of the
625 // type check runtime call is the checked value. 627 // type check runtime call is the checked value.
626 __ Drop(6); 628 __ Drop(6);
627 __ popq(RAX); 629 __ popq(RAX);
628 630
629 __ Bind(&is_assignable); 631 __ Bind(&is_assignable);
630 __ popq(RDX); // Remove pushed instantiator type arguments.. 632 __ popq(RDX); // Remove pushed instantiator type arguments.
631 __ popq(RCX); // Remove pushed instantiator. 633 __ popq(RCX); // Remove pushed instantiator.
632 } 634 }
633 635
634 636
635 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) { 637 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) {
636 LocationSummary* locs = instr->locs(); 638 LocationSummary* locs = instr->locs();
637 ASSERT(locs != NULL); 639 ASSERT(locs != NULL);
638 640
639 frame_register_allocator()->AllocateRegisters(instr); 641 frame_register_allocator()->AllocateRegisters(instr);
640 642
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { 1215 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) {
1214 __ Exchange(mem1, mem2); 1216 __ Exchange(mem1, mem2);
1215 } 1217 }
1216 1218
1217 1219
1218 #undef __ 1220 #undef __
1219 1221
1220 } // namespace dart 1222 } // namespace dart
1221 1223
1222 #endif // defined TARGET_ARCH_X64 1224 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698