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

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

Issue 23672011: Fix the previously ineffective assert checking the number of arguments passed to (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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') | runtime/vm/flow_graph_compiler_x64.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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 __ addiu(SP, SP, Immediate(-6 * kWordSize)); 600 __ addiu(SP, SP, Immediate(-6 * kWordSize));
601 __ LoadObject(TMP, Object::ZoneHandle()); 601 __ LoadObject(TMP, Object::ZoneHandle());
602 __ sw(TMP, Address(SP, 5 * kWordSize)); // Make room for the result. 602 __ sw(TMP, Address(SP, 5 * kWordSize)); // Make room for the result.
603 __ sw(A0, Address(SP, 4 * kWordSize)); // Push the instance. 603 __ sw(A0, Address(SP, 4 * kWordSize)); // Push the instance.
604 __ LoadObject(TMP, type); 604 __ LoadObject(TMP, type);
605 __ sw(TMP, Address(SP, 3 * kWordSize)); // Push the type. 605 __ sw(TMP, Address(SP, 3 * kWordSize)); // Push the type.
606 __ sw(A2, Address(SP, 2 * kWordSize)); // Push instantiator. 606 __ sw(A2, Address(SP, 2 * kWordSize)); // Push instantiator.
607 __ sw(A1, Address(SP, 1 * kWordSize)); // Push type arguments. 607 __ sw(A1, Address(SP, 1 * kWordSize)); // Push type arguments.
608 __ LoadObject(A0, test_cache); 608 __ LoadObject(A0, test_cache);
609 __ sw(A0, Address(SP, 0 * kWordSize)); 609 __ sw(A0, Address(SP, 0 * kWordSize));
610 GenerateCallRuntime(token_pos, deopt_id, kInstanceofRuntimeEntry, locs); 610 GenerateCallRuntime(token_pos, deopt_id, kInstanceofRuntimeEntry, 5, locs);
611 // Pop the parameters supplied to the runtime entry. The result of the 611 // Pop the parameters supplied to the runtime entry. The result of the
612 // instanceof runtime call will be left as the result of the operation. 612 // instanceof runtime call will be left as the result of the operation.
613 __ lw(T0, Address(SP, 5 * kWordSize)); 613 __ lw(T0, Address(SP, 5 * kWordSize));
614 __ addiu(SP, SP, Immediate(6 * kWordSize)); 614 __ addiu(SP, SP, Immediate(6 * kWordSize));
615 if (negate_result) { 615 if (negate_result) {
616 __ LoadObject(V0, Bool::True()); 616 __ LoadObject(V0, Bool::True());
617 __ bne(T0, V0, &done); 617 __ bne(T0, V0, &done);
618 __ LoadObject(V0, Bool::False()); 618 __ LoadObject(V0, Bool::False());
619 } else { 619 } else {
620 __ mov(V0, T0); 620 __ mov(V0, T0);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 __ sw(TMP1, Address(SP, 3 * kWordSize)); // Make room for the result. 691 __ sw(TMP1, Address(SP, 3 * kWordSize)); // Make room for the result.
692 __ sw(A0, Address(SP, 2 * kWordSize)); // Push the source object. 692 __ sw(A0, Address(SP, 2 * kWordSize)); // Push the source object.
693 __ LoadObject(TMP1, dst_name); 693 __ LoadObject(TMP1, dst_name);
694 __ sw(TMP1, Address(SP, 1 * kWordSize)); // Push the destination name. 694 __ sw(TMP1, Address(SP, 1 * kWordSize)); // Push the destination name.
695 __ LoadObject(TMP1, error_message); 695 __ LoadObject(TMP1, error_message);
696 __ sw(TMP1, Address(SP, 0 * kWordSize)); 696 __ sw(TMP1, Address(SP, 0 * kWordSize));
697 697
698 GenerateCallRuntime(token_pos, 698 GenerateCallRuntime(token_pos,
699 deopt_id, 699 deopt_id,
700 kMalformedTypeErrorRuntimeEntry, 700 kMalformedTypeErrorRuntimeEntry,
701 3,
701 locs); 702 locs);
702 // We should never return here. 703 // We should never return here.
703 __ break_(0); 704 __ break_(0);
704 705
705 __ Bind(&is_assignable); // For a null object. 706 __ Bind(&is_assignable); // For a null object.
706 // Restore instantiator and its type arguments. 707 // Restore instantiator and its type arguments.
707 __ lw(A1, Address(SP, 0 * kWordSize)); 708 __ lw(A1, Address(SP, 0 * kWordSize));
708 __ lw(A2, Address(SP, 1 * kWordSize)); 709 __ lw(A2, Address(SP, 1 * kWordSize));
709 __ addiu(SP, SP, Immediate(2 * kWordSize)); 710 __ addiu(SP, SP, Immediate(2 * kWordSize));
710 return; 711 return;
(...skipping 15 matching lines...) Expand all
726 __ sw(A0, Address(SP, 5 * kWordSize)); // Push the source object. 727 __ sw(A0, Address(SP, 5 * kWordSize)); // Push the source object.
727 __ LoadObject(TMP1, dst_type); 728 __ LoadObject(TMP1, dst_type);
728 __ sw(TMP1, Address(SP, 4 * kWordSize)); // Push the type of the destination. 729 __ sw(TMP1, Address(SP, 4 * kWordSize)); // Push the type of the destination.
729 __ sw(A2, Address(SP, 3 * kWordSize)); // Push instantiator. 730 __ sw(A2, Address(SP, 3 * kWordSize)); // Push instantiator.
730 __ sw(A1, Address(SP, 2 * kWordSize)); // Push type arguments. 731 __ sw(A1, Address(SP, 2 * kWordSize)); // Push type arguments.
731 __ LoadObject(TMP1, dst_name); 732 __ LoadObject(TMP1, dst_name);
732 __ sw(TMP1, Address(SP, 1 * kWordSize)); // Push the name of the destination. 733 __ sw(TMP1, Address(SP, 1 * kWordSize)); // Push the name of the destination.
733 __ LoadObject(T0, test_cache); 734 __ LoadObject(T0, test_cache);
734 __ sw(T0, Address(SP, 0 * kWordSize)); 735 __ sw(T0, Address(SP, 0 * kWordSize));
735 736
736 GenerateCallRuntime(token_pos, deopt_id, kTypeCheckRuntimeEntry, locs); 737 GenerateCallRuntime(token_pos, deopt_id, kTypeCheckRuntimeEntry, 6, locs);
737 // Pop the parameters supplied to the runtime entry. The result of the 738 // Pop the parameters supplied to the runtime entry. The result of the
738 // type check runtime call is the checked value. 739 // type check runtime call is the checked value.
739 __ lw(A0, Address(SP, 6 * kWordSize)); 740 __ lw(A0, Address(SP, 6 * kWordSize));
740 __ addiu(SP, SP, Immediate(7 * kWordSize)); 741 __ addiu(SP, SP, Immediate(7 * kWordSize));
741 742
742 __ Bind(&is_assignable); 743 __ Bind(&is_assignable);
743 // Restore instantiator and its type arguments. 744 // Restore instantiator and its type arguments.
744 __ lw(A1, Address(SP, 0 * kWordSize)); 745 __ lw(A1, Address(SP, 0 * kWordSize));
745 __ lw(A2, Address(SP, 1 * kWordSize)); 746 __ lw(A2, Address(SP, 1 * kWordSize));
746 __ addiu(SP, SP, Immediate(2 * kWordSize)); 747 __ addiu(SP, SP, Immediate(2 * kWordSize));
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 AddCurrentDescriptor(PcDescriptors::kDeopt, 1294 AddCurrentDescriptor(PcDescriptors::kDeopt,
1294 deopt_id_after, 1295 deopt_id_after,
1295 token_pos); 1296 token_pos);
1296 } 1297 }
1297 } 1298 }
1298 1299
1299 1300
1300 void FlowGraphCompiler::GenerateCallRuntime(intptr_t token_pos, 1301 void FlowGraphCompiler::GenerateCallRuntime(intptr_t token_pos,
1301 intptr_t deopt_id, 1302 intptr_t deopt_id,
1302 const RuntimeEntry& entry, 1303 const RuntimeEntry& entry,
1304 intptr_t argument_count,
1303 LocationSummary* locs) { 1305 LocationSummary* locs) {
1304 __ CallRuntime(entry); 1306 __ CallRuntime(entry, argument_count);
1305 AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos); 1307 AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos);
1306 RecordSafepoint(locs); 1308 RecordSafepoint(locs);
1307 if (deopt_id != Isolate::kNoDeoptId) { 1309 if (deopt_id != Isolate::kNoDeoptId) {
1308 // Marks either the continuation point in unoptimized code or the 1310 // Marks either the continuation point in unoptimized code or the
1309 // deoptimization point in optimized code, after call. 1311 // deoptimization point in optimized code, after call.
1310 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id); 1312 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
1311 if (is_optimizing()) { 1313 if (is_optimizing()) {
1312 AddDeoptIndexAtCall(deopt_id_after, token_pos); 1314 AddDeoptIndexAtCall(deopt_id_after, token_pos);
1313 } else { 1315 } else {
1314 // Add deoptimization continuation point after the call and before the 1316 // Add deoptimization continuation point after the call and before the
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1995 __ AddImmediate(SP, kDoubleSize); 1997 __ AddImmediate(SP, kDoubleSize);
1996 } 1998 }
1997 1999
1998 2000
1999 #undef __ 2001 #undef __
2000 2002
2001 2003
2002 } // namespace dart 2004 } // namespace dart
2003 2005
2004 #endif // defined TARGET_ARCH_MIPS 2006 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698