From e4c3c439afdd320fead2aca21e1fd2554bb4afe9 Mon Sep 17 00:00:00 2001 From: "verwaest@chromium.org" Date: Thu, 21 Aug 2014 08:16:06 +0000 Subject: [PATCH] Get rid of the NONEXISTENT PropertyType BUG= Review URL: https://codereview.chromium.org/492433005 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23260 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/bootstrapper.cc | 1 - src/heap-snapshot-generator.cc | 3 --- src/ic.cc | 1 - src/lookup.cc | 1 - src/lookup.h | 4 ++-- src/mirror-debugger.js | 1 - src/objects-printer.cc | 4 ---- src/objects.cc | 3 --- src/property-details.h | 14 ++++++-------- src/property.cc | 3 --- src/property.h | 9 ++------- 11 files changed, 10 insertions(+), 34 deletions(-) diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index dbbe0ea..f3282b2 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -2464,7 +2464,6 @@ void Genesis::TransferNamedProperties(Handle 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; diff --git a/src/heap-snapshot-generator.cc b/src/heap-snapshot-generator.cc index 4646f4b..aaac48a 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 { diff --git a/src/ic.cc b/src/ic.cc index fdad0ca..ceed585 100644 --- a/src/ic.cc +++ b/src/ic.cc @@ -1597,7 +1597,6 @@ Handle StoreIC::CompileStoreHandler(LookupResult* lookup, } case CONSTANT: break; - case NONEXISTENT: case HANDLER: UNREACHABLE(); break; diff --git a/src/lookup.cc b/src/lookup.cc index 3943bf3..719d4fa 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(); } diff --git a/src/lookup.h b/src/lookup.h index 08dc54c..5e2b492 100644 --- a/src/lookup.h +++ b/src/lookup.h @@ -70,7 +70,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), @@ -88,7 +88,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()), diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js index 6da847f..b305860 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. diff --git a/src/objects-printer.cc b/src/objects-printer.cc index 8fbe218..3d29164 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; } diff --git a/src/objects.cc b/src/objects.cc index a784b1d..70e218b 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -2774,7 +2774,6 @@ MaybeHandle Map::TryUpdateInternal(Handle old_map) { case NORMAL: case HANDLER: case INTERCEPTOR: - case NONEXISTENT: UNREACHABLE(); } } @@ -4264,7 +4263,6 @@ void JSObject::MigrateFastToSlow(Handle object, break; case HANDLER: case NORMAL: - case NONEXISTENT: UNREACHABLE(); break; } @@ -6823,7 +6821,6 @@ bool DescriptorArray::CanHoldValue(int descriptor, Object* value) { case NORMAL: case INTERCEPTOR: case HANDLER: - case NONEXISTENT: break; } diff --git a/src/property-details.h b/src/property-details.h index 7eb2e4e..960c46c 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 }; diff --git a/src/property.cc b/src/property.cc index 9688396..0cad6ed 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; } diff --git a/src/property.h b/src/property.h index a1e8011..125f927 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(); } -- 2.7.4