| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 if (value->IsString()) return HType::String(); | 49 if (value->IsString()) return HType::String(); |
| 50 if (value->IsBoolean()) return HType::Boolean(); | 50 if (value->IsBoolean()) return HType::Boolean(); |
| 51 if (value->IsUndefined()) return HType::Undefined(); | 51 if (value->IsUndefined()) return HType::Undefined(); |
| 52 if (value->IsJSArray()) return HType::JSArray(); | 52 if (value->IsJSArray()) return HType::JSArray(); |
| 53 if (value->IsJSObject()) return HType::JSObject(); | 53 if (value->IsJSObject()) return HType::JSObject(); |
| 54 DCHECK(value->IsHeapObject()); | 54 DCHECK(value->IsHeapObject()); |
| 55 return HType::HeapObject(); | 55 return HType::HeapObject(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 | 58 |
| 59 OStream& operator<<(OStream& os, const HType& t) { | 59 std::ostream& operator<<(std::ostream& os, const HType& t) { |
| 60 // Note: The c1visualizer syntax for locals allows only a sequence of the | 60 // Note: The c1visualizer syntax for locals allows only a sequence of the |
| 61 // following characters: A-Za-z0-9_-|: | 61 // following characters: A-Za-z0-9_-|: |
| 62 switch (t.kind_) { | 62 switch (t.kind_) { |
| 63 #define DEFINE_CASE(Name, mask) \ | 63 #define DEFINE_CASE(Name, mask) \ |
| 64 case HType::k##Name: \ | 64 case HType::k##Name: \ |
| 65 return os << #Name; | 65 return os << #Name; |
| 66 HTYPE_LIST(DEFINE_CASE) | 66 HTYPE_LIST(DEFINE_CASE) |
| 67 #undef DEFINE_CASE | 67 #undef DEFINE_CASE |
| 68 } | 68 } |
| 69 UNREACHABLE(); | 69 UNREACHABLE(); |
| 70 return os; | 70 return os; |
| 71 } | 71 } |
| 72 | 72 |
| 73 } } // namespace v8::internal | 73 } } // namespace v8::internal |
| OLD | NEW |