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

Side by Side Diff: src/types.cc

Issue 166203002: Handle the uninitialized oddball in Type::LubBitset(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 uint32_t u; 157 uint32_t u;
158 if (value->ToInt32(&i)) return Smi::IsValid(i) ? kSmi : kOtherSigned32; 158 if (value->ToInt32(&i)) return Smi::IsValid(i) ? kSmi : kOtherSigned32;
159 if (value->ToUint32(&u)) return kUnsigned32; 159 if (value->ToUint32(&u)) return kUnsigned32;
160 return kDouble; 160 return kDouble;
161 } 161 }
162 if (map->instance_type() == ODDBALL_TYPE) { 162 if (map->instance_type() == ODDBALL_TYPE) {
163 if (value->IsUndefined()) return kUndefined; 163 if (value->IsUndefined()) return kUndefined;
164 if (value->IsNull()) return kNull; 164 if (value->IsNull()) return kNull;
165 if (value->IsBoolean()) return kBoolean; 165 if (value->IsBoolean()) return kBoolean;
166 if (value->IsTheHole()) return kAny; // TODO(rossberg): kNone? 166 if (value->IsTheHole()) return kAny; // TODO(rossberg): kNone?
167 if (value->IsUninitialized()) return kNone;
167 UNREACHABLE(); 168 UNREACHABLE();
168 } 169 }
169 return LubBitset(map); 170 return LubBitset(map);
170 } 171 }
171 172
172 173
173 template<class Config> 174 template<class Config>
174 int TypeImpl<Config>::LubBitset(i::Map* map) { 175 int TypeImpl<Config>::LubBitset(i::Map* map) {
175 switch (map->instance_type()) { 176 switch (map->instance_type()) {
176 case STRING_TYPE: 177 case STRING_TYPE:
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 647
647 template TypeImpl<ZoneTypeConfig>::TypeHandle 648 template TypeImpl<ZoneTypeConfig>::TypeHandle
648 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( 649 TypeImpl<ZoneTypeConfig>::Convert<HeapType>(
649 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); 650 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*);
650 template TypeImpl<HeapTypeConfig>::TypeHandle 651 template TypeImpl<HeapTypeConfig>::TypeHandle
651 TypeImpl<HeapTypeConfig>::Convert<Type>( 652 TypeImpl<HeapTypeConfig>::Convert<Type>(
652 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); 653 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*);
653 654
654 655
655 } } // namespace v8::internal 656 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698