| 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 12556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12567 isolate->AdjustAmountOfExternalAllocatedMemory(-kSize)); | 12567 isolate->AdjustAmountOfExternalAllocatedMemory(-kSize)); |
| 12568 const int64_t kTriggerGCSize = | 12568 const int64_t kTriggerGCSize = |
| 12569 v8::internal::Internals::kExternalAllocationLimit + 1; | 12569 v8::internal::Internals::kExternalAllocationLimit + 1; |
| 12570 CHECK_EQ(baseline + kTriggerGCSize, | 12570 CHECK_EQ(baseline + kTriggerGCSize, |
| 12571 isolate->AdjustAmountOfExternalAllocatedMemory(kTriggerGCSize)); | 12571 isolate->AdjustAmountOfExternalAllocatedMemory(kTriggerGCSize)); |
| 12572 CHECK_EQ(baseline, | 12572 CHECK_EQ(baseline, |
| 12573 isolate->AdjustAmountOfExternalAllocatedMemory(-kTriggerGCSize)); | 12573 isolate->AdjustAmountOfExternalAllocatedMemory(-kTriggerGCSize)); |
| 12574 } | 12574 } |
| 12575 | 12575 |
| 12576 | 12576 |
| 12577 TEST(Regress51719) { |
| 12578 i::FLAG_incremental_marking = false; |
| 12579 CcTest::InitializeVM(); |
| 12580 |
| 12581 const int64_t kTriggerGCSize = |
| 12582 v8::internal::Internals::kExternalAllocationLimit + 1; |
| 12583 v8::Isolate* isolate = CcTest::isolate(); |
| 12584 isolate->AdjustAmountOfExternalAllocatedMemory(kTriggerGCSize); |
| 12585 } |
| 12586 |
| 12587 |
| 12577 // Regression test for issue 54, object templates with internal fields | 12588 // Regression test for issue 54, object templates with internal fields |
| 12578 // but no accessors or interceptors did not get their internal field | 12589 // but no accessors or interceptors did not get their internal field |
| 12579 // count set on instances. | 12590 // count set on instances. |
| 12580 THREADED_TEST(Regress54) { | 12591 THREADED_TEST(Regress54) { |
| 12581 LocalContext context; | 12592 LocalContext context; |
| 12582 v8::Isolate* isolate = context->GetIsolate(); | 12593 v8::Isolate* isolate = context->GetIsolate(); |
| 12583 v8::HandleScope outer(isolate); | 12594 v8::HandleScope outer(isolate); |
| 12584 static v8::Persistent<v8::ObjectTemplate> templ; | 12595 static v8::Persistent<v8::ObjectTemplate> templ; |
| 12585 if (templ.IsEmpty()) { | 12596 if (templ.IsEmpty()) { |
| 12586 v8::EscapableHandleScope inner(isolate); | 12597 v8::EscapableHandleScope inner(isolate); |
| (...skipping 9224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21811 CHECK(try_catch.HasTerminated()); | 21822 CHECK(try_catch.HasTerminated()); |
| 21812 } | 21823 } |
| 21813 | 21824 |
| 21814 | 21825 |
| 21815 TEST(EstimatedContextSize) { | 21826 TEST(EstimatedContextSize) { |
| 21816 v8::Isolate* isolate = CcTest::isolate(); | 21827 v8::Isolate* isolate = CcTest::isolate(); |
| 21817 v8::HandleScope scope(isolate); | 21828 v8::HandleScope scope(isolate); |
| 21818 LocalContext env; | 21829 LocalContext env; |
| 21819 CHECK(50000 < env->EstimatedSize()); | 21830 CHECK(50000 < env->EstimatedSize()); |
| 21820 } | 21831 } |
| OLD | NEW |