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

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

Issue 233233004: Handlify GetProperty. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-compiler.cc » ('j') | 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 21942 matching lines...) Expand 10 before | Expand all | Expand 10 after
21953 env->Global()->Set(v8_str("func"), func); 21953 env->Global()->Set(v8_str("func"), func);
21954 Local<Value> result = CompileRun("func();"); 21954 Local<Value> result = CompileRun("func();");
21955 CHECK_EQ(v8::Integer::New(isolate, 17), result); 21955 CHECK_EQ(v8::Integer::New(isolate, 17), result);
21956 // Verify function not cached 21956 // Verify function not cached
21957 int serial_number = 21957 int serial_number =
21958 i::Smi::cast(v8::Utils::OpenHandle(*func) 21958 i::Smi::cast(v8::Utils::OpenHandle(*func)
21959 ->shared()->get_api_func_data()->serial_number())->value(); 21959 ->shared()->get_api_func_data()->serial_number())->value();
21960 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); 21960 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
21961 i::Handle<i::JSObject> cache(i_isolate->native_context()->function_cache()); 21961 i::Handle<i::JSObject> cache(i_isolate->native_context()->function_cache());
21962 i::Handle<i::Object> elm = 21962 i::Handle<i::Object> elm =
21963 i::Object::GetElementNoExceptionThrown(i_isolate, cache, serial_number); 21963 i::Object::GetElement(i_isolate, cache, serial_number).ToHandleChecked();
21964 CHECK(elm->IsUndefined()); 21964 CHECK(elm->IsUndefined());
21965 // Verify that each Function::New creates a new function instance 21965 // Verify that each Function::New creates a new function instance
21966 Local<Object> data2 = v8::Object::New(isolate); 21966 Local<Object> data2 = v8::Object::New(isolate);
21967 function_new_expected_env = data2; 21967 function_new_expected_env = data2;
21968 Local<Function> func2 = Function::New(isolate, FunctionNewCallback, data2); 21968 Local<Function> func2 = Function::New(isolate, FunctionNewCallback, data2);
21969 CHECK(!func2->IsNull()); 21969 CHECK(!func2->IsNull());
21970 CHECK_NE(func, func2); 21970 CHECK_NE(func, func2);
21971 env->Global()->Set(v8_str("func2"), func2); 21971 env->Global()->Set(v8_str("func2"), func2);
21972 Local<Value> result2 = CompileRun("func2();"); 21972 Local<Value> result2 = CompileRun("func2();");
21973 CHECK_EQ(v8::Integer::New(isolate, 17), result2); 21973 CHECK_EQ(v8::Integer::New(isolate, 17), result2);
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
22396 "f.call(friend);"); 22396 "f.call(friend);");
22397 CHECK_EQ(2, named_access_count); 22397 CHECK_EQ(2, named_access_count);
22398 22398
22399 // Test access using Object.setPrototypeOf reflective method. 22399 // Test access using Object.setPrototypeOf reflective method.
22400 named_access_count = 0; 22400 named_access_count = 0;
22401 CompileRun("Object.setPrototypeOf(friend, {});"); 22401 CompileRun("Object.setPrototypeOf(friend, {});");
22402 CHECK_EQ(1, named_access_count); 22402 CHECK_EQ(1, named_access_count);
22403 CompileRun("Object.getPrototypeOf(friend);"); 22403 CompileRun("Object.getPrototypeOf(friend);");
22404 CHECK_EQ(2, named_access_count); 22404 CHECK_EQ(2, named_access_count);
22405 } 22405 }
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698