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

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

Issue 10191020: Revert change 6946. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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/object.h ('k') | runtime/vm/stub_code_ia32.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/object.h" 5 #include "vm/object.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/bootstrap.h" 10 #include "vm/bootstrap.h"
(...skipping 2721 matching lines...) Expand 10 before | Expand all | Expand 10 after
2732 const AbstractType& uninstantiated_type, 2732 const AbstractType& uninstantiated_type,
2733 const AbstractTypeArguments& instantiator_type_arguments) { 2733 const AbstractTypeArguments& instantiator_type_arguments) {
2734 const InstantiatedType& result = 2734 const InstantiatedType& result =
2735 InstantiatedType::Handle(InstantiatedType::New()); 2735 InstantiatedType::Handle(InstantiatedType::New());
2736 result.set_uninstantiated_type(uninstantiated_type); 2736 result.set_uninstantiated_type(uninstantiated_type);
2737 result.set_instantiator_type_arguments(instantiator_type_arguments); 2737 result.set_instantiator_type_arguments(instantiator_type_arguments);
2738 return result.raw(); 2738 return result.raw();
2739 } 2739 }
2740 2740
2741 2741
2742 bool InstantiatedType::Equals(const AbstractType& other) const {
2743 if (raw() == other.raw()) {
2744 return true;
2745 }
2746 if (!other.IsInstantiatedType()) {
2747 return false;
2748 }
2749 InstantiatedType& other_instantiated = InstantiatedType::Handle();
2750 other_instantiated ^= other.raw();
2751 if (IsFinalized() != other_instantiated.IsFinalized()) {
2752 return false;
2753 }
2754 const AbstractType& this_type = AbstractType::Handle(uninstantiated_type());
2755 const AbstractType& other_type =
2756 AbstractType::Handle(other_instantiated.uninstantiated_type());
2757 if (!this_type.Equals(other_type)) {
2758 return false;
2759 }
2760 if (instantiator_type_arguments() !=
2761 other_instantiated.instantiator_type_arguments()) {
2762 return false;
2763 }
2764 return true;
2765 }
2766
2767
2768 const char* InstantiatedType::ToCString() const { 2742 const char* InstantiatedType::ToCString() const {
2769 return "InstantiatedType"; 2743 return "InstantiatedType";
2770 } 2744 }
2771 2745
2772 2746
2773 intptr_t AbstractTypeArguments::Length() const { 2747 intptr_t AbstractTypeArguments::Length() const {
2774 // AbstractTypeArguments is an abstract class. 2748 // AbstractTypeArguments is an abstract class.
2775 UNREACHABLE(); 2749 UNREACHABLE();
2776 return -1; 2750 return -1;
2777 } 2751 }
(...skipping 6481 matching lines...) Expand 10 before | Expand all | Expand 10 after
9259 const String& str = String::Handle(pattern()); 9233 const String& str = String::Handle(pattern());
9260 const char* format = "JSRegExp: pattern=%s flags=%s"; 9234 const char* format = "JSRegExp: pattern=%s flags=%s";
9261 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); 9235 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags());
9262 char* chars = reinterpret_cast<char*>( 9236 char* chars = reinterpret_cast<char*>(
9263 Isolate::Current()->current_zone()->Allocate(len + 1)); 9237 Isolate::Current()->current_zone()->Allocate(len + 1));
9264 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); 9238 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags());
9265 return chars; 9239 return chars;
9266 } 9240 }
9267 9241
9268 } // namespace dart 9242 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698