| 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 4376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4387 result++; | 4387 result++; |
| 4388 code = Code::cast(code->next_code_link()); | 4388 code = Code::cast(code->next_code_link()); |
| 4389 } | 4389 } |
| 4390 return result; | 4390 return result; |
| 4391 } | 4391 } |
| 4392 | 4392 |
| 4393 | 4393 |
| 4394 TEST(NextCodeLinkIsWeak) { | 4394 TEST(NextCodeLinkIsWeak) { |
| 4395 i::FLAG_always_opt = false; | 4395 i::FLAG_always_opt = false; |
| 4396 i::FLAG_allow_natives_syntax = true; | 4396 i::FLAG_allow_natives_syntax = true; |
| 4397 i::FLAG_turbo_deoptimization = true; | |
| 4398 CcTest::InitializeVM(); | 4397 CcTest::InitializeVM(); |
| 4399 Isolate* isolate = CcTest::i_isolate(); | 4398 Isolate* isolate = CcTest::i_isolate(); |
| 4400 v8::internal::Heap* heap = CcTest::heap(); | 4399 v8::internal::Heap* heap = CcTest::heap(); |
| 4401 | 4400 |
| 4402 if (!isolate->use_crankshaft()) return; | 4401 if (!isolate->use_crankshaft()) return; |
| 4403 HandleScope outer_scope(heap->isolate()); | 4402 HandleScope outer_scope(heap->isolate()); |
| 4404 Handle<Code> code; | 4403 Handle<Code> code; |
| 4405 heap->CollectAllAvailableGarbage(); | 4404 heap->CollectAllAvailableGarbage(); |
| 4406 int code_chain_length_before, code_chain_length_after; | 4405 int code_chain_length_before, code_chain_length_after; |
| 4407 { | 4406 { |
| (...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5552 size_t counter2 = 2000; | 5551 size_t counter2 = 2000; |
| 5553 tracer->SampleNewSpaceAllocation(time2, counter2); | 5552 tracer->SampleNewSpaceAllocation(time2, counter2); |
| 5554 size_t bytes = tracer->NewSpaceAllocatedBytesInLast(1000); | 5553 size_t bytes = tracer->NewSpaceAllocatedBytesInLast(1000); |
| 5555 CHECK_EQ(0, bytes); | 5554 CHECK_EQ(0, bytes); |
| 5556 int time3 = 1000; | 5555 int time3 = 1000; |
| 5557 size_t counter3 = 30000; | 5556 size_t counter3 = 30000; |
| 5558 tracer->SampleNewSpaceAllocation(time3, counter3); | 5557 tracer->SampleNewSpaceAllocation(time3, counter3); |
| 5559 bytes = tracer->NewSpaceAllocatedBytesInLast(100); | 5558 bytes = tracer->NewSpaceAllocatedBytesInLast(100); |
| 5560 CHECK_EQ((counter3 - counter1) * 100 / (time3 - time1), bytes); | 5559 CHECK_EQ((counter3 - counter1) * 100 / (time3 - time1), bytes); |
| 5561 } | 5560 } |
| OLD | NEW |