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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 CcTest::InitializeVM(); | 493 CcTest::InitializeVM(); |
494 intptr_t delta = MemoryInUse() - initial_memory; | 494 intptr_t delta = MemoryInUse() - initial_memory; |
495 printf("delta: %" V8_PTR_PREFIX "d kB\n", delta / 1024); | 495 printf("delta: %" V8_PTR_PREFIX "d kB\n", delta / 1024); |
496 if (sizeof(initial_memory) == 8) { // 64-bit. | 496 if (sizeof(initial_memory) == 8) { // 64-bit. |
497 if (v8::internal::Snapshot::IsEnabled()) { | 497 if (v8::internal::Snapshot::IsEnabled()) { |
498 CHECK_LE(delta, 4100 * 1024); | 498 CHECK_LE(delta, 4100 * 1024); |
499 } else { | 499 } else { |
500 CHECK_LE(delta, 4600 * 1024); | 500 CHECK_LE(delta, 4600 * 1024); |
501 } | 501 } |
502 } else { // 32-bit. | 502 } else { // 32-bit. |
| 503 #if V8_TARGET_ARCH_MIPS |
| 504 // Increase limits due to larger code size on MIPS. |
| 505 if (v8::internal::Snapshot::IsEnabled()) { |
| 506 CHECK_LE(delta, 3500 * 1024); |
| 507 } else { |
| 508 CHECK_LE(delta, 3800 * 1024); |
| 509 } |
| 510 #else |
503 if (v8::internal::Snapshot::IsEnabled()) { | 511 if (v8::internal::Snapshot::IsEnabled()) { |
504 CHECK_LE(delta, 3100 * 1024); | 512 CHECK_LE(delta, 3100 * 1024); |
505 } else { | 513 } else { |
506 CHECK_LE(delta, 3450 * 1024); | 514 CHECK_LE(delta, 3450 * 1024); |
507 } | 515 } |
| 516 #endif |
508 } | 517 } |
509 } | 518 } |
510 } | 519 } |
511 | 520 |
512 | 521 |
513 intptr_t ShortLivingIsolate() { | 522 intptr_t ShortLivingIsolate() { |
514 v8::Isolate* isolate = v8::Isolate::New(); | 523 v8::Isolate* isolate = v8::Isolate::New(); |
515 { v8::Isolate::Scope isolate_scope(isolate); | 524 { v8::Isolate::Scope isolate_scope(isolate); |
516 v8::Locker lock(isolate); | 525 v8::Locker lock(isolate); |
517 v8::HandleScope handle_scope(isolate); | 526 v8::HandleScope handle_scope(isolate); |
518 v8::Local<v8::Context> context = v8::Context::New(isolate); | 527 v8::Local<v8::Context> context = v8::Context::New(isolate); |
519 CHECK(!context.IsEmpty()); | 528 CHECK(!context.IsEmpty()); |
520 } | 529 } |
521 isolate->Dispose(); | 530 isolate->Dispose(); |
522 return MemoryInUse(); | 531 return MemoryInUse(); |
523 } | 532 } |
524 | 533 |
525 | 534 |
526 TEST(RegressJoinThreadsOnIsolateDeinit) { | 535 TEST(RegressJoinThreadsOnIsolateDeinit) { |
527 intptr_t size_limit = ShortLivingIsolate() * 2; | 536 intptr_t size_limit = ShortLivingIsolate() * 2; |
528 for (int i = 0; i < 10; i++) { | 537 for (int i = 0; i < 10; i++) { |
529 CHECK_GT(size_limit, ShortLivingIsolate()); | 538 CHECK_GT(size_limit, ShortLivingIsolate()); |
530 } | 539 } |
531 } | 540 } |
532 | 541 |
533 #endif // __linux__ and !USE_SIMULATOR | 542 #endif // __linux__ and !USE_SIMULATOR |
OLD | NEW |