| 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 4030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4041 for (Object* site = heap->allocation_sites_list(); | 4041 for (Object* site = heap->allocation_sites_list(); |
| 4042 !(site->IsUndefined()); | 4042 !(site->IsUndefined()); |
| 4043 site = AllocationSite::cast(site)->weak_next()) { | 4043 site = AllocationSite::cast(site)->weak_next()) { |
| 4044 count++; | 4044 count++; |
| 4045 } | 4045 } |
| 4046 return count; | 4046 return count; |
| 4047 } | 4047 } |
| 4048 | 4048 |
| 4049 | 4049 |
| 4050 TEST(EnsureAllocationSiteDependentCodesProcessed) { | 4050 TEST(EnsureAllocationSiteDependentCodesProcessed) { |
| 4051 // TODO(mvstanton): vector ics need weak support! |
| 4052 if (FLAG_vector_ics) return; |
| 4051 if (i::FLAG_always_opt || !i::FLAG_crankshaft) return; | 4053 if (i::FLAG_always_opt || !i::FLAG_crankshaft) return; |
| 4052 i::FLAG_allow_natives_syntax = true; | 4054 i::FLAG_allow_natives_syntax = true; |
| 4053 CcTest::InitializeVM(); | 4055 CcTest::InitializeVM(); |
| 4054 Isolate* isolate = CcTest::i_isolate(); | 4056 Isolate* isolate = CcTest::i_isolate(); |
| 4055 v8::internal::Heap* heap = CcTest::heap(); | 4057 v8::internal::Heap* heap = CcTest::heap(); |
| 4056 GlobalHandles* global_handles = isolate->global_handles(); | 4058 GlobalHandles* global_handles = isolate->global_handles(); |
| 4057 | 4059 |
| 4058 if (!isolate->use_crankshaft()) return; | 4060 if (!isolate->use_crankshaft()) return; |
| 4059 | 4061 |
| 4060 // The allocation site at the head of the list is ours. | 4062 // The allocation site at the head of the list is ours. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4145 // Now make sure that a gc should get rid of the function | 4147 // Now make sure that a gc should get rid of the function |
| 4146 for (int i = 0; i < 4; i++) { | 4148 for (int i = 0; i < 4; i++) { |
| 4147 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); | 4149 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
| 4148 } | 4150 } |
| 4149 | 4151 |
| 4150 DCHECK(code->marked_for_deoptimization()); | 4152 DCHECK(code->marked_for_deoptimization()); |
| 4151 } | 4153 } |
| 4152 | 4154 |
| 4153 | 4155 |
| 4154 TEST(ObjectsInOptimizedCodeAreWeak) { | 4156 TEST(ObjectsInOptimizedCodeAreWeak) { |
| 4157 // TODO(mvstanton): vector ics need weak support! |
| 4158 if (FLAG_vector_ics) return; |
| 4155 if (i::FLAG_always_opt || !i::FLAG_crankshaft) return; | 4159 if (i::FLAG_always_opt || !i::FLAG_crankshaft) return; |
| 4156 i::FLAG_weak_embedded_objects_in_optimized_code = true; | 4160 i::FLAG_weak_embedded_objects_in_optimized_code = true; |
| 4157 i::FLAG_allow_natives_syntax = true; | 4161 i::FLAG_allow_natives_syntax = true; |
| 4158 CcTest::InitializeVM(); | 4162 CcTest::InitializeVM(); |
| 4159 Isolate* isolate = CcTest::i_isolate(); | 4163 Isolate* isolate = CcTest::i_isolate(); |
| 4160 v8::internal::Heap* heap = CcTest::heap(); | 4164 v8::internal::Heap* heap = CcTest::heap(); |
| 4161 | 4165 |
| 4162 if (!isolate->use_crankshaft()) return; | 4166 if (!isolate->use_crankshaft()) return; |
| 4163 HandleScope outer_scope(heap->isolate()); | 4167 HandleScope outer_scope(heap->isolate()); |
| 4164 Handle<Code> code; | 4168 Handle<Code> code; |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4812 #ifdef DEBUG | 4816 #ifdef DEBUG |
| 4813 TEST(PathTracer) { | 4817 TEST(PathTracer) { |
| 4814 CcTest::InitializeVM(); | 4818 CcTest::InitializeVM(); |
| 4815 v8::HandleScope scope(CcTest::isolate()); | 4819 v8::HandleScope scope(CcTest::isolate()); |
| 4816 | 4820 |
| 4817 v8::Local<v8::Value> result = CompileRun("'abc'"); | 4821 v8::Local<v8::Value> result = CompileRun("'abc'"); |
| 4818 Handle<Object> o = v8::Utils::OpenHandle(*result); | 4822 Handle<Object> o = v8::Utils::OpenHandle(*result); |
| 4819 CcTest::i_isolate()->heap()->TracePathToObject(*o); | 4823 CcTest::i_isolate()->heap()->TracePathToObject(*o); |
| 4820 } | 4824 } |
| 4821 #endif // DEBUG | 4825 #endif // DEBUG |
| OLD | NEW |