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

Side by Side Diff: src/objects.cc

Issue 2541533002: Move Smi::kZero definition to the header (Closed)
Patch Set: Change "constexpr static" to "static constexpr" for consistency Created 4 years 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
« no previous file with comments | « src/objects.h ('k') | 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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <memory> 9 #include <memory>
10 #include <sstream> 10 #include <sstream>
(...skipping 2185 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 if (v.value->IsSmi()) { 2196 if (v.value->IsSmi()) {
2197 Smi::cast(v.value)->SmiPrint(os); 2197 Smi::cast(v.value)->SmiPrint(os);
2198 } else { 2198 } else {
2199 // TODO(svenpanne) Const-correct HeapObjectShortPrint! 2199 // TODO(svenpanne) Const-correct HeapObjectShortPrint!
2200 HeapObject* obj = const_cast<HeapObject*>(HeapObject::cast(v.value)); 2200 HeapObject* obj = const_cast<HeapObject*>(HeapObject::cast(v.value));
2201 obj->HeapObjectShortPrint(os); 2201 obj->HeapObjectShortPrint(os);
2202 } 2202 }
2203 return os; 2203 return os;
2204 } 2204 }
2205 2205
2206 // Declaration of the static Smi::kZero constant.
2207 Smi* const Smi::kZero(nullptr);
2208
2209 void Smi::SmiPrint(std::ostream& os) const { // NOLINT 2206 void Smi::SmiPrint(std::ostream& os) const { // NOLINT
2210 os << value(); 2207 os << value();
2211 } 2208 }
2212 2209
2213 2210
2214 // Should a word be prefixed by 'a' or 'an' in order to read naturally in 2211 // Should a word be prefixed by 'a' or 'an' in order to read naturally in
2215 // English? Returns false for non-ASCII or words that don't start with 2212 // English? Returns false for non-ASCII or words that don't start with
2216 // a capital letter. The a/an rule follows pronunciation in English. 2213 // a capital letter. The a/an rule follows pronunciation in English.
2217 // We don't use the BBC's overcorrect "an historic occasion" though if 2214 // We don't use the BBC's overcorrect "an historic occasion" though if
2218 // you speak a dialect you may well say "an 'istoric occasion". 2215 // you speak a dialect you may well say "an 'istoric occasion".
(...skipping 18216 matching lines...) Expand 10 before | Expand all | Expand 10 after
20435 // depend on this. 20432 // depend on this.
20436 return DICTIONARY_ELEMENTS; 20433 return DICTIONARY_ELEMENTS;
20437 } 20434 }
20438 DCHECK_LE(kind, LAST_ELEMENTS_KIND); 20435 DCHECK_LE(kind, LAST_ELEMENTS_KIND);
20439 return kind; 20436 return kind;
20440 } 20437 }
20441 } 20438 }
20442 20439
20443 } // namespace internal 20440 } // namespace internal
20444 } // namespace v8 20441 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698