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 5881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5892 PrintF("Context size : %d bytes\n", measure.Size()); | 5892 PrintF("Context size : %d bytes\n", measure.Size()); |
5893 PrintF("Context object count: %d\n", measure.Count()); | 5893 PrintF("Context object count: %d\n", measure.Count()); |
5894 | 5894 |
5895 CHECK_LE(1000, measure.Count()); | 5895 CHECK_LE(1000, measure.Count()); |
5896 CHECK_LE(50000, measure.Size()); | 5896 CHECK_LE(50000, measure.Size()); |
5897 | 5897 |
5898 CHECK_LE(measure.Count(), count_upper_limit); | 5898 CHECK_LE(measure.Count(), count_upper_limit); |
5899 CHECK_LE(measure.Size(), size_upper_limit); | 5899 CHECK_LE(measure.Size(), size_upper_limit); |
5900 } | 5900 } |
5901 | 5901 |
| 5902 TEST(ContextMeasureNoMap) { |
| 5903 CcTest::InitializeVM(); |
| 5904 v8::HandleScope scope(CcTest::isolate()); |
| 5905 |
| 5906 Local<v8::Context> current_context = CcTest::isolate()->GetCurrentContext(); |
| 5907 Local<v8::Context> other_context = v8::Context::New(CcTest::isolate()); |
| 5908 |
| 5909 CompileRun(current_context, "var x = []"); |
| 5910 |
| 5911 size_t original_size_current = current_context->EstimatedSize(); |
| 5912 size_t original_size_other = other_context->EstimatedSize(); |
| 5913 |
| 5914 CompileRun(current_context, "x.a = 1;"); |
| 5915 |
| 5916 size_t new_size_current = current_context->EstimatedSize(); |
| 5917 size_t new_size_other = other_context->EstimatedSize(); |
| 5918 |
| 5919 CHECK_LT(original_size_current, new_size_current); |
| 5920 CHECK_EQ(original_size_other, new_size_other); |
| 5921 } |
5902 | 5922 |
5903 TEST(ScriptIterator) { | 5923 TEST(ScriptIterator) { |
5904 CcTest::InitializeVM(); | 5924 CcTest::InitializeVM(); |
5905 v8::HandleScope scope(CcTest::isolate()); | 5925 v8::HandleScope scope(CcTest::isolate()); |
5906 Isolate* isolate = CcTest::i_isolate(); | 5926 Isolate* isolate = CcTest::i_isolate(); |
5907 Heap* heap = CcTest::heap(); | 5927 Heap* heap = CcTest::heap(); |
5908 LocalContext context; | 5928 LocalContext context; |
5909 | 5929 |
5910 CcTest::CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask); | 5930 CcTest::CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask); |
5911 | 5931 |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6637 CHECK(!heap->code_space()->FirstPage()->Contains(code->address())); | 6657 CHECK(!heap->code_space()->FirstPage()->Contains(code->address())); |
6638 | 6658 |
6639 // Ensure it's not in large object space. | 6659 // Ensure it's not in large object space. |
6640 MemoryChunk* chunk = MemoryChunk::FromAddress(code->address()); | 6660 MemoryChunk* chunk = MemoryChunk::FromAddress(code->address()); |
6641 CHECK(chunk->owner()->identity() != LO_SPACE); | 6661 CHECK(chunk->owner()->identity() != LO_SPACE); |
6642 CHECK(chunk->NeverEvacuate()); | 6662 CHECK(chunk->NeverEvacuate()); |
6643 } | 6663 } |
6644 | 6664 |
6645 } // namespace internal | 6665 } // namespace internal |
6646 } // namespace v8 | 6666 } // namespace v8 |
OLD | NEW |