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

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

Issue 23984002: load ics for js api accessors (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/stub-cache-x64.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-accessors.cc
diff --git a/test/cctest/test-accessors.cc b/test/cctest/test-accessors.cc
index b68b0b0011bfafa3d521dfa99ed1406524d1c897..09b0644b36758ee7a1a3d42eb619e13d47f8296b 100644
--- a/test/cctest/test-accessors.cc
+++ b/test/cctest/test-accessors.cc
@@ -163,6 +163,7 @@ static void XGetter(Local<String> name,
static void XGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
+ CHECK_EQ(x_receiver, info.Holder());
XGetter(info, 1);
}
@@ -172,6 +173,7 @@ static void XSetter(Local<Value> value, const Info& info, int offset) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
CHECK_EQ(isolate, info.GetIsolate());
CHECK_EQ(x_holder, info.This());
+ CHECK_EQ(x_holder, info.Holder());
x_register[offset] = value->Int32Value();
}
@@ -179,7 +181,6 @@ static void XSetter(Local<Value> value, const Info& info, int offset) {
static void XSetter(Local<String> name,
Local<Value> value,
const v8::PropertyCallbackInfo<void>& info) {
- CHECK_EQ(x_holder, info.Holder());
XSetter(value, info, 0);
}
@@ -205,17 +206,23 @@ THREADED_TEST(AccessorIC) {
v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(CompileRun(
"obj.__proto__ = holder;"
"var result = [];"
+ "var key_0 = 'x0';"
+ "var key_1 = 'x1';"
"for (var i = 0; i < 10; i++) {"
" holder.x0 = i;"
- " holder.x1 = i;"
" result.push(obj.x0);"
+ " holder.x1 = i;"
" result.push(obj.x1);"
+ " holder[key_0] = i;"
+ " result.push(obj[key_0]);"
+ " holder[key_1] = i;"
+ " result.push(obj[key_1]);"
"}"
"result"));
- CHECK_EQ(20, array->Length());
- for (int i = 0; i < 20; i++) {
+ CHECK_EQ(40, array->Length());
+ for (int i = 0; i < 40; i++) {
v8::Handle<Value> entry = array->Get(v8::Integer::New(i));
- CHECK_EQ(v8::Integer::New(i/2), entry);
+ CHECK_EQ(v8::Integer::New(i/4), entry);
}
}
« no previous file with comments | « src/x64/stub-cache-x64.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698