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

Side by Side Diff: src/types-inl.h

Issue 658543002: Better typing and type verification (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 6 years, 2 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 | « src/types.cc ('k') | test/cctest/compiler/test-changes-lowering.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_TYPES_INL_H_ 5 #ifndef V8_TYPES_INL_H_
6 #define V8_TYPES_INL_H_ 6 #define V8_TYPES_INL_H_
7 7
8 #include "src/types.h" 8 #include "src/types.h"
9 9
10 #include "src/factory.h" 10 #include "src/factory.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 return this->Contains(value); 50 return this->Contains(value);
51 } 51 }
52 52
53 53
54 // ----------------------------------------------------------------------------- 54 // -----------------------------------------------------------------------------
55 // ZoneTypeConfig 55 // ZoneTypeConfig
56 56
57 // static 57 // static
58 template<class T> 58 template<class T>
59 T* ZoneTypeConfig::null_handle() {
60 return NULL;
61 }
62
63
64 // static
65 template<class T>
59 T* ZoneTypeConfig::handle(T* type) { 66 T* ZoneTypeConfig::handle(T* type) {
60 return type; 67 return type;
61 } 68 }
62 69
63 70
64 // static 71 // static
65 template<class T> 72 template<class T>
66 T* ZoneTypeConfig::cast(Type* type) { 73 T* ZoneTypeConfig::cast(Type* type) {
67 return static_cast<T*>(type); 74 return static_cast<T*>(type);
68 } 75 }
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 DCHECK(0 <= i && i <= struct_length(structure)); 199 DCHECK(0 <= i && i <= struct_length(structure));
193 structure[2 + i] = x.location(); 200 structure[2 + i] = x.location();
194 } 201 }
195 202
196 203
197 // ----------------------------------------------------------------------------- 204 // -----------------------------------------------------------------------------
198 // HeapTypeConfig 205 // HeapTypeConfig
199 206
200 // static 207 // static
201 template<class T> 208 template<class T>
209 i::Handle<T> HeapTypeConfig::null_handle() {
210 return i::Handle<T>();
211 }
212
213
214 // static
215 template<class T>
202 i::Handle<T> HeapTypeConfig::handle(T* type) { 216 i::Handle<T> HeapTypeConfig::handle(T* type) {
203 return i::handle(type, i::HeapObject::cast(type)->GetIsolate()); 217 return i::handle(type, i::HeapObject::cast(type)->GetIsolate());
204 } 218 }
205 219
206 220
207 // static 221 // static
208 template<class T> 222 template<class T>
209 i::Handle<T> HeapTypeConfig::cast(i::Handle<Type> type) { 223 i::Handle<T> HeapTypeConfig::cast(i::Handle<Type> type) {
210 return i::Handle<T>::cast(type); 224 return i::Handle<T>::cast(type);
211 } 225 }
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 // static 344 // static
331 template<class V> 345 template<class V>
332 void HeapTypeConfig::struct_set_value( 346 void HeapTypeConfig::struct_set_value(
333 i::Handle<Struct> structure, int i, i::Handle<V> x) { 347 i::Handle<Struct> structure, int i, i::Handle<V> x) {
334 structure->set(i + 1, *x); 348 structure->set(i + 1, *x);
335 } 349 }
336 350
337 } } // namespace v8::internal 351 } } // namespace v8::internal
338 352
339 #endif // V8_TYPES_INL_H_ 353 #endif // V8_TYPES_INL_H_
OLDNEW
« no previous file with comments | « src/types.cc ('k') | test/cctest/compiler/test-changes-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698