OLD | NEW |
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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 "var closure0 = MakeClosure();" | 367 "var closure0 = MakeClosure();" |
368 "%DebugPrint(closure0());" | 368 "%DebugPrint(closure0());" |
369 "%OptimizeFunctionOnNextCall(closure0);" | 369 "%OptimizeFunctionOnNextCall(closure0);" |
370 "%DebugPrint(closure0());" | 370 "%DebugPrint(closure0());" |
371 "var closure1 = MakeClosure();" | 371 "var closure1 = MakeClosure();" |
372 "var closure2 = MakeClosure();"); | 372 "var closure2 = MakeClosure();"); |
373 Handle<JSFunction> fun1 = v8::Utils::OpenHandle( | 373 Handle<JSFunction> fun1 = v8::Utils::OpenHandle( |
374 *v8::Local<v8::Function>::Cast(env->Global()->Get(v8_str("closure1")))); | 374 *v8::Local<v8::Function>::Cast(env->Global()->Get(v8_str("closure1")))); |
375 Handle<JSFunction> fun2 = v8::Utils::OpenHandle( | 375 Handle<JSFunction> fun2 = v8::Utils::OpenHandle( |
376 *v8::Local<v8::Function>::Cast(env->Global()->Get(v8_str("closure2")))); | 376 *v8::Local<v8::Function>::Cast(env->Global()->Get(v8_str("closure2")))); |
377 CHECK(fun1->IsOptimized() || !FLAG_crankshaft); | 377 CHECK(fun1->IsOptimized() || !fun1->IsOptimizable()); |
378 CHECK(fun2->IsOptimized() || !FLAG_crankshaft); | 378 CHECK(fun2->IsOptimized() || !fun2->IsOptimizable()); |
379 CHECK_EQ(fun1->code(), fun2->code()); | 379 CHECK_EQ(fun1->code(), fun2->code()); |
380 } | 380 } |
381 } | 381 } |
382 | 382 |
383 | 383 |
384 #ifdef ENABLE_DISASSEMBLER | 384 #ifdef ENABLE_DISASSEMBLER |
385 static Handle<JSFunction> GetJSFunction(v8::Handle<v8::Object> obj, | 385 static Handle<JSFunction> GetJSFunction(v8::Handle<v8::Object> obj, |
386 const char* property_name) { | 386 const char* property_name) { |
387 v8::Local<v8::Function> fun = | 387 v8::Local<v8::Function> fun = |
388 v8::Local<v8::Function>::Cast(obj->Get(v8_str(property_name))); | 388 v8::Local<v8::Function>::Cast(obj->Get(v8_str(property_name))); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 CompileRun("function f() { a = 12345678 }; f();"); | 425 CompileRun("function f() { a = 12345678 }; f();"); |
426 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); | 426 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); |
427 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); | 427 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); |
428 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); | 428 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); |
429 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); | 429 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); |
430 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); | 430 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); |
431 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); | 431 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); |
432 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); | 432 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); |
433 } | 433 } |
434 #endif | 434 #endif |
OLD | NEW |