| 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 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1404 // references. This is fine because the deoptimizer's code section | 1404 // references. This is fine because the deoptimizer's code section |
| 1405 // isn't meant to be serialized at all. | 1405 // isn't meant to be serialized at all. |
| 1406 ASSERT(!Serializer::enabled()); | 1406 ASSERT(!Serializer::enabled()); |
| 1407 | 1407 |
| 1408 ASSERT(type == EAGER || type == LAZY); | 1408 ASSERT(type == EAGER || type == LAZY); |
| 1409 DeoptimizerData* data = Isolate::Current()->deoptimizer_data(); | 1409 DeoptimizerData* data = Isolate::Current()->deoptimizer_data(); |
| 1410 int entry_count = (type == EAGER) | 1410 int entry_count = (type == EAGER) |
| 1411 ? data->eager_deoptimization_entry_code_entries_ | 1411 ? data->eager_deoptimization_entry_code_entries_ |
| 1412 : data->lazy_deoptimization_entry_code_entries_; | 1412 : data->lazy_deoptimization_entry_code_entries_; |
| 1413 if (max_entry_id < entry_count) return; | 1413 if (max_entry_id < entry_count) return; |
| 1414 entry_count = Min(Max(entry_count * 2, Deoptimizer::kMinNumberOfEntries), | 1414 entry_count = Max(entry_count, Deoptimizer::kMinNumberOfEntries); |
| 1415 Deoptimizer::kMaxNumberOfEntries); | 1415 while (max_entry_id >= entry_count) entry_count *= 2; |
| 1416 ASSERT(entry_count <= Deoptimizer::kMaxNumberOfEntries); |
| 1416 | 1417 |
| 1417 MacroAssembler masm(Isolate::Current(), NULL, 16 * KB); | 1418 MacroAssembler masm(Isolate::Current(), NULL, 16 * KB); |
| 1418 masm.set_emit_debug_code(false); | 1419 masm.set_emit_debug_code(false); |
| 1419 GenerateDeoptimizationEntries(&masm, entry_count, type); | 1420 GenerateDeoptimizationEntries(&masm, entry_count, type); |
| 1420 CodeDesc desc; | 1421 CodeDesc desc; |
| 1421 masm.GetCode(&desc); | 1422 masm.GetCode(&desc); |
| 1422 ASSERT(desc.reloc_size == 0); | 1423 ASSERT(desc.reloc_size == 0); |
| 1423 | 1424 |
| 1424 VirtualMemory* memory = type == EAGER | 1425 VirtualMemory* memory = type == EAGER |
| 1425 ? data->eager_deoptimization_entry_code_ | 1426 ? data->eager_deoptimization_entry_code_ |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2022 | 2023 |
| 2023 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 2024 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
| 2024 v->VisitPointer(BitCast<Object**>(&function_)); | 2025 v->VisitPointer(BitCast<Object**>(&function_)); |
| 2025 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 2026 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
| 2026 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 2027 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
| 2027 } | 2028 } |
| 2028 | 2029 |
| 2029 #endif // ENABLE_DEBUGGER_SUPPORT | 2030 #endif // ENABLE_DEBUGGER_SUPPORT |
| 2030 | 2031 |
| 2031 } } // namespace v8::internal | 2032 } } // namespace v8::internal |
| OLD | NEW |