OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 } | 86 } |
87 FmtElm(Object* value) : type_(OBJ) { // NOLINT | 87 FmtElm(Object* value) : type_(OBJ) { // NOLINT |
88 data_.u_obj_ = value; | 88 data_.u_obj_ = value; |
89 } | 89 } |
90 FmtElm(Handle<Object> value) : type_(HANDLE) { // NOLINT | 90 FmtElm(Handle<Object> value) : type_(HANDLE) { // NOLINT |
91 data_.u_handle_ = value.location(); | 91 data_.u_handle_ = value.location(); |
92 } | 92 } |
93 FmtElm(void* value) : type_(POINTER) { // NOLINT | 93 FmtElm(void* value) : type_(POINTER) { // NOLINT |
94 data_.u_pointer_ = value; | 94 data_.u_pointer_ = value; |
95 } | 95 } |
| 96 |
96 private: | 97 private: |
97 friend class StringStream; | 98 friend class StringStream; |
98 enum Type { INT, DOUBLE, C_STR, LC_STR, OBJ, HANDLE, POINTER }; | 99 enum Type { INT, DOUBLE, C_STR, LC_STR, OBJ, HANDLE, POINTER }; |
99 Type type_; | 100 Type type_; |
100 union { | 101 union { |
101 int u_int_; | 102 int u_int_; |
102 double u_double_; | 103 double u_double_; |
103 const char* u_c_str_; | 104 const char* u_c_str_; |
104 const Vector<const uc16>* u_lc_str_; | 105 const Vector<const uc16>* u_lc_str_; |
105 Object* u_obj_; | 106 Object* u_obj_; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 bool full() const { return (capacity_ - length_) == 1; } | 183 bool full() const { return (capacity_ - length_) == 1; } |
183 int space() const { return capacity_ - length_; } | 184 int space() const { return capacity_ - length_; } |
184 | 185 |
185 DISALLOW_IMPLICIT_CONSTRUCTORS(StringStream); | 186 DISALLOW_IMPLICIT_CONSTRUCTORS(StringStream); |
186 }; | 187 }; |
187 | 188 |
188 | 189 |
189 } } // namespace v8::internal | 190 } } // namespace v8::internal |
190 | 191 |
191 #endif // V8_STRING_STREAM_H_ | 192 #endif // V8_STRING_STREAM_H_ |
OLD | NEW |