Version 3.4.1.
Fixed JSON stringify issue with arrays.
Changed calls to JS builtins to be passed undefined when called with implicit receiver.
Implemented the set trap for Harmony proxies. Proxies still need to be enabled with the --harmony-proxies flag.
git-svn-id: http://v8.googlecode.com/svn/trunk@8130 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/objects-inl.h b/src/objects-inl.h
index c8fcd02..29a368c 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -446,9 +446,27 @@
}
+bool Object::IsJSReceiver() {
+ return IsHeapObject() &&
+ HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_RECEIVER_TYPE;
+}
+
+
bool Object::IsJSObject() {
- return IsHeapObject()
- && HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_OBJECT_TYPE;
+ return IsJSReceiver() && !IsJSProxy();
+}
+
+
+bool Object::IsJSProxy() {
+ return Object::IsHeapObject() &&
+ (HeapObject::cast(this)->map()->instance_type() == JS_PROXY_TYPE ||
+ HeapObject::cast(this)->map()->instance_type() == JS_FUNCTION_PROXY_TYPE);
+}
+
+
+bool Object::IsJSFunctionProxy() {
+ return Object::IsHeapObject() &&
+ HeapObject::cast(this)->map()->instance_type() == JS_FUNCTION_PROXY_TYPE;
}
@@ -584,12 +602,6 @@
}
-bool Object::IsJSProxy() {
- return Object::IsHeapObject()
- && HeapObject::cast(this)->map()->instance_type() == JS_PROXY_TYPE;
-}
-
-
bool Object::IsForeign() {
return Object::IsHeapObject()
&& HeapObject::cast(this)->map()->instance_type() == FOREIGN_TYPE;
@@ -1900,6 +1912,7 @@
CAST_ACCESSOR(ExternalString)
CAST_ACCESSOR(ExternalAsciiString)
CAST_ACCESSOR(ExternalTwoByteString)
+CAST_ACCESSOR(JSReceiver)
CAST_ACCESSOR(JSObject)
CAST_ACCESSOR(Smi)
CAST_ACCESSOR(HeapObject)
@@ -1917,6 +1930,7 @@
CAST_ACCESSOR(JSArray)
CAST_ACCESSOR(JSRegExp)
CAST_ACCESSOR(JSProxy)
+CAST_ACCESSOR(JSFunctionProxy)
CAST_ACCESSOR(Foreign)
CAST_ACCESSOR(ByteArray)
CAST_ACCESSOR(ExternalArray)
@@ -3309,14 +3323,14 @@
}
-bool SharedFunctionInfo::es5_native() {
- return BooleanBit::get(compiler_hints(), kES5Native);
+bool SharedFunctionInfo::native() {
+ return BooleanBit::get(compiler_hints(), kNative);
}
-void SharedFunctionInfo::set_es5_native(bool value) {
+void SharedFunctionInfo::set_native(bool value) {
set_compiler_hints(BooleanBit::set(compiler_hints(),
- kES5Native,
+ kNative,
value));
}
@@ -4002,12 +4016,12 @@
}
-Object* JSObject::GetPrototype() {
- return JSObject::cast(this)->map()->prototype();
+Object* JSReceiver::GetPrototype() {
+ return HeapObject::cast(this)->map()->prototype();
}
-PropertyAttributes JSObject::GetPropertyAttribute(String* key) {
+PropertyAttributes JSReceiver::GetPropertyAttribute(String* key) {
return GetPropertyAttributeWithReceiver(this, key);
}