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

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

Issue 1222863003: Make frequent type checks (instanceof) faster by adding dedicated instanceof methods; improves dart… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: flag Created 5 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
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/symbols.h » ('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 "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 14880 matching lines...) Expand 10 before | Expand all | Expand 10 after
14891 (type_class() == Type::Handle(Type::Int32x4()).type_class()); 14891 (type_class() == Type::Handle(Type::Int32x4()).type_class());
14892 } 14892 }
14893 14893
14894 14894
14895 bool AbstractType::IsNumberType() const { 14895 bool AbstractType::IsNumberType() const {
14896 return HasResolvedTypeClass() && 14896 return HasResolvedTypeClass() &&
14897 (type_class() == Type::Handle(Type::Number()).type_class()); 14897 (type_class() == Type::Handle(Type::Number()).type_class());
14898 } 14898 }
14899 14899
14900 14900
14901 bool AbstractType::IsSmiType() const {
14902 return HasResolvedTypeClass() &&
14903 (type_class() == Type::Handle(Type::SmiType()).type_class());
14904 }
14905
14906
14901 bool AbstractType::IsStringType() const { 14907 bool AbstractType::IsStringType() const {
14902 return HasResolvedTypeClass() && 14908 return HasResolvedTypeClass() &&
14903 (type_class() == Type::Handle(Type::StringType()).type_class()); 14909 (type_class() == Type::Handle(Type::StringType()).type_class());
14904 } 14910 }
14905 14911
14906 14912
14907 bool AbstractType::IsFunctionType() const { 14913 bool AbstractType::IsFunctionType() const {
14908 return HasResolvedTypeClass() && 14914 return HasResolvedTypeClass() &&
14909 (type_class() == Type::Handle(Type::Function()).type_class()); 14915 (type_class() == Type::Handle(Type::Function()).type_class());
14910 } 14916 }
(...skipping 6263 matching lines...) Expand 10 before | Expand all | Expand 10 after
21174 return tag_label.ToCString(); 21180 return tag_label.ToCString();
21175 } 21181 }
21176 21182
21177 21183
21178 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 21184 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
21179 Instance::PrintJSONImpl(stream, ref); 21185 Instance::PrintJSONImpl(stream, ref);
21180 } 21186 }
21181 21187
21182 21188
21183 } // namespace dart 21189 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698