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

Side by Side Diff: src/types.cc

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.h ('k') | src/types-inl.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 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 #include "src/types.h" 5 #include "src/types.h"
6 6
7 #include "src/ostreams.h" 7 #include "src/ostreams.h"
8 #include "src/types-inl.h" 8 #include "src/types-inl.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // because it means that the template isn't actually parametric. 240 // because it means that the template isn't actually parametric.
241 // Also, it doesn't apply elsewhere. 8-( 241 // Also, it doesn't apply elsewhere. 8-(
242 // We ought to find a cleaner solution for compiling stubs parameterised 242 // We ought to find a cleaner solution for compiling stubs parameterised
243 // over type or class variables, esp ones with bounds... 243 // over type or class variables, esp ones with bounds...
244 return kDetectable; 244 return kDetectable;
245 case DECLARED_ACCESSOR_INFO_TYPE: 245 case DECLARED_ACCESSOR_INFO_TYPE:
246 case EXECUTABLE_ACCESSOR_INFO_TYPE: 246 case EXECUTABLE_ACCESSOR_INFO_TYPE:
247 case SHARED_FUNCTION_INFO_TYPE: 247 case SHARED_FUNCTION_INFO_TYPE:
248 case ACCESSOR_PAIR_TYPE: 248 case ACCESSOR_PAIR_TYPE:
249 case FIXED_ARRAY_TYPE: 249 case FIXED_ARRAY_TYPE:
250 case BYTE_ARRAY_TYPE:
250 case FOREIGN_TYPE: 251 case FOREIGN_TYPE:
251 case CODE_TYPE: 252 case CODE_TYPE:
252 return kInternal & kTaggedPtr; 253 return kInternal & kTaggedPtr;
253 default: 254 default:
254 UNREACHABLE(); 255 UNREACHABLE();
255 return kNone; 256 return kNone;
256 } 257 }
257 } 258 }
258 259
259 260
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 } 430 }
430 return false; 431 return false;
431 } 432 }
432 433
433 if (that->IsRange()) { 434 if (that->IsRange()) {
434 return (this->IsRange() && Contains(that->AsRange(), this->AsRange())) 435 return (this->IsRange() && Contains(that->AsRange(), this->AsRange()))
435 || (this->IsConstant() && 436 || (this->IsConstant() &&
436 Contains(that->AsRange(), *this->AsConstant()->Value())); 437 Contains(that->AsRange(), *this->AsConstant()->Value()));
437 } 438 }
438 if (this->IsRange()) return false; 439 if (this->IsRange()) return false;
440
439 return this->SimplyEquals(that); 441 return this->SimplyEquals(that);
440 } 442 }
441 443
442 444
443 template<class Config> 445 template<class Config>
444 bool TypeImpl<Config>::NowIs(TypeImpl* that) { 446 bool TypeImpl<Config>::NowIs(TypeImpl* that) {
445 DisallowHeapAllocation no_allocation; 447 DisallowHeapAllocation no_allocation;
446 448
447 // TODO(rossberg): this is incorrect for 449 // TODO(rossberg): this is incorrect for
448 // Union(Constant(V), T)->NowIs(Class(M)) 450 // Union(Constant(V), T)->NowIs(Class(M))
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 template class TypeImpl<HeapTypeConfig>::Iterator<i::Object>; 1086 template class TypeImpl<HeapTypeConfig>::Iterator<i::Object>;
1085 1087
1086 template TypeImpl<ZoneTypeConfig>::TypeHandle 1088 template TypeImpl<ZoneTypeConfig>::TypeHandle
1087 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( 1089 TypeImpl<ZoneTypeConfig>::Convert<HeapType>(
1088 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); 1090 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*);
1089 template TypeImpl<HeapTypeConfig>::TypeHandle 1091 template TypeImpl<HeapTypeConfig>::TypeHandle
1090 TypeImpl<HeapTypeConfig>::Convert<Type>( 1092 TypeImpl<HeapTypeConfig>::Convert<Type>(
1091 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); 1093 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*);
1092 1094
1093 } } // namespace v8::internal 1095 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/types.h ('k') | src/types-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698