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

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

Issue 10874071: Eliminate interface bool (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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/class_finalizer.cc ('k') | runtime/vm/dart_api_message.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) 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/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/assembler_macros.h" 7 #include "vm/assembler_macros.h"
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/code_patcher.h" 9 #include "vm/code_patcher.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 653
654 // Report that the type of the given object is not bool in conditional context. 654 // Report that the type of the given object is not bool in conditional context.
655 // Arg0: bad object. 655 // Arg0: bad object.
656 // Return value: none, throws a TypeError. 656 // Return value: none, throws a TypeError.
657 DEFINE_RUNTIME_ENTRY(ConditionTypeError, 1) { 657 DEFINE_RUNTIME_ENTRY(ConditionTypeError, 1) {
658 ASSERT(arguments.Count() == 658 ASSERT(arguments.Count() ==
659 kConditionTypeErrorRuntimeEntry.argument_count()); 659 kConditionTypeErrorRuntimeEntry.argument_count());
660 const intptr_t location = GetCallerLocation(); 660 const intptr_t location = GetCallerLocation();
661 const Instance& src_instance = Instance::CheckedHandle(arguments.At(0)); 661 const Instance& src_instance = Instance::CheckedHandle(arguments.At(0));
662 ASSERT(src_instance.IsNull() || !src_instance.IsBool()); 662 ASSERT(src_instance.IsNull() || !src_instance.IsBool());
663 const Type& bool_interface = Type::Handle(Type::BoolInterface()); 663 const Type& bool_interface = Type::Handle(Type::BoolType());
664 const AbstractType& src_type = AbstractType::Handle(src_instance.GetType()); 664 const AbstractType& src_type = AbstractType::Handle(src_instance.GetType());
665 const String& src_type_name = String::Handle(src_type.UserVisibleName()); 665 const String& src_type_name = String::Handle(src_type.UserVisibleName());
666 const String& bool_type_name = 666 const String& bool_type_name =
667 String::Handle(bool_interface.UserVisibleName()); 667 String::Handle(bool_interface.UserVisibleName());
668 const String& expr = String::Handle(Symbols::New("boolean expression")); 668 const String& expr = String::Handle(Symbols::New("boolean expression"));
669 const String& no_malformed_type_error = String::Handle(); 669 const String& no_malformed_type_error = String::Handle();
670 Exceptions::CreateAndThrowTypeError(location, src_type_name, bool_type_name, 670 Exceptions::CreateAndThrowTypeError(location, src_type_name, bool_type_name,
671 expr, no_malformed_type_error); 671 expr, no_malformed_type_error);
672 UNREACHABLE(); 672 UNREACHABLE();
673 } 673 }
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
1607 function.set_usage_counter(0); 1607 function.set_usage_counter(0);
1608 function.set_deoptimization_counter(function.deoptimization_counter() + 1); 1608 function.set_deoptimization_counter(function.deoptimization_counter() + 1);
1609 1609
1610 if (function.HasOptimizedCode()) { 1610 if (function.HasOptimizedCode()) {
1611 function.SwitchToUnoptimizedCode(); 1611 function.SwitchToUnoptimizedCode();
1612 } 1612 }
1613 } 1613 }
1614 END_LEAF_RUNTIME_ENTRY 1614 END_LEAF_RUNTIME_ENTRY
1615 1615
1616 } // namespace dart 1616 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/dart_api_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698