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

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

Issue 509343002: Better typing and type verification (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Drop typedness from graph 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
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 DCHECK(0 <= i && i <= struct_length(structure)); 198 DCHECK(0 <= i && i <= struct_length(structure));
192 structure[2 + i] = x.location(); 199 structure[2 + i] = x.location();
193 } 200 }
194 201
195 202
196 // ----------------------------------------------------------------------------- 203 // -----------------------------------------------------------------------------
197 // HeapTypeConfig 204 // HeapTypeConfig
198 205
199 // static 206 // static
200 template<class T> 207 template<class T>
208 i::Handle<T> HeapTypeConfig::null_handle() {
209 return i::Handle<T>();
210 }
211
212
213 // static
214 template<class T>
201 i::Handle<T> HeapTypeConfig::handle(T* type) { 215 i::Handle<T> HeapTypeConfig::handle(T* type) {
202 return i::handle(type, i::HeapObject::cast(type)->GetIsolate()); 216 return i::handle(type, i::HeapObject::cast(type)->GetIsolate());
203 } 217 }
204 218
205 219
206 // static 220 // static
207 template<class T> 221 template<class T>
208 i::Handle<T> HeapTypeConfig::cast(i::Handle<Type> type) { 222 i::Handle<T> HeapTypeConfig::cast(i::Handle<Type> type) {
209 return i::Handle<T>::cast(type); 223 return i::Handle<T>::cast(type);
210 } 224 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 // static 341 // static
328 template<class V> 342 template<class V>
329 void HeapTypeConfig::struct_set_value( 343 void HeapTypeConfig::struct_set_value(
330 i::Handle<Struct> structure, int i, i::Handle<V> x) { 344 i::Handle<Struct> structure, int i, i::Handle<V> x) {
331 structure->set(i + 1, *x); 345 structure->set(i + 1, *x);
332 } 346 }
333 347
334 } } // namespace v8::internal 348 } } // namespace v8::internal
335 349
336 #endif // V8_TYPES_INL_H_ 350 #endif // V8_TYPES_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698