| OLD | NEW |
| 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/hydrogen-types.h" | 5 #include "src/hydrogen-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 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // static | 41 // static |
| 42 HType HType::FromValue(Handle<Object> value) { | 42 HType HType::FromValue(Handle<Object> value) { |
| 43 if (value->IsSmi()) return HType::Smi(); | 43 if (value->IsSmi()) return HType::Smi(); |
| 44 if (value->IsNull()) return HType::Null(); | 44 if (value->IsNull()) return HType::Null(); |
| 45 if (value->IsHeapNumber()) return HType::HeapNumber(); | 45 if (value->IsHeapNumber()) return HType::HeapNumber(); |
| 46 if (value->IsString()) return HType::String(); | 46 if (value->IsString()) return HType::String(); |
| 47 if (value->IsBoolean()) return HType::Boolean(); | 47 if (value->IsBoolean()) return HType::Boolean(); |
| 48 if (value->IsUndefined()) return HType::Undefined(); | 48 if (value->IsUndefined()) return HType::Undefined(); |
| 49 if (value->IsJSArray()) return HType::JSArray(); | 49 if (value->IsJSArray()) return HType::JSArray(); |
| 50 if (value->IsJSObject()) return HType::JSObject(); | 50 if (value->IsJSObject()) return HType::JSObject(); |
| 51 ASSERT(value->IsHeapObject()); | 51 DCHECK(value->IsHeapObject()); |
| 52 return HType::HeapObject(); | 52 return HType::HeapObject(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 | 55 |
| 56 OStream& operator<<(OStream& os, const HType& t) { | 56 OStream& operator<<(OStream& os, const HType& t) { |
| 57 // Note: The c1visualizer syntax for locals allows only a sequence of the | 57 // Note: The c1visualizer syntax for locals allows only a sequence of the |
| 58 // following characters: A-Za-z0-9_-|: | 58 // following characters: A-Za-z0-9_-|: |
| 59 switch (t.kind_) { | 59 switch (t.kind_) { |
| 60 #define DEFINE_CASE(Name, mask) \ | 60 #define DEFINE_CASE(Name, mask) \ |
| 61 case HType::k##Name: \ | 61 case HType::k##Name: \ |
| 62 return os << #Name; | 62 return os << #Name; |
| 63 HTYPE_LIST(DEFINE_CASE) | 63 HTYPE_LIST(DEFINE_CASE) |
| 64 #undef DEFINE_CASE | 64 #undef DEFINE_CASE |
| 65 } | 65 } |
| 66 UNREACHABLE(); | 66 UNREACHABLE(); |
| 67 return os; | 67 return os; |
| 68 } | 68 } |
| 69 | 69 |
| 70 } } // namespace v8::internal | 70 } } // namespace v8::internal |
| OLD | NEW |