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

Unified Diff: src/utils.h

Issue 11088027: Added a simple dead code removal phase. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments Created 8 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/property-details.h ('k') | tools/run-tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils.h
diff --git a/src/utils.h b/src/utils.h
index e659de22018c434a1d50550ee677deb08544dc9a..e03f96f6e5d3a7bb2b1c527810a180333c4a26b8 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -862,7 +862,11 @@ class EmbeddedContainer {
public:
EmbeddedContainer() : elems_() { }
- int length() { return NumElements; }
+ int length() const { return NumElements; }
+ const ElementType& operator[](int i) const {
+ ASSERT(i < length());
+ return elems_[i];
+ }
ElementType& operator[](int i) {
ASSERT(i < length());
return elems_[i];
@@ -876,7 +880,12 @@ class EmbeddedContainer {
template<typename ElementType>
class EmbeddedContainer<ElementType, 0> {
public:
- int length() { return 0; }
+ int length() const { return 0; }
+ const ElementType& operator[](int i) const {
+ UNREACHABLE();
+ static ElementType t = 0;
+ return t;
+ }
ElementType& operator[](int i) {
UNREACHABLE();
static ElementType t = 0;
« no previous file with comments | « src/property-details.h ('k') | tools/run-tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698