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

Side by Side Diff: src/string-stream.cc

Issue 10254: Rudimentary analysis (Closed)
Patch Set: Created 12 years, 1 month 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
OLDNEW
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 for (int i = 0; i < value.length(); i++) 133 for (int i = 0; i < value.length(); i++)
134 Put(static_cast<char>(value[i])); 134 Put(static_cast<char>(value[i]));
135 break; 135 break;
136 } 136 }
137 case 'o': { 137 case 'o': {
138 ASSERT_EQ(FmtElm::OBJ, current.type_); 138 ASSERT_EQ(FmtElm::OBJ, current.type_);
139 Object* obj = current.data_.u_obj_; 139 Object* obj = current.data_.u_obj_;
140 PrintObject(obj); 140 PrintObject(obj);
141 break; 141 break;
142 } 142 }
143 case 'i': case 'd': case 'u': case 'x': case 'c': case 'p': { 143 case 'k': {
144 ASSERT_EQ(FmtElm::INT, current.type_);
145 int value = current.data_.u_int_;
146 if (0x20 <= value && value <= 0xFF) {
147 Put(value);
148 } else {
149 Add("\\x%X", value);
150 }
151 break;
152 }
153 case 'i': case 'd': case 'u': case 'x': case 'c': case 'p': case 'X': {
144 int value = current.data_.u_int_; 154 int value = current.data_.u_int_;
145 EmbeddedVector<char, 24> formatted; 155 EmbeddedVector<char, 24> formatted;
146 int length = OS::SNPrintF(formatted, temp.start(), value); 156 int length = OS::SNPrintF(formatted, temp.start(), value);
147 Add(Vector<const char>(formatted.start(), length)); 157 Add(Vector<const char>(formatted.start(), length));
148 break; 158 break;
149 } 159 }
150 default: 160 default:
151 UNREACHABLE(); 161 UNREACHABLE();
152 break; 162 break;
153 } 163 }
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 unsigned new_bytes = *bytes * 2; 551 unsigned new_bytes = *bytes * 2;
542 if (new_bytes > size_) { 552 if (new_bytes > size_) {
543 new_bytes = size_; 553 new_bytes = size_;
544 } 554 }
545 *bytes = new_bytes; 555 *bytes = new_bytes;
546 return space_; 556 return space_;
547 } 557 }
548 558
549 559
550 } } // namespace v8::internal 560 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698