| 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 3854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3865 #endif | 3865 #endif |
| 3866 CompileRun("%OptimizeFunctionOnNextCall(g);" | 3866 CompileRun("%OptimizeFunctionOnNextCall(g);" |
| 3867 "g(false);"); | 3867 "g(false);"); |
| 3868 | 3868 |
| 3869 // Finish garbage collection cycle. | 3869 // Finish garbage collection cycle. |
| 3870 heap->CollectAllGarbage(Heap::kNoGCFlags); | 3870 heap->CollectAllGarbage(Heap::kNoGCFlags); |
| 3871 CHECK(shared1->code()->gc_metadata() == NULL); | 3871 CHECK(shared1->code()->gc_metadata() == NULL); |
| 3872 } | 3872 } |
| 3873 | 3873 |
| 3874 | 3874 |
| 3875 // Helper function that simulates a fill new-space in the heap. |
| 3876 static inline void AllocateAllButNBytes(v8::internal::NewSpace* space, |
| 3877 int extra_bytes) { |
| 3878 int space_remaining = static_cast<int>( |
| 3879 *space->allocation_limit_address() - *space->allocation_top_address()); |
| 3880 CHECK(space_remaining >= extra_bytes); |
| 3881 int new_linear_size = space_remaining - extra_bytes; |
| 3882 v8::internal::AllocationResult allocation = |
| 3883 space->AllocateRaw(new_linear_size); |
| 3884 v8::internal::FreeListNode* node = |
| 3885 v8::internal::FreeListNode::cast(allocation.ToObjectChecked()); |
| 3886 node->set_size(space->heap(), new_linear_size); |
| 3887 } |
| 3888 |
| 3889 |
| 3875 TEST(Regress169928) { | 3890 TEST(Regress169928) { |
| 3876 i::FLAG_allow_natives_syntax = true; | 3891 i::FLAG_allow_natives_syntax = true; |
| 3877 i::FLAG_crankshaft = false; | 3892 i::FLAG_crankshaft = false; |
| 3878 CcTest::InitializeVM(); | 3893 CcTest::InitializeVM(); |
| 3879 Isolate* isolate = CcTest::i_isolate(); | 3894 Isolate* isolate = CcTest::i_isolate(); |
| 3880 Factory* factory = isolate->factory(); | 3895 Factory* factory = isolate->factory(); |
| 3881 v8::HandleScope scope(CcTest::isolate()); | 3896 v8::HandleScope scope(CcTest::isolate()); |
| 3882 | 3897 |
| 3883 // Some flags turn Scavenge collections into Mark-sweep collections | 3898 // Some flags turn Scavenge collections into Mark-sweep collections |
| 3884 // and hence are incompatible with this test case. | 3899 // and hence are incompatible with this test case. |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5088 #ifdef DEBUG | 5103 #ifdef DEBUG |
| 5089 TEST(PathTracer) { | 5104 TEST(PathTracer) { |
| 5090 CcTest::InitializeVM(); | 5105 CcTest::InitializeVM(); |
| 5091 v8::HandleScope scope(CcTest::isolate()); | 5106 v8::HandleScope scope(CcTest::isolate()); |
| 5092 | 5107 |
| 5093 v8::Local<v8::Value> result = CompileRun("'abc'"); | 5108 v8::Local<v8::Value> result = CompileRun("'abc'"); |
| 5094 Handle<Object> o = v8::Utils::OpenHandle(*result); | 5109 Handle<Object> o = v8::Utils::OpenHandle(*result); |
| 5095 CcTest::i_isolate()->heap()->TracePathToObject(*o); | 5110 CcTest::i_isolate()->heap()->TracePathToObject(*o); |
| 5096 } | 5111 } |
| 5097 #endif // DEBUG | 5112 #endif // DEBUG |
| OLD | NEW |