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

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

Issue 2718513002: Void is not required to be `null` anymore. (Closed)
Patch Set: Update Kernel code. Created 3 years, 7 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
« 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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 // Clobbers: T0, T1, T2 513 // Clobbers: T0, T1, T2
514 // Note that this inlined code must be followed by the runtime_call code, as it 514 // Note that this inlined code must be followed by the runtime_call code, as it
515 // may fall through to it. Otherwise, this inline code will jump to the label 515 // may fall through to it. Otherwise, this inline code will jump to the label
516 // is_instance or to the label is_not_instance. 516 // is_instance or to the label is_not_instance.
517 RawSubtypeTestCache* FlowGraphCompiler::GenerateInlineInstanceof( 517 RawSubtypeTestCache* FlowGraphCompiler::GenerateInlineInstanceof(
518 TokenPosition token_pos, 518 TokenPosition token_pos,
519 const AbstractType& type, 519 const AbstractType& type,
520 Label* is_instance_lbl, 520 Label* is_instance_lbl,
521 Label* is_not_instance_lbl) { 521 Label* is_not_instance_lbl) {
522 __ Comment("InlineInstanceof"); 522 __ Comment("InlineInstanceof");
523 if (type.IsVoidType()) {
524 // A non-null value is returned from a void function, which will result in a
525 // type error. A null value is handled prior to executing this inline code.
526 return SubtypeTestCache::null();
527 }
528 if (type.IsInstantiated()) { 523 if (type.IsInstantiated()) {
529 const Class& type_class = Class::ZoneHandle(zone(), type.type_class()); 524 const Class& type_class = Class::ZoneHandle(zone(), type.type_class());
530 // A class equality check is only applicable with a dst type (not a 525 // A class equality check is only applicable with a dst type (not a
531 // function type) of a non-parameterized class or with a raw dst type of 526 // function type) of a non-parameterized class or with a raw dst type of
532 // a parameterized class. 527 // a parameterized class.
533 if (type.IsFunctionType() || (type_class.NumTypeArguments() > 0)) { 528 if (type.IsFunctionType() || (type_class.NumTypeArguments() > 0)) {
534 return GenerateInstantiatedTypeWithArgumentsTest( 529 return GenerateInstantiatedTypeWithArgumentsTest(
535 token_pos, type, is_instance_lbl, is_not_instance_lbl); 530 token_pos, type, is_instance_lbl, is_not_instance_lbl);
536 // Fall through to runtime call. 531 // Fall through to runtime call.
537 } 532 }
(...skipping 22 matching lines...) Expand all
560 // - A0: object. 555 // - A0: object.
561 // - A1: instantiator type arguments or raw_null. 556 // - A1: instantiator type arguments or raw_null.
562 // - A2: function type arguments or raw_null. 557 // - A2: function type arguments or raw_null.
563 // Returns: 558 // Returns:
564 // - true or false in V0. 559 // - true or false in V0.
565 void FlowGraphCompiler::GenerateInstanceOf(TokenPosition token_pos, 560 void FlowGraphCompiler::GenerateInstanceOf(TokenPosition token_pos,
566 intptr_t deopt_id, 561 intptr_t deopt_id,
567 const AbstractType& type, 562 const AbstractType& type,
568 LocationSummary* locs) { 563 LocationSummary* locs) {
569 ASSERT(type.IsFinalized() && !type.IsMalformed() && !type.IsMalbounded()); 564 ASSERT(type.IsFinalized() && !type.IsMalformed() && !type.IsMalbounded());
570 ASSERT(!type.IsObjectType() && !type.IsDynamicType()); 565 ASSERT(!type.IsObjectType() && !type.IsDynamicType() && !type.IsVoidType());
571 566
572 // Preserve instantiator type arguments (A1) and function type arguments (A2). 567 // Preserve instantiator type arguments (A1) and function type arguments (A2).
573 __ addiu(SP, SP, Immediate(-2 * kWordSize)); 568 __ addiu(SP, SP, Immediate(-2 * kWordSize));
574 __ sw(A1, Address(SP, 1 * kWordSize)); 569 __ sw(A1, Address(SP, 1 * kWordSize));
575 __ sw(A2, Address(SP, 0 * kWordSize)); 570 __ sw(A2, Address(SP, 0 * kWordSize));
576 571
577 Label is_instance, is_not_instance; 572 Label is_instance, is_not_instance;
578 // If type is instantiated and non-parameterized, we can inline code 573 // If type is instantiated and non-parameterized, we can inline code
579 // checking whether the tested instance is a Smi. 574 // checking whether the tested instance is a Smi.
580 if (type.IsInstantiated()) { 575 if (type.IsInstantiated()) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 intptr_t deopt_id, 641 intptr_t deopt_id,
647 const AbstractType& dst_type, 642 const AbstractType& dst_type,
648 const String& dst_name, 643 const String& dst_name,
649 LocationSummary* locs) { 644 LocationSummary* locs) {
650 __ Comment("AssertAssignable"); 645 __ Comment("AssertAssignable");
651 ASSERT(!token_pos.IsClassifying()); 646 ASSERT(!token_pos.IsClassifying());
652 ASSERT(!dst_type.IsNull()); 647 ASSERT(!dst_type.IsNull());
653 ASSERT(dst_type.IsFinalized()); 648 ASSERT(dst_type.IsFinalized());
654 // Assignable check is skipped in FlowGraphBuilder, not here. 649 // Assignable check is skipped in FlowGraphBuilder, not here.
655 ASSERT(dst_type.IsMalformedOrMalbounded() || 650 ASSERT(dst_type.IsMalformedOrMalbounded() ||
656 (!dst_type.IsDynamicType() && !dst_type.IsObjectType())); 651 (!dst_type.IsDynamicType() && !dst_type.IsObjectType() &&
652 !dst_type.IsVoidType()));
657 653
658 // Preserve instantiator type arguments (A1) and function type arguments (A2). 654 // Preserve instantiator type arguments (A1) and function type arguments (A2).
659 __ addiu(SP, SP, Immediate(-2 * kWordSize)); 655 __ addiu(SP, SP, Immediate(-2 * kWordSize));
660 __ sw(A1, Address(SP, 1 * kWordSize)); 656 __ sw(A1, Address(SP, 1 * kWordSize));
661 __ sw(A2, Address(SP, 0 * kWordSize)); 657 __ sw(A2, Address(SP, 0 * kWordSize));
662 658
663 // A null object is always assignable and is returned as result. 659 // A null object is always assignable and is returned as result.
664 Label is_assignable, runtime_call; 660 Label is_assignable, runtime_call;
665 661
666 __ BranchEqual(A0, Object::null_object(), &is_assignable); 662 __ BranchEqual(A0, Object::null_object(), &is_assignable);
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1815 __ AddImmediate(SP, kDoubleSize); 1811 __ AddImmediate(SP, kDoubleSize);
1816 } 1812 }
1817 1813
1818 1814
1819 #undef __ 1815 #undef __
1820 1816
1821 1817
1822 } // namespace dart 1818 } // namespace dart
1823 1819
1824 #endif // defined TARGET_ARCH_MIPS 1820 #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