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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 v8::String::NewFromUtf8(CcTest::isolate(), "f"))); | 309 v8::String::NewFromUtf8(CcTest::isolate(), "f"))); |
310 CHECK_EQ(i, f->GetScriptLineNumber()); | 310 CHECK_EQ(i, f->GetScriptLineNumber()); |
311 } | 311 } |
312 } | 312 } |
313 | 313 |
314 | 314 |
315 TEST(FeedbackVectorPreservedAcrossRecompiles) { | 315 TEST(FeedbackVectorPreservedAcrossRecompiles) { |
316 if (i::FLAG_always_opt || !i::FLAG_crankshaft) return; | 316 if (i::FLAG_always_opt || !i::FLAG_crankshaft) return; |
317 i::FLAG_allow_natives_syntax = true; | 317 i::FLAG_allow_natives_syntax = true; |
318 CcTest::InitializeVM(); | 318 CcTest::InitializeVM(); |
| 319 if (!CcTest::i_isolate()->use_crankshaft()) return; |
319 v8::HandleScope scope(CcTest::isolate()); | 320 v8::HandleScope scope(CcTest::isolate()); |
320 | 321 |
321 // Make sure function f has a call that uses a type feedback slot. | 322 // Make sure function f has a call that uses a type feedback slot. |
322 CompileRun("function fun() {};" | 323 CompileRun("function fun() {};" |
323 "fun1 = fun;" | 324 "fun1 = fun;" |
324 "function f(a) { a(); } f(fun1);"); | 325 "function f(a) { a(); } f(fun1);"); |
325 | 326 |
326 Handle<JSFunction> f = | 327 Handle<JSFunction> f = |
327 v8::Utils::OpenHandle( | 328 v8::Utils::OpenHandle( |
328 *v8::Handle<v8::Function>::Cast( | 329 *v8::Handle<v8::Function>::Cast( |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 CompileRun("function f() { a = 12345678 }; f();"); | 428 CompileRun("function f() { a = 12345678 }; f();"); |
428 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 429 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
429 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); | 430 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); |
430 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 431 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
431 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); | 432 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); |
432 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 433 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
433 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); | 434 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); |
434 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); | 435 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); |
435 } | 436 } |
436 #endif | 437 #endif |
OLD | NEW |