Reviewers: Jakob,
Message:
PTAL
Description:
Get rid of the NONEXISTENT PropertyType
BUG=
Please review this at https://codereview.chromium.org/492433005/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+11, -36 lines):
M src/bootstrapper.cc
M src/heap-snapshot-generator.cc
M src/ic.cc
M src/lookup.h
M src/lookup.cc
M src/mirror-debugger.js
M src/objects.cc
M src/objects-printer.cc
M src/property.h
M src/property.cc
M src/property-details.h
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index
15e6fb09b0d7114c1bb56fcc274d559d03662ca9..e4e12d5819e86806bbe7e719311529818a6139de
100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2462,7 +2462,6 @@ void
Genesis::TransferNamedProperties(Handle<JSObject> from,
// Do not occur since the from object has fast properties.
case HANDLER:
case INTERCEPTOR:
- case NONEXISTENT:
// No element in instance descriptors have proxy or interceptor
type.
UNREACHABLE();
break;
Index: src/heap-snapshot-generator.cc
diff --git a/src/heap-snapshot-generator.cc b/src/heap-snapshot-generator.cc
index
4646f4b240e38cabf40a1b7345505c90f6dd253d..aaac48ae1fae0b3913c8a5dff799ca3b33c7db2f
100644
--- a/src/heap-snapshot-generator.cc
+++ b/src/heap-snapshot-generator.cc
@@ -1700,9 +1700,6 @@ void
V8HeapExplorer::ExtractPropertyReferences(JSObject* js_obj, int entry) {
case HANDLER: // only in lookup results, not in descriptors
case INTERCEPTOR: // only in lookup results, not in descriptors
break;
- case NONEXISTENT:
- UNREACHABLE();
- break;
}
}
} else {
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index
c5002fa5322c10b19a8a5642456c54a68087003c..fd2b48f1072474a78de51b3d45c7ea4a69282815
100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -1597,7 +1597,6 @@ Handle<Code>
StoreIC::CompileStoreHandler(LookupResult* lookup,
}
case CONSTANT:
break;
- case NONEXISTENT:
case HANDLER:
UNREACHABLE();
break;
Index: src/lookup.cc
diff --git a/src/lookup.cc b/src/lookup.cc
index
3943bf3b98f12d91c813ee82e9a7825908efba30..719d4fa8fe628617d007c9835f1cc5cef5b47a04
100644
--- a/src/lookup.cc
+++ b/src/lookup.cc
@@ -100,7 +100,6 @@ bool LookupIterator::HasProperty() {
property_kind_ = ACCESSOR;
break;
case v8::internal::HANDLER:
- case v8::internal::NONEXISTENT:
case v8::internal::INTERCEPTOR:
UNREACHABLE();
}
Index: src/lookup.h
diff --git a/src/lookup.h b/src/lookup.h
index
5fbc10b0daba58ff0602836f7d4be9fa23be197f..84bdc7b4996a3f3b50ac60b22634846b6774c3b1
100644
--- a/src/lookup.h
+++ b/src/lookup.h
@@ -69,7 +69,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
state_(NOT_FOUND),
property_kind_(DATA),
property_encoding_(DESCRIPTOR),
- property_details_(NONE, NONEXISTENT, Representation::None()),
+ property_details_(NONE, NORMAL, Representation::None()),
isolate_(name->GetIsolate()),
name_(name),
maybe_receiver_(receiver),
@@ -87,7 +87,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
state_(NOT_FOUND),
property_kind_(DATA),
property_encoding_(DESCRIPTOR),
- property_details_(NONE, NONEXISTENT, Representation::None()),
+ property_details_(NONE, NORMAL, Representation::None()),
isolate_(name->GetIsolate()),
name_(name),
holder_map_(holder->map()),
Index: src/mirror-debugger.js
diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js
index
6da847fd54970f050341838cc23b15dfc9ed02eb..b3058602878ffe111aa633687a37e8932a3a8c44
100644
--- a/src/mirror-debugger.js
+++ b/src/mirror-debugger.js
@@ -179,7 +179,6 @@ PropertyType.Constant = 2;
PropertyType.Callbacks = 3;
PropertyType.Handler = 4;
PropertyType.Interceptor = 5;
-PropertyType.Nonexistent = 6;
// Different attributes for a property.
Index: src/objects-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index
8fbe2182c51ea5b26bef050d3dca8d622ab10ae2..3d29164938183a78d612d55187c7e94596576d58
100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -242,8 +242,6 @@ void JSObject::PrintProperties(OStream& os) { // NOLINT
case NORMAL: // only in slow mode
case HANDLER: // only in lookup results, not in descriptors
case INTERCEPTOR: // only in lookup results, not in descriptors
- // There are no transitions in the descriptor array.
- case NONEXISTENT:
UNREACHABLE();
break;
}
@@ -377,7 +375,6 @@ void JSObject::PrintTransitions(OStream& os) { //
NOLINT
case NORMAL:
case HANDLER:
case INTERCEPTOR:
- case NONEXISTENT:
UNREACHABLE();
break;
}
@@ -1107,7 +1104,6 @@ void TransitionArray::PrintTransitions(OStream& os)
{ // NOLINT
case NORMAL:
case HANDLER:
case INTERCEPTOR:
- case NONEXISTENT:
UNREACHABLE();
break;
}
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index
e4961632051cd0a7a70b10272a4dd429a3500126..f77384a90a57acab6909897f5a009d5a63afcec9
100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -2781,7 +2781,6 @@ MaybeHandle<Map> Map::TryUpdateInternal(Handle<Map>
old_map) {
case NORMAL:
case HANDLER:
case INTERCEPTOR:
- case NONEXISTENT:
UNREACHABLE();
}
}
@@ -4271,7 +4270,6 @@ void JSObject::MigrateFastToSlow(Handle<JSObject>
object,
break;
case HANDLER:
case NORMAL:
- case NONEXISTENT:
UNREACHABLE();
break;
}
@@ -6830,7 +6828,6 @@ bool DescriptorArray::CanHoldValue(int descriptor,
Object* value) {
case NORMAL:
case INTERCEPTOR:
case HANDLER:
- case NONEXISTENT:
break;
}
Index: src/property-details.h
diff --git a/src/property-details.h b/src/property-details.h
index
7eb2e4ea9da8f660183f185bc759e01248813fa4..960c46c4f79a91580defd124b9c71d8def94da36
100644
--- a/src/property-details.h
+++ b/src/property-details.h
@@ -46,16 +46,14 @@ class TypeInfo;
// A copy of this is in mirror-debugger.js.
enum PropertyType {
// Only in slow mode.
- NORMAL = 0,
+ NORMAL = 0,
// Only in fast mode.
- FIELD = 1,
- CONSTANT = 2,
- CALLBACKS = 3,
+ FIELD = 1,
+ CONSTANT = 2,
+ CALLBACKS = 3,
// Only in lookup results, not in descriptors.
- HANDLER = 4,
- INTERCEPTOR = 5,
- // Only used as a marker in LookupResult.
- NONEXISTENT = 6
+ HANDLER = 4,
+ INTERCEPTOR = 5
};
Index: src/property.cc
diff --git a/src/property.cc b/src/property.cc
index
968839687ac4e75c81a0cf234841464b8b726c90..0cad6ed02c56df1f32eaf077045ade0c67f66185
100644
--- a/src/property.cc
+++ b/src/property.cc
@@ -47,9 +47,6 @@ OStream& operator<<(OStream& os, const LookupResult& r) {
return os << " -type = lookup proxy\n";
case INTERCEPTOR:
return os << " -type = lookup interceptor\n";
- case NONEXISTENT:
- UNREACHABLE();
- break;
}
return os;
}
Index: src/property.h
diff --git a/src/property.h b/src/property.h
index
a1e8011b53aa138fb022440e457d030c44c98e9a..ab2dcef8081eb8441f118abd8d276c3b0ea282a4
100644
--- a/src/property.h
+++ b/src/property.h
@@ -120,7 +120,7 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
holder_(NULL),
transition_(NULL),
cacheable_(true),
- details_(NONE, NONEXISTENT, Representation::None()) {
+ details_(NONE, NORMAL, Representation::None()) {
isolate->set_top_lookup_result(this);
}
@@ -158,8 +158,6 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
case HANDLER:
case INTERCEPTOR:
return true;
- case NONEXISTENT:
- UNREACHABLE();
}
UNREACHABLE();
return true;
@@ -198,7 +196,7 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
void NotFound() {
lookup_type_ = NOT_FOUND;
- details_ = PropertyDetails(NONE, NONEXISTENT, Representation::None());
+ details_ = PropertyDetails(NONE, NORMAL, Representation::None());
holder_ = NULL;
transition_ = NULL;
}
@@ -220,13 +218,11 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
Representation representation() const {
DCHECK(IsFound());
- DCHECK(details_.type() != NONEXISTENT);
return details_.representation();
}
PropertyAttributes GetAttributes() const {
DCHECK(IsFound());
- DCHECK(details_.type() != NONEXISTENT);
return details_.attributes();
}
@@ -247,7 +243,6 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
bool IsReadOnly() const {
DCHECK(IsFound());
- DCHECK(details_.type() != NONEXISTENT);
return details_.IsReadOnly();
}
@@ -257,8 +252,7 @@ class LookupResult V8_FINAL BASE_EMBEDDED {
}
bool IsNormal() const {
- DCHECK(!(details_.type() == NORMAL && !IsFound()));
- return IsDescriptorOrDictionary() && type() == NORMAL;
+ return IsFound() && IsDescriptorOrDictionary() && type() == NORMAL;
}
bool IsConstant() const {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.