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

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

Issue 258243003: Remove old-style accessor support from runtime. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comment Created 6 years, 8 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/serialize.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 cf0b70ca18105c2aa53cfc86504453ee47fcbd99..2aaa8dc7182853a6872cff0eba61ce91ac704069 100644
--- a/test/cctest/test-alloc.cc
+++ b/test/cctest/test-alloc.cc
@@ -27,6 +27,7 @@
#include "v8.h"
#include "accessors.h"
+#include "api.h"
#include "cctest.h"
@@ -104,16 +105,29 @@ TEST(StressHandles) {
}
-static Object* TestAccessorGet(Isolate* isolate, Object* object, void*) {
- return *Test();
+void TestGetter(
+ v8::Local<v8::String> name,
+ const v8::PropertyCallbackInfo<v8::Value>& info) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
+ HandleScope scope(isolate);
+ info.GetReturnValue().Set(v8::Utils::ToLocal(Test()));
}
-const AccessorDescriptor kDescriptor = {
- TestAccessorGet,
- 0,
- 0
-};
+void TestSetter(
+ v8::Local<v8::String> name,
+ v8::Local<v8::Value> value,
+ const v8::PropertyCallbackInfo<void>& info) {
+ UNREACHABLE();
+}
+
+
+Handle<AccessorInfo> TestAccessorInfo(
+ Isolate* isolate, PropertyAttributes attributes) {
+ Handle<String> name = isolate->factory()->NewStringFromStaticAscii("get");
+ return Accessors::MakeAccessor(isolate, name, &TestGetter, &TestSetter,
+ attributes);
+}
TEST(StressJS) {
@@ -132,15 +146,14 @@ TEST(StressJS) {
// Patch the map to have an accessor for "get".
Handle<Map> map(function->initial_map());
Handle<DescriptorArray> instance_descriptors(map->instance_descriptors());
- Handle<Foreign> foreign = factory->NewForeign(&kDescriptor);
- Handle<String> name = factory->NewStringFromStaticAscii("get");
ASSERT(instance_descriptors->IsEmpty());
+ PropertyAttributes attrs = static_cast<PropertyAttributes>(0);
+ Handle<AccessorInfo> foreign = TestAccessorInfo(isolate, attrs);
Map::EnsureDescriptorSlack(map, 1);
- CallbacksDescriptor d(name,
- foreign,
- static_cast<PropertyAttributes>(0));
+ CallbacksDescriptor d(Handle<Name>(Name::cast(foreign->name())),
+ foreign, attrs);
map->AppendDescriptor(&d);
// Add the Foo constructor the global object.
« no previous file with comments | « src/serialize.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698