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

Side by Side Diff: test/cctest/test-api.cc

Issue 540903002: Flatten property_kind into state. Add UNKNOWN as a state for dict-mode receivers (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add DCHECKs Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2027 matching lines...) Expand 10 before | Expand all | Expand 10 after
2038 i::Handle<i::JSObject> a(v8::Utils::OpenHandle(v8::Object::Cast(*res))); 2038 i::Handle<i::JSObject> a(v8::Utils::OpenHandle(v8::Object::Cast(*res)));
2039 CHECK(a->map()->instance_descriptors()->IsFixedArray()); 2039 CHECK(a->map()->instance_descriptors()->IsFixedArray());
2040 CHECK_GT(i::FixedArray::cast(a->map()->instance_descriptors())->length(), 0); 2040 CHECK_GT(i::FixedArray::cast(a->map()->instance_descriptors())->length(), 0);
2041 CompileRun("Object.defineProperty(a, 'length', { writable: false });"); 2041 CompileRun("Object.defineProperty(a, 'length', { writable: false });");
2042 CHECK_EQ(i::FixedArray::cast(a->map()->instance_descriptors())->length(), 0); 2042 CHECK_EQ(i::FixedArray::cast(a->map()->instance_descriptors())->length(), 0);
2043 // But we should still have an ExecutableAccessorInfo. 2043 // But we should still have an ExecutableAccessorInfo.
2044 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); 2044 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
2045 i::LookupResult lookup(i_isolate); 2045 i::LookupResult lookup(i_isolate);
2046 i::Handle<i::String> name(v8::Utils::OpenHandle(*v8_str("length"))); 2046 i::Handle<i::String> name(v8::Utils::OpenHandle(*v8_str("length")));
2047 i::LookupIterator it(a, name, i::LookupIterator::OWN_SKIP_INTERCEPTOR); 2047 i::LookupIterator it(a, name, i::LookupIterator::OWN_SKIP_INTERCEPTOR);
2048 CHECK_NE(i::LookupIterator::ACCESS_CHECK, it.state()); 2048 CHECK_EQ(i::LookupIterator::ACCESSOR, it.state());
2049 CHECK(it.HasProperty());
2050 CHECK(it.GetAccessors()->IsExecutableAccessorInfo()); 2049 CHECK(it.GetAccessors()->IsExecutableAccessorInfo());
2051 } 2050 }
2052 2051
2053 2052
2054 THREADED_TEST(EmptyInterceptorBreakTransitions) { 2053 THREADED_TEST(EmptyInterceptorBreakTransitions) {
2055 v8::HandleScope scope(CcTest::isolate()); 2054 v8::HandleScope scope(CcTest::isolate());
2056 Handle<FunctionTemplate> templ = FunctionTemplate::New(CcTest::isolate()); 2055 Handle<FunctionTemplate> templ = FunctionTemplate::New(CcTest::isolate());
2057 AddInterceptor(templ, EmptyInterceptorGetter, EmptyInterceptorSetter); 2056 AddInterceptor(templ, EmptyInterceptorGetter, EmptyInterceptorSetter);
2058 LocalContext env; 2057 LocalContext env;
2059 env->Global()->Set(v8_str("Constructor"), templ->GetFunction()); 2058 env->Global()->Set(v8_str("Constructor"), templ->GetFunction());
(...skipping 20934 matching lines...) Expand 10 before | Expand all | Expand 10 after
22994 desc = x->GetOwnPropertyDescriptor(v8_str("p1")); 22993 desc = x->GetOwnPropertyDescriptor(v8_str("p1"));
22995 Local<Function> set = 22994 Local<Function> set =
22996 Local<Function>::Cast(Local<Object>::Cast(desc)->Get(v8_str("set"))); 22995 Local<Function>::Cast(Local<Object>::Cast(desc)->Get(v8_str("set")));
22997 Local<Function> get = 22996 Local<Function> get =
22998 Local<Function>::Cast(Local<Object>::Cast(desc)->Get(v8_str("get"))); 22997 Local<Function>::Cast(Local<Object>::Cast(desc)->Get(v8_str("get")));
22999 CHECK_EQ(v8_num(13), get->Call(x, 0, NULL)); 22998 CHECK_EQ(v8_num(13), get->Call(x, 0, NULL));
23000 Handle<Value> args[] = { v8_num(14) }; 22999 Handle<Value> args[] = { v8_num(14) };
23001 set->Call(x, 1, args); 23000 set->Call(x, 1, args);
23002 CHECK_EQ(v8_num(14), get->Call(x, 0, NULL)); 23001 CHECK_EQ(v8_num(14), get->Call(x, 0, NULL));
23003 } 23002 }
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698