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

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

Issue 8678031: Optimize type checks of list and map literals. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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/dart_api_impl.cc ('k') | runtime/vm/parser.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #ifndef VM_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "vm/assert.h" 8 #include "vm/assert.h"
9 #include "vm/dart.h" 9 #include "vm/dart.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 2121 matching lines...) Expand 10 before | Expand all | Expand 10 after
2132 2132
2133 void SetField(const Field& field, const Object& value) const { 2133 void SetField(const Field& field, const Object& value) const {
2134 *FieldAddr(field) = value.raw(); 2134 *FieldAddr(field) = value.raw();
2135 } 2135 }
2136 2136
2137 RawType* GetType() const; 2137 RawType* GetType() const;
2138 2138
2139 virtual RawTypeArguments* GetTypeArguments() const; 2139 virtual RawTypeArguments* GetTypeArguments() const;
2140 virtual void SetTypeArguments(const TypeArguments& value) const; 2140 virtual void SetTypeArguments(const TypeArguments& value) const;
2141 2141
2142 // Short version of IsInstanceOf with an instantiated type.
2143 bool Is(const Type& type) const {
2144 ASSERT(type.IsInstantiated());
2145 const TypeArguments& no_instantiator = TypeArguments::Handle();
2146 return TestType(kIsSubtypeOf, type, no_instantiator);
2147 }
2148
2149 // Check if this instance is an instance of the given type. 2142 // Check if this instance is an instance of the given type.
2150 bool IsInstanceOf(const Type& type, 2143 bool IsInstanceOf(const Type& type,
2151 const TypeArguments& type_instantiator) const { 2144 const TypeArguments& type_instantiator) const {
2152 return TestType(kIsSubtypeOf, type, type_instantiator); 2145 return TestType(kIsSubtypeOf, type, type_instantiator);
2153 } 2146 }
2154 2147
2155 // Check if this instance is assignable to the given type. 2148 // Check if this instance is assignable to the given type.
2156 bool IsAssignableTo(const Type& type, 2149 bool IsAssignableTo(const Type& type,
2157 const TypeArguments& type_instantiator) const { 2150 const TypeArguments& type_instantiator) const {
2158 return TestType(kIsAssignableTo, type, type_instantiator); 2151 return TestType(kIsAssignableTo, type, type_instantiator);
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
3236 } 3229 }
3237 3230
3238 3231
3239 void Context::SetAt(intptr_t index, const Instance& value) const { 3232 void Context::SetAt(intptr_t index, const Instance& value) const {
3240 StorePointer(InstanceAddr(index), value.raw()); 3233 StorePointer(InstanceAddr(index), value.raw());
3241 } 3234 }
3242 3235
3243 } // namespace dart 3236 } // namespace dart
3244 3237
3245 #endif // VM_OBJECT_H_ 3238 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698