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

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

Issue 363093004: Use Object::null_object() instead of Object::ZoneHandle() when a null object (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 584
585 // test_cache is null if there is no fall-through. 585 // test_cache is null if there is no fall-through.
586 Label done; 586 Label done;
587 if (!test_cache.IsNull()) { 587 if (!test_cache.IsNull()) {
588 // Generate runtime call. 588 // Generate runtime call.
589 // Load instantiator (A2) and its type arguments (A1). 589 // Load instantiator (A2) and its type arguments (A1).
590 __ lw(A1, Address(SP, 0 * kWordSize)); 590 __ lw(A1, Address(SP, 0 * kWordSize));
591 __ lw(A2, Address(SP, 1 * kWordSize)); 591 __ lw(A2, Address(SP, 1 * kWordSize));
592 592
593 __ addiu(SP, SP, Immediate(-6 * kWordSize)); 593 __ addiu(SP, SP, Immediate(-6 * kWordSize));
594 __ LoadObject(TMP, Object::ZoneHandle()); 594 __ LoadObject(TMP, Object::null_object());
595 __ sw(TMP, Address(SP, 5 * kWordSize)); // Make room for the result. 595 __ sw(TMP, Address(SP, 5 * kWordSize)); // Make room for the result.
596 __ sw(A0, Address(SP, 4 * kWordSize)); // Push the instance. 596 __ sw(A0, Address(SP, 4 * kWordSize)); // Push the instance.
597 __ LoadObject(TMP, type); 597 __ LoadObject(TMP, type);
598 __ sw(TMP, Address(SP, 3 * kWordSize)); // Push the type. 598 __ sw(TMP, Address(SP, 3 * kWordSize)); // Push the type.
599 __ sw(A2, Address(SP, 2 * kWordSize)); // Push instantiator. 599 __ sw(A2, Address(SP, 2 * kWordSize)); // Push instantiator.
600 __ sw(A1, Address(SP, 1 * kWordSize)); // Push type arguments. 600 __ sw(A1, Address(SP, 1 * kWordSize)); // Push type arguments.
601 __ LoadObject(A0, test_cache); 601 __ LoadObject(A0, test_cache);
602 __ sw(A0, Address(SP, 0 * kWordSize)); 602 __ sw(A0, Address(SP, 0 * kWordSize));
603 GenerateRuntimeCall(token_pos, deopt_id, kInstanceofRuntimeEntry, 5, locs); 603 GenerateRuntimeCall(token_pos, deopt_id, kInstanceofRuntimeEntry, 5, locs);
604 // Pop the parameters supplied to the runtime entry. The result of the 604 // Pop the parameters supplied to the runtime entry. The result of the
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 657
658 // A null object is always assignable and is returned as result. 658 // A null object is always assignable and is returned as result.
659 Label is_assignable, runtime_call; 659 Label is_assignable, runtime_call;
660 660
661 __ BranchEqual(A0, reinterpret_cast<int32_t>(Object::null()), &is_assignable); 661 __ BranchEqual(A0, reinterpret_cast<int32_t>(Object::null()), &is_assignable);
662 __ delay_slot()->sw(A1, Address(SP, 0 * kWordSize)); 662 __ delay_slot()->sw(A1, Address(SP, 0 * kWordSize));
663 663
664 // Generate throw new TypeError() if the type is malformed or malbounded. 664 // Generate throw new TypeError() if the type is malformed or malbounded.
665 if (dst_type.IsMalformedOrMalbounded()) { 665 if (dst_type.IsMalformedOrMalbounded()) {
666 __ addiu(SP, SP, Immediate(-4 * kWordSize)); 666 __ addiu(SP, SP, Immediate(-4 * kWordSize));
667 __ LoadObject(TMP, Object::ZoneHandle()); 667 __ LoadObject(TMP, Object::null_object());
668 __ sw(TMP, Address(SP, 3 * kWordSize)); // Make room for the result. 668 __ sw(TMP, Address(SP, 3 * kWordSize)); // Make room for the result.
669 __ sw(A0, Address(SP, 2 * kWordSize)); // Push the source object. 669 __ sw(A0, Address(SP, 2 * kWordSize)); // Push the source object.
670 __ LoadObject(TMP, dst_name); 670 __ LoadObject(TMP, dst_name);
671 __ sw(TMP, Address(SP, 1 * kWordSize)); // Push the destination name. 671 __ sw(TMP, Address(SP, 1 * kWordSize)); // Push the destination name.
672 __ LoadObject(TMP, dst_type); 672 __ LoadObject(TMP, dst_type);
673 __ sw(TMP, Address(SP, 0 * kWordSize)); // Push the destination type. 673 __ sw(TMP, Address(SP, 0 * kWordSize)); // Push the destination type.
674 674
675 GenerateRuntimeCall(token_pos, 675 GenerateRuntimeCall(token_pos,
676 deopt_id, 676 deopt_id,
677 kBadTypeErrorRuntimeEntry, 677 kBadTypeErrorRuntimeEntry,
(...skipping 14 matching lines...) Expand all
692 SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(); 692 SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle();
693 test_cache = GenerateInlineInstanceof(token_pos, dst_type, 693 test_cache = GenerateInlineInstanceof(token_pos, dst_type,
694 &is_assignable, &runtime_call); 694 &is_assignable, &runtime_call);
695 695
696 __ Bind(&runtime_call); 696 __ Bind(&runtime_call);
697 // Load instantiator (A2) and its type arguments (A1). 697 // Load instantiator (A2) and its type arguments (A1).
698 __ lw(A1, Address(SP, 0 * kWordSize)); 698 __ lw(A1, Address(SP, 0 * kWordSize));
699 __ lw(A2, Address(SP, 1 * kWordSize)); 699 __ lw(A2, Address(SP, 1 * kWordSize));
700 700
701 __ addiu(SP, SP, Immediate(-7 * kWordSize)); 701 __ addiu(SP, SP, Immediate(-7 * kWordSize));
702 __ LoadObject(TMP, Object::ZoneHandle()); 702 __ LoadObject(TMP, Object::null_object());
703 __ sw(TMP, Address(SP, 6 * kWordSize)); // Make room for the result. 703 __ sw(TMP, Address(SP, 6 * kWordSize)); // Make room for the result.
704 __ sw(A0, Address(SP, 5 * kWordSize)); // Push the source object. 704 __ sw(A0, Address(SP, 5 * kWordSize)); // Push the source object.
705 __ LoadObject(TMP, dst_type); 705 __ LoadObject(TMP, dst_type);
706 __ sw(TMP, Address(SP, 4 * kWordSize)); // Push the type of the destination. 706 __ sw(TMP, Address(SP, 4 * kWordSize)); // Push the type of the destination.
707 __ sw(A2, Address(SP, 3 * kWordSize)); // Push instantiator. 707 __ sw(A2, Address(SP, 3 * kWordSize)); // Push instantiator.
708 __ sw(A1, Address(SP, 2 * kWordSize)); // Push type arguments. 708 __ sw(A1, Address(SP, 2 * kWordSize)); // Push type arguments.
709 __ LoadObject(TMP, dst_name); 709 __ LoadObject(TMP, dst_name);
710 __ sw(TMP, Address(SP, 1 * kWordSize)); // Push the name of the destination. 710 __ sw(TMP, Address(SP, 1 * kWordSize)); // Push the name of the destination.
711 __ LoadObject(T0, test_cache); 711 __ LoadObject(T0, test_cache);
712 __ sw(T0, Address(SP, 0 * kWordSize)); 712 __ sw(T0, Address(SP, 0 * kWordSize));
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1807 __ AddImmediate(SP, kDoubleSize); 1807 __ AddImmediate(SP, kDoubleSize);
1808 } 1808 }
1809 1809
1810 1810
1811 #undef __ 1811 #undef __
1812 1812
1813 1813
1814 } // namespace dart 1814 } // namespace dart
1815 1815
1816 #endif // defined TARGET_ARCH_MIPS 1816 #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