aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/property.h
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-12-05 16:29:01 -0800
committerRyan Dahl <ry@tinyclouds.org>2011-12-05 16:29:01 -0800
commit21d081fd7f83aa168ea0bef0870c7f1fed410a63 (patch)
tree23a04eef49364b1cbee204a87fd0904be2430c2e /deps/v8/src/property.h
parente90623edc2befb06602ff8c3e01809ba0a21d593 (diff)
downloadandroid-node-v8-21d081fd7f83aa168ea0bef0870c7f1fed410a63.tar.gz
android-node-v8-21d081fd7f83aa168ea0bef0870c7f1fed410a63.tar.bz2
android-node-v8-21d081fd7f83aa168ea0bef0870c7f1fed410a63.zip
Upgrade V8 to 3.7.12
Diffstat (limited to 'deps/v8/src/property.h')
-rw-r--r--deps/v8/src/property.h49
1 files changed, 34 insertions, 15 deletions
diff --git a/deps/v8/src/property.h b/deps/v8/src/property.h
index e7d9fc5345..3203dd1120 100644
--- a/deps/v8/src/property.h
+++ b/deps/v8/src/property.h
@@ -115,11 +115,9 @@ class MapTransitionDescriptor: public Descriptor {
class ElementsTransitionDescriptor: public Descriptor {
public:
ElementsTransitionDescriptor(String* key,
- Map* map,
- ElementsKind elements_kind)
- : Descriptor(key, map, PropertyDetails(NONE,
- ELEMENTS_TRANSITION,
- elements_kind)) { }
+ Object* map_or_array)
+ : Descriptor(key, map_or_array, PropertyDetails(NONE,
+ ELEMENTS_TRANSITION)) { }
};
// Marks a field name in a map so that adding the field is guaranteed
@@ -166,10 +164,20 @@ class CallbacksDescriptor: public Descriptor {
class LookupResult BASE_EMBEDDED {
public:
- LookupResult()
- : lookup_type_(NOT_FOUND),
+ explicit LookupResult(Isolate* isolate)
+ : isolate_(isolate),
+ next_(isolate->top_lookup_result()),
+ lookup_type_(NOT_FOUND),
+ holder_(NULL),
cacheable_(true),
- details_(NONE, NORMAL) {}
+ details_(NONE, NORMAL) {
+ isolate->SetTopLookupResult(this);
+ }
+
+ ~LookupResult() {
+ ASSERT(isolate_->top_lookup_result() == this);
+ isolate_->SetTopLookupResult(next_);
+ }
void DescriptorResult(JSObject* holder, PropertyDetails details, int number) {
lookup_type_ = DESCRIPTOR_TYPE;
@@ -202,9 +210,9 @@ class LookupResult BASE_EMBEDDED {
number_ = entry;
}
- void HandlerResult() {
+ void HandlerResult(JSProxy* proxy) {
lookup_type_ = HANDLER_TYPE;
- holder_ = NULL;
+ holder_ = proxy;
details_ = PropertyDetails(NONE, HANDLER);
cacheable_ = false;
}
@@ -217,11 +225,17 @@ class LookupResult BASE_EMBEDDED {
void NotFound() {
lookup_type_ = NOT_FOUND;
+ holder_ = NULL;
}
JSObject* holder() {
ASSERT(IsFound());
- return holder_;
+ return JSObject::cast(holder_);
+ }
+
+ JSProxy* proxy() {
+ ASSERT(IsFound());
+ return JSProxy::cast(holder_);
}
PropertyType type() {
@@ -248,7 +262,7 @@ class LookupResult BASE_EMBEDDED {
// Is the result is a property excluding transitions and the null
// descriptor?
bool IsProperty() {
- return IsFound() && (type() < FIRST_PHANTOM_PROPERTY_TYPE);
+ return IsFound() && GetPropertyDetails().IsProperty();
}
// Is the result a property or a transition?
@@ -278,10 +292,10 @@ class LookupResult BASE_EMBEDDED {
}
}
+
Map* GetTransitionMap() {
ASSERT(lookup_type_ == DESCRIPTOR_TYPE);
- ASSERT(type() == MAP_TRANSITION || type() == CONSTANT_TRANSITION ||
- type() == ELEMENTS_TRANSITION);
+ ASSERT(IsTransitionType(type()));
return Map::cast(GetValue());
}
@@ -343,7 +357,12 @@ class LookupResult BASE_EMBEDDED {
return holder()->GetNormalizedProperty(this);
}
+ void Iterate(ObjectVisitor* visitor);
+
private:
+ Isolate* isolate_;
+ LookupResult* next_;
+
// Where did we find the result;
enum {
NOT_FOUND,
@@ -354,7 +373,7 @@ class LookupResult BASE_EMBEDDED {
CONSTANT_TYPE
} lookup_type_;
- JSObject* holder_;
+ JSReceiver* holder_;
int number_;
bool cacheable_;
PropertyDetails details_;