| 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 3682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3693 for (int i = 0; i < 4; i++) { | 3693 for (int i = 0; i < 4; i++) { |
| 3694 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); | 3694 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
| 3695 } | 3695 } |
| 3696 | 3696 |
| 3697 ASSERT(code->marked_for_deoptimization()); | 3697 ASSERT(code->marked_for_deoptimization()); |
| 3698 } | 3698 } |
| 3699 | 3699 |
| 3700 | 3700 |
| 3701 | 3701 |
| 3702 static Handle<JSFunction> OptimizeDummyFunction(const char* name) { | 3702 static Handle<JSFunction> OptimizeDummyFunction(const char* name) { |
| 3703 char source[256]; | 3703 EmbeddedVector<char, 256> source; |
| 3704 snprintf(source, sizeof(source), | 3704 OS::SNPrintF(source, |
| 3705 "function %s() { return 0; }" | 3705 "function %s() { return 0; }" |
| 3706 "%s(); %s();" | 3706 "%s(); %s();" |
| 3707 "%%OptimizeFunctionOnNextCall(%s);" | 3707 "%%OptimizeFunctionOnNextCall(%s);" |
| 3708 "%s();", name, name, name, name, name); | 3708 "%s();", name, name, name, name, name); |
| 3709 CompileRun(source); | 3709 CompileRun(source.start()); |
| 3710 Handle<JSFunction> fun = | 3710 Handle<JSFunction> fun = |
| 3711 v8::Utils::OpenHandle( | 3711 v8::Utils::OpenHandle( |
| 3712 *v8::Handle<v8::Function>::Cast( | 3712 *v8::Handle<v8::Function>::Cast( |
| 3713 CcTest::global()->Get(v8_str(name)))); | 3713 CcTest::global()->Get(v8_str(name)))); |
| 3714 return fun; | 3714 return fun; |
| 3715 } | 3715 } |
| 3716 | 3716 |
| 3717 | 3717 |
| 3718 static int GetCodeChainLength(Code* code) { | 3718 static int GetCodeChainLength(Code* code) { |
| 3719 int result = 0; | 3719 int result = 0; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3829 v8::Handle<v8::Object> global = CcTest::global(); | 3829 v8::Handle<v8::Object> global = CcTest::global(); |
| 3830 v8::Handle<v8::Function> g = | 3830 v8::Handle<v8::Function> g = |
| 3831 v8::Handle<v8::Function>::Cast(global->Get(v8_str("crash"))); | 3831 v8::Handle<v8::Function>::Cast(global->Get(v8_str("crash"))); |
| 3832 v8::Handle<v8::Value> args1[] = { v8_num(1) }; | 3832 v8::Handle<v8::Value> args1[] = { v8_num(1) }; |
| 3833 heap->DisableInlineAllocation(); | 3833 heap->DisableInlineAllocation(); |
| 3834 heap->set_allocation_timeout(1); | 3834 heap->set_allocation_timeout(1); |
| 3835 g->Call(global, 1, args1); | 3835 g->Call(global, 1, args1); |
| 3836 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); | 3836 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
| 3837 } | 3837 } |
| 3838 #endif | 3838 #endif |
| OLD | NEW |