Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(546)

Unified Diff: test/cctest/test-alloc.cc

Issue 10782033: Removed CopyAppendForeignDescriptor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed test Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-alloc.cc
diff --git a/test/cctest/test-alloc.cc b/test/cctest/test-alloc.cc
index a8e504fd443a6c77dddfbde352c372f11206a569..e51ab26598315a7c29bf5796a656c991d1fc93c8 100644
--- a/test/cctest/test-alloc.cc
+++ b/test/cctest/test-alloc.cc
@@ -151,12 +151,22 @@ TEST(StressJS) {
Handle<Map> map(function->initial_map());
Handle<DescriptorArray> instance_descriptors(map->instance_descriptors());
Handle<Foreign> foreign = FACTORY->NewForeign(&kDescriptor);
- instance_descriptors = FACTORY->CopyAppendForeignDescriptor(
- instance_descriptors,
- FACTORY->NewStringFromAscii(Vector<const char>("get", 3)),
- foreign,
- static_cast<PropertyAttributes>(0));
- map->set_instance_descriptors(*instance_descriptors);
+ Handle<String> name =
+ FACTORY->NewStringFromAscii(Vector<const char>("get", 3));
+ ASSERT(instance_descriptors->IsEmpty());
+
+ Handle<DescriptorArray> new_descriptors = FACTORY->NewDescriptorArray(1);
+
+ v8::internal::DescriptorArray::WhitenessWitness witness(*new_descriptors);
+
+ CallbacksDescriptor d(*name,
+ *foreign,
+ static_cast<PropertyAttributes>(0),
+ v8::internal::PropertyDetails::kInitialIndex);
+ new_descriptors->Set(0, &d, witness);
+ new_descriptors->SetLastAdded(0);
+
+ map->set_instance_descriptors(*new_descriptors);
// Add the Foo constructor the global object.
env->Global()->Set(v8::String::New("Foo"), v8::Utils::ToLocal(function));
// Call the accessor through JavaScript.
« no previous file with comments | « src/factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698