Home | History | Annotate | Download | only in heap

Lines Matching defs:function

175   // TODO(lrn): We need a NumberFromIntptr function in order to test this.
455 // Allocate a function and keep it in global object's property.
456 Handle<JSFunction> function = factory->NewFunction(name);
457 JSReceiver::SetProperty(global, name, function, SLOPPY).Check();
459 Handle<JSObject> obj = factory->NewJSObject(function);
471 // Function should be alive.
473 // Check function is retained.
477 Handle<JSFunction> function = Handle<JSFunction>::cast(func_value);
482 Handle<JSObject> obj = factory->NewJSObject(function);
797 "function",
871 Handle<JSFunction> function = factory->NewFunction(name);
877 Handle<JSObject> obj = factory->NewJSObject(function);
881 // Check that we can add properties to function objects.
882 JSReceiver::SetProperty(function, prop_name, twenty_four, SLOPPY).Check();
884 *Object::GetProperty(function, prop_name).ToHandleChecked());
965 Handle<JSFunction> function = factory->NewFunction(name);
968 Handle<JSObject> obj = factory->NewJSObject(function);
969 Handle<Map> initial_map(function->initial_map());
991 Handle<JSFunction> function = Handle<JSFunction>::cast(fun_obj);
995 Handle<JSObject> object = factory->NewJSObject(function);
1204 "function foo() {"
1218 // Check function is compiled.
1222 Handle<JSFunction> function = Handle<JSFunction>::cast(func_value);
1223 CHECK(function->shared()->is_compiled());
1228 CHECK(function->shared()->is_compiled());
1237 CHECK(!function->shared()->is_compiled() || function->IsOptimized());
1238 CHECK(!function->is_compiled() || function->IsOptimized());
1241 CHECK(function->shared()->is_compiled());
1242 CHECK(function->is_compiled());
1258 const char* source = "function foo() {"
1271 // Check function is compiled.
1275 Handle<JSFunction> function = Handle<JSFunction>::cast(func_value);
1276 CHECK(function->shared()->is_compiled());
1280 CHECK(function->shared()->is_compiled());
1285 CHECK(!function->shared()->is_compiled() || function->IsOptimized());
1287 // Execute the function again twice, and ensure it is reset to the young age.
1296 CHECK(function->shared()->is_compiled());
1305 CHECK(!function->shared()->is_compiled() || function->IsOptimized());
1306 CHECK(!function->is_compiled() || function->IsOptimized());
1309 CHECK(function->shared()->is_compiled());
1310 CHECK(function->is_compiled());
1323 const char* source = "function foo() {"
1336 // Check function is compiled.
1340 Handle<JSFunction> function = Handle<JSFunction>::cast(func_value);
1341 CHECK(function->shared()->is_compiled());
1346 CHECK(function->shared()->is_compiled());
1354 CHECK(!function->shared()->is_compiled() || function->IsOptimized());
1355 CHECK(!function->is_compiled() || function->IsOptimized());
1357 // This compile will compile the function again.
1363 // the loop breaks once the function is enqueued as a candidate.
1366 if (!function->next_function_link()->IsUndefined()) break;
1371 // the function is enqueued as a candidate.
1378 CHECK(function->shared()->is_compiled() || !function->IsOptimized());
1379 CHECK(function->is_compiled() || !function->IsOptimized());
1392 const char* source = "var foo = function() {"
1398 "var bar = function() {"
1417 Handle<JSFunction> function = Handle<JSFunction>::cast(func_value);
1418 CHECK(function->shared()->is_compiled());
1430 // Bump the code age so that flushing is triggered while the function
1434 function->shared()->code()->MakeOlder(static_cast<MarkingParity>(i % 2));
1447 CHECK(!function->shared()->is_compiled() || function->IsOptimized());
1448 CHECK(!function->is_compiled() || function->IsOptimized());
1462 const char* source = "function foo() {"
1475 // Check function is compiled.
1479 Handle<JSFunction> function = Handle<JSFunction>::cast(func_value);
1480 CHECK(function->shared()->is_compiled());
1485 CHECK(function->shared()->is_compiled());
1490 function->shared()->code()->MakeOlder(static_cast<MarkingParity>(i % 2));
1493 // Simulate incremental marking so that the function is enqueued as
1503 isolate->debug()->SetBreakPoint(function, breakpoint_object, &position);
1514 CHECK(function->shared()->is_compiled() || !function->IsOptimized());
1515 CHECK(function->is_compiled() || !function->IsOptimized());
1535 "function foo() {"
1563 // the source to the shared function info containing the code.
1636 "function %s() { return 0; }"
1705 // Create a handle scope so no function objects get stuck in the outer
1720 // Remove function f1, and
2401 "function f() { return o.x; }"
2442 CompileRun("var v = function() { return 42; }");
2450 "function f(x) { return x(); }"
2497 "function f() { return o[0]; }"
2544 "function f() {"
2584 "function foo () { }"
2585 "function mkbar () { return new (new Function(\"\")) (); }"
2586 "function f (x) { return (x instanceof foo); }"
2587 "function g () { f(mkbar()); }"
2598 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
2615 v8::Local<v8::Function> g = v8::Local<v8::Function>::Cast(
2640 "function f () {"
2650 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
2682 "function f () {"
2692 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
2798 "function c(x) {"
2804 "function f(x) { return new c(x); };"
2840 "function f() {"
2891 "function f() {"
2932 "function f() {"
2989 "function f() {"
3029 "function f() {"
3069 "function f() {"
3119 "function f() {"
3170 "function f() {"
3212 "function f() {"
3250 CompileRun("function F() {}");
3321 CompileRun("function F() { }");
3351 CompileRun("function F() {}");
3378 CompileRun("function F() {}");
3405 CompileRun("function F() {}");
3445 CompileRun("function f(o) {"
3485 CompileRun("function f(o) {"
3591 const char* source = "f = function() { return 987654321; }\n"
3592 "g = function() { return 123456789; }\n";
3595 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
3612 CompileRun("function fun() {};");
3617 CompileRun("function fun() {};");
3621 // Prepare function f that contains type feedback for the two closures.
3624 CompileRun("function f(a, b) { a(); b(); } f(fun1, fun2);");
3627 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
3695 // Prepare function f that contains a monomorphic IC for object
3698 "function fun() { this.x = 1; };"
3699 "function f(o) { return new o(); } f(fun); f(fun);");
3701 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
3724 CompileRun("function fun() { this.x = 1; };");
3728 // Prepare function f that contains a monomorphic constructor for object
3732 "function fun() { this.x = 1; };"
3733 "function f(o) { return new o(); } f(fun1); f(fun1);");
3735 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
3757 // Prepare function f that contains a monomorphic IC for object
3759 CompileRun("function fun() { this.x = 1; }; var obj = new fun();"
3760 "function f(o) { return o.x; } f(obj); f(obj);");
3762 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
3783 CompileRun("function fun() { this.x = 1; }; var obj = new fun();");
3787 // Prepare function f that contains a monomorphic IC for object
3790 CompileRun("function f(o) { return o.x; } f(obj1); f(obj1);");
3792 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
3815 CompileRun("function fun() { this.x = 1; }; var obj = new fun();");
3821 CompileRun("function fun() { this.x = 2; }; var obj = new fun();");
3825 // Prepare function f that contains a polymorphic IC for objects
3829 CompileRun("function f(o) { return o.x; } f(obj1); f(obj1); f(obj2);");
3831 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
3853 CompileRun("function fun() { this.x = 1; }; var obj = new fun();");
3859 CompileRun("function fun() { this.x = 2; }; var obj = new fun();");
3863 // Prepare function f that contains a polymorphic IC for objects
3867 CompileRun("function f(o) { return o.x; } f(obj1); f(obj1); f(obj2);");
3869 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
3961 " (function f() { f(); })(); "
3974 /* as prototype */ " (function f() { f(); })(); "
4015 CompileRun("function h(x) {}"
4016 "function mkClosure() {"
4017 " return function(x) { return x + 1; };"
4028 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
4034 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
4046 // code flushing candidates. Then optimize one function. Finally
4073 CompileRun("function mkClosure() {"
4074 " return function(x) { return x + 1; };"
4081 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
4115 // Prepare a shared function info eligible for code flushing for which
4121 CompileRun("function f() { return 'foobar'; }"
4122 "function g(x) { if (x) f(); }"
4128 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
4139 // Prepare a shared function info eligible for code flushing that will
4145 CompileRun("function flushMe() { return 0; }"
4149 *v8::Local<v8::Function>::Cast(CcTest::global()
4165 // Optimize function and make sure the unoptimized code is replaced.
4192 CompileRun("function fastliteralcase(literal, value) {"
4196 "function get_standard_literal() {"
4267 // Prepare function whose optimized code map we can use.
4271 CompileRun("function f() { return 1 }"
4275 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
4285 CompileRun("function g() { return 2 }"
4289 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
4324 // Prepare function whose optimized code map we can use.
4328 CompileRun("function f() { return 1 }"
4332 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
4342 CompileRun("function g() { return 2 }"
4346 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
4421 const char* source = "function foo(x) { var l = [1]; return x+l[0]; }";
4438 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
4525 // Prepare an optimized closure with containing an inlined function. Then age
4533 "function g(x) { return x + 1 }"
4534 "function mkClosure() {"
4535 " return function(x) { return g(x); };"
4542 *v8::Local<v8::Function>::Cast(CcTest::global()
4552 *v8::Local<v8::Function>::Cast(CcTest::global()
4649 CompileRun("function f(n) {"
4669 CompileRun("function test() {"
4675 "function run() {"
4722 CompileRun("var bar = function() { return (new Array()); };"
4743 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
4750 // Now make sure that a gc should get rid of the function, even though we
4779 "bar = (function() {"
4780 " function bar() {"
4783 " var foo = function(x) { with (x) { return 1 + x; } };"
4793 *v8::Local<v8::Function>::Cast(CcTest::global()
4799 // Now make sure that a gc should get rid of the function
4824 "function bar() {"
4827 "function foo(x) { with (x) { return 1 + x; } };"
4836 *v8::Local<v8::Function>::Cast(CcTest::global()
4842 // Now make sure that a gc should get rid of the function
4879 "function bar%d() {"
4882 "function foo%d(x) { with (x) { return 1 + x; } };"
4906 "function %s() { return 0; }"
4912 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
5022 "function createObj(obj) {"
5026 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
5035 " (function() {"
5036 " function hat() { this.x = 5; }"
5053 // cleared. Now, verify that one additional call with a new function
5067 "function coat() { this.x = 6; }"
5100 CheckWeakness("function loadIC(obj) {"
5103 " (function() {"
5116 "function loadIC(obj) {"
5119 " (function() {"
5134 CheckWeakness("function keyedLoadIC(obj, field) {"
5137 " (function() {"
5150 "function keyedLoadIC(obj, field) {"
5153 " (function() {"
5168 CheckWeakness("function storeIC(obj, value) {"
5171 " (function() {"
5184 "function storeIC(obj, value) {"
5187 " (function() {"
5202 CheckWeakness("function keyedStoreIC(obj, field, value) {"
5205 " (function() {"
5218 "function keyedStoreIC(obj, field, value) {"
5221 " (function() {"
5236 CheckWeakness("function compareNilIC(obj) {"
5239 " (function() {"
5289 "function loadIC(obj) {"
5292 "function testIC() {"
5322 "function loadIC(obj) {"
5325 "function testIC() {"
5432 "function add(a, b) {"
5439 "function crash(x) {"
5452 v8::Local<v8::Function> g = v8::Local<v8::Function>::Cast(
5542 "eval('function f() {' + locals + 'return function() { return v0; }; }');"
5794 CompileRun("function cls() { this.x = 10; }");
5826 CompileRun("(function () { return {x : 10}; })();");
6051 v8::Local<v8::Function> constructor = v8::Utils::CallableToLocal(
6273 "function f() { return function g() {}; }"
6280 "function f() { return (function() { return function g() {}; })(); }"