| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 } | 101 } |
| 102 | 102 |
| 103 | 103 |
| 104 // No larger than 2K on all platforms | 104 // No larger than 2K on all platforms |
| 105 static const int kDeoptTableMaxEpilogueCodeSize = 2 * KB; | 105 static const int kDeoptTableMaxEpilogueCodeSize = 2 * KB; |
| 106 | 106 |
| 107 | 107 |
| 108 size_t Deoptimizer::GetMaxDeoptTableSize() { | 108 size_t Deoptimizer::GetMaxDeoptTableSize() { |
| 109 int entries_size = | 109 int entries_size = |
| 110 Deoptimizer::kMaxNumberOfEntries * Deoptimizer::table_entry_size_; | 110 Deoptimizer::kMaxNumberOfEntries * Deoptimizer::table_entry_size_; |
| 111 int commit_page_size = static_cast<int>(OS::CommitPageSize()); |
| 111 int page_count = ((kDeoptTableMaxEpilogueCodeSize + entries_size - 1) / | 112 int page_count = ((kDeoptTableMaxEpilogueCodeSize + entries_size - 1) / |
| 112 OS::CommitPageSize()) + 1; | 113 commit_page_size) + 1; |
| 113 return OS::CommitPageSize() * page_count; | 114 return static_cast<size_t>(commit_page_size * page_count); |
| 114 } | 115 } |
| 115 | 116 |
| 116 | 117 |
| 117 Deoptimizer* Deoptimizer::Grab(Isolate* isolate) { | 118 Deoptimizer* Deoptimizer::Grab(Isolate* isolate) { |
| 118 ASSERT(isolate == Isolate::Current()); | 119 ASSERT(isolate == Isolate::Current()); |
| 119 Deoptimizer* result = isolate->deoptimizer_data()->current_; | 120 Deoptimizer* result = isolate->deoptimizer_data()->current_; |
| 120 ASSERT(result != NULL); | 121 ASSERT(result != NULL); |
| 121 result->DeleteFrameDescriptions(); | 122 result->DeleteFrameDescriptions(); |
| 122 isolate->deoptimizer_data()->current_ = NULL; | 123 isolate->deoptimizer_data()->current_ = NULL; |
| 123 return result; | 124 return result; |
| (...skipping 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2021 | 2022 |
| 2022 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 2023 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
| 2023 v->VisitPointer(BitCast<Object**>(&function_)); | 2024 v->VisitPointer(BitCast<Object**>(&function_)); |
| 2024 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 2025 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
| 2025 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 2026 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
| 2026 } | 2027 } |
| 2027 | 2028 |
| 2028 #endif // ENABLE_DEBUGGER_SUPPORT | 2029 #endif // ENABLE_DEBUGGER_SUPPORT |
| 2029 | 2030 |
| 2030 } } // namespace v8::internal | 2031 } } // namespace v8::internal |
| OLD | NEW |