| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 #endif | 54 #endif |
| 55 #if V8_TARGET_ARCH_MIPS && !V8_INTERPRETED_REGEXP | 55 #if V8_TARGET_ARCH_MIPS && !V8_INTERPRETED_REGEXP |
| 56 #include "regexp-macro-assembler.h" | 56 #include "regexp-macro-assembler.h" |
| 57 #include "mips/regexp-macro-assembler-mips.h" | 57 #include "mips/regexp-macro-assembler-mips.h" |
| 58 #endif | 58 #endif |
| 59 | 59 |
| 60 namespace v8 { | 60 namespace v8 { |
| 61 namespace internal { | 61 namespace internal { |
| 62 | 62 |
| 63 | 63 |
| 64 static const intptr_t kMinimumPromotionLimit = 2 * MB; | 64 static const intptr_t kMinimumPromotionLimit = |
| 65 static const intptr_t kMinimumAllocationLimit = 8 * MB; | 65 2 * (Page::kPageSize > MB ? Page::kPageSize : MB); |
| 66 static const intptr_t kMinimumAllocationLimit = |
| 67 8 * (Page::kPageSize > MB ? Page::kPageSize : MB); |
| 66 | 68 |
| 67 | 69 |
| 68 static Mutex* gc_initializer_mutex = OS::CreateMutex(); | 70 static Mutex* gc_initializer_mutex = OS::CreateMutex(); |
| 69 | 71 |
| 70 | 72 |
| 71 Heap::Heap() | 73 Heap::Heap() |
| 72 : isolate_(NULL), | 74 : isolate_(NULL), |
| 73 // semispace_size_ should be a power of 2 and old_generation_size_ should be | 75 // semispace_size_ should be a power of 2 and old_generation_size_ should be |
| 74 // a multiple of Page::kPageSize. | 76 // a multiple of Page::kPageSize. |
| 75 #if defined(ANDROID) | 77 #if defined(ANDROID) |
| 76 reserved_semispace_size_(2*MB), | 78 #define LUMP_OF_MEMORY (128 * KB) |
| 77 max_semispace_size_(2*MB), | |
| 78 initial_semispace_size_(128*KB), | |
| 79 max_old_generation_size_(192*MB), | |
| 80 max_executable_size_(max_old_generation_size_), | |
| 81 code_range_size_(0), | 79 code_range_size_(0), |
| 82 #elif defined(V8_TARGET_ARCH_X64) | 80 #elif defined(V8_TARGET_ARCH_X64) |
| 83 reserved_semispace_size_(16*MB), | 81 #define LUMP_OF_MEMORY (2 * MB) |
| 84 max_semispace_size_(16*MB), | |
| 85 initial_semispace_size_(1*MB), | |
| 86 max_old_generation_size_(1*GB), | |
| 87 max_executable_size_(256*MB), | |
| 88 code_range_size_(512*MB), | 82 code_range_size_(512*MB), |
| 89 #else | 83 #else |
| 90 reserved_semispace_size_(4*MB), | 84 #define LUMP_OF_MEMORY MB |
| 91 max_semispace_size_(4*MB), | |
| 92 initial_semispace_size_(1*MB), | |
| 93 max_old_generation_size_(512*MB), | |
| 94 max_executable_size_(128*MB), | |
| 95 code_range_size_(0), | 85 code_range_size_(0), |
| 96 #endif | 86 #endif |
| 87 reserved_semispace_size_(4 * Max(LUMP_OF_MEMORY, Page::kPageSize)), |
| 88 max_semispace_size_(4 * Max(LUMP_OF_MEMORY, Page::kPageSize)), |
| 89 initial_semispace_size_(Max(LUMP_OF_MEMORY, Page::kPageSize)), |
| 90 max_old_generation_size_(1024ul * LUMP_OF_MEMORY), |
| 91 max_executable_size_(256l * LUMP_OF_MEMORY), |
| 92 |
| 97 // Variables set based on semispace_size_ and old_generation_size_ in | 93 // Variables set based on semispace_size_ and old_generation_size_ in |
| 98 // ConfigureHeap (survived_since_last_expansion_, external_allocation_limit_) | 94 // ConfigureHeap (survived_since_last_expansion_, external_allocation_limit_) |
| 99 // Will be 4 * reserved_semispace_size_ to ensure that young | 95 // Will be 4 * reserved_semispace_size_ to ensure that young |
| 100 // generation can be aligned to its size. | 96 // generation can be aligned to its size. |
| 101 survived_since_last_expansion_(0), | 97 survived_since_last_expansion_(0), |
| 102 always_allocate_scope_depth_(0), | 98 always_allocate_scope_depth_(0), |
| 103 linear_allocation_scope_depth_(0), | 99 linear_allocation_scope_depth_(0), |
| 104 contexts_disposed_(0), | 100 contexts_disposed_(0), |
| 105 scan_on_scavenge_pages_(0), | 101 scan_on_scavenge_pages_(0), |
| 106 new_space_(this), | 102 new_space_(this), |
| (...skipping 5908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6015 } | 6011 } |
| 6016 | 6012 |
| 6017 | 6013 |
| 6018 void ExternalStringTable::TearDown() { | 6014 void ExternalStringTable::TearDown() { |
| 6019 new_space_strings_.Free(); | 6015 new_space_strings_.Free(); |
| 6020 old_space_strings_.Free(); | 6016 old_space_strings_.Free(); |
| 6021 } | 6017 } |
| 6022 | 6018 |
| 6023 | 6019 |
| 6024 } } // namespace v8::internal | 6020 } } // namespace v8::internal |
| OLD | NEW |