diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2009-12-18 15:05:04 +0100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2009-12-18 15:05:04 +0100 |
commit | 20b945df706b2b9fcbc1a84230372d288d497544 (patch) | |
tree | 0c60abd605dfb4452ba1e866b2bd075f1bd929ef /deps/v8/src/objects.cc | |
parent | 164ce76e941490e82230e905e719b5b556b669f5 (diff) | |
download | node-new-20b945df706b2b9fcbc1a84230372d288d497544.tar.gz |
Upgrade V8 to 2.0.5
Diffstat (limited to 'deps/v8/src/objects.cc')
-rw-r--r-- | deps/v8/src/objects.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/deps/v8/src/objects.cc b/deps/v8/src/objects.cc index 0f8dca398d..52f1f9af61 100644 --- a/deps/v8/src/objects.cc +++ b/deps/v8/src/objects.cc @@ -1351,6 +1351,8 @@ Object* JSObject::AddFastProperty(String* name, Object* JSObject::AddConstantFunctionProperty(String* name, JSFunction* function, PropertyAttributes attributes) { + ASSERT(!Heap::InNewSpace(function)); + // Allocate new instance descriptors with (name, function) added ConstantFunctionDescriptor d(name, function, attributes); Object* new_descriptors = @@ -1437,7 +1439,7 @@ Object* JSObject::AddProperty(String* name, // Ensure the descriptor array does not get too big. if (map()->instance_descriptors()->number_of_descriptors() < DescriptorArray::kMaxNumberOfDescriptors) { - if (value->IsJSFunction()) { + if (value->IsJSFunction() && !Heap::InNewSpace(value)) { return AddConstantFunctionProperty(name, JSFunction::cast(value), attributes); @@ -3254,7 +3256,8 @@ Object* DescriptorArray::Allocate(int number_of_descriptors) { return Heap::empty_descriptor_array(); } // Allocate the array of keys. - Object* array = Heap::AllocateFixedArray(ToKeyIndex(number_of_descriptors)); + Object* array = + Heap::AllocateFixedArray(ToKeyIndex(number_of_descriptors)); if (array->IsFailure()) return array; // Do not use DescriptorArray::cast on incomplete object. FixedArray* result = FixedArray::cast(array); @@ -7962,7 +7965,10 @@ Object* StringDictionary::TransformPropertiesToFastFor( PropertyType type = DetailsAt(i).type(); ASSERT(type != FIELD); instance_descriptor_length++; - if (type == NORMAL && !value->IsJSFunction()) number_of_fields += 1; + if (type == NORMAL && + (!value->IsJSFunction() || Heap::InNewSpace(value))) { + number_of_fields += 1; + } } } @@ -7993,7 +7999,7 @@ Object* StringDictionary::TransformPropertiesToFastFor( PropertyDetails details = DetailsAt(i); PropertyType type = details.type(); - if (value->IsJSFunction()) { + if (value->IsJSFunction() && !Heap::InNewSpace(value)) { ConstantFunctionDescriptor d(String::cast(key), JSFunction::cast(value), details.attributes(), |