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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 // there we just skip the test. | 495 // there we just skip the test. |
496 if (initial_memory >= 0) { | 496 if (initial_memory >= 0) { |
497 CcTest::InitializeVM(); | 497 CcTest::InitializeVM(); |
498 intptr_t delta = MemoryInUse() - initial_memory; | 498 intptr_t delta = MemoryInUse() - initial_memory; |
499 printf("delta: %" V8_PTR_PREFIX "d kB\n", delta / 1024); | 499 printf("delta: %" V8_PTR_PREFIX "d kB\n", delta / 1024); |
500 if (v8::internal::Snapshot::IsEnabled()) { | 500 if (v8::internal::Snapshot::IsEnabled()) { |
501 CHECK_LE(delta, | 501 CHECK_LE(delta, |
502 3000 * 1024 * FullCodeGenerator::kBootCodeSizeMultiplier / 100); | 502 3000 * 1024 * FullCodeGenerator::kBootCodeSizeMultiplier / 100); |
503 } else { | 503 } else { |
504 CHECK_LE(delta, | 504 CHECK_LE(delta, |
505 3300 * 1024 * FullCodeGenerator::kBootCodeSizeMultiplier / 100); | 505 3350 * 1024 * FullCodeGenerator::kBootCodeSizeMultiplier / 100); |
506 } | 506 } |
507 } | 507 } |
508 } | 508 } |
509 | 509 |
510 | 510 |
511 intptr_t ShortLivingIsolate() { | 511 intptr_t ShortLivingIsolate() { |
512 v8::Isolate* isolate = v8::Isolate::New(); | 512 v8::Isolate* isolate = v8::Isolate::New(); |
513 { v8::Isolate::Scope isolate_scope(isolate); | 513 { v8::Isolate::Scope isolate_scope(isolate); |
514 v8::Locker lock(isolate); | 514 v8::Locker lock(isolate); |
515 v8::HandleScope handle_scope(isolate); | 515 v8::HandleScope handle_scope(isolate); |
516 v8::Local<v8::Context> context = v8::Context::New(isolate); | 516 v8::Local<v8::Context> context = v8::Context::New(isolate); |
517 CHECK(!context.IsEmpty()); | 517 CHECK(!context.IsEmpty()); |
518 } | 518 } |
519 isolate->Dispose(); | 519 isolate->Dispose(); |
520 return MemoryInUse(); | 520 return MemoryInUse(); |
521 } | 521 } |
522 | 522 |
523 | 523 |
524 TEST(RegressJoinThreadsOnIsolateDeinit) { | 524 TEST(RegressJoinThreadsOnIsolateDeinit) { |
525 intptr_t size_limit = ShortLivingIsolate() * 2; | 525 intptr_t size_limit = ShortLivingIsolate() * 2; |
526 for (int i = 0; i < 10; i++) { | 526 for (int i = 0; i < 10; i++) { |
527 CHECK_GT(size_limit, ShortLivingIsolate()); | 527 CHECK_GT(size_limit, ShortLivingIsolate()); |
528 } | 528 } |
529 } | 529 } |
530 | 530 |
531 #endif // __linux__ and !USE_SIMULATOR | 531 #endif // __linux__ and !USE_SIMULATOR |
OLD | NEW |