| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 double_values_[frame_index].Add(value_desc); | 919 double_values_[frame_index].Add(value_desc); |
| 920 } | 920 } |
| 921 | 921 |
| 922 | 922 |
| 923 MemoryChunk* Deoptimizer::CreateCode(BailoutType type) { | 923 MemoryChunk* Deoptimizer::CreateCode(BailoutType type) { |
| 924 // We cannot run this if the serializer is enabled because this will | 924 // We cannot run this if the serializer is enabled because this will |
| 925 // cause us to emit relocation information for the external | 925 // cause us to emit relocation information for the external |
| 926 // references. This is fine because the deoptimizer's code section | 926 // references. This is fine because the deoptimizer's code section |
| 927 // isn't meant to be serialized at all. | 927 // isn't meant to be serialized at all. |
| 928 ASSERT(!Serializer::enabled()); | 928 ASSERT(!Serializer::enabled()); |
| 929 bool old_debug_code = FLAG_debug_code; | |
| 930 FLAG_debug_code = false; | |
| 931 | 929 |
| 932 MacroAssembler masm(NULL, 16 * KB); | 930 MacroAssembler masm(NULL, 16 * KB); |
| 931 masm.set_emit_debug_code(false); |
| 933 GenerateDeoptimizationEntries(&masm, kNumberOfEntries, type); | 932 GenerateDeoptimizationEntries(&masm, kNumberOfEntries, type); |
| 934 CodeDesc desc; | 933 CodeDesc desc; |
| 935 masm.GetCode(&desc); | 934 masm.GetCode(&desc); |
| 936 ASSERT(desc.reloc_size == 0); | 935 ASSERT(desc.reloc_size == 0); |
| 937 | 936 |
| 938 MemoryChunk* chunk = | 937 MemoryChunk* chunk = |
| 939 MemoryAllocator::AllocateChunk(desc.instr_size, EXECUTABLE, NULL); | 938 MemoryAllocator::AllocateChunk(desc.instr_size, EXECUTABLE, NULL); |
| 940 memcpy(chunk->body(), desc.buffer, desc.instr_size); | 939 memcpy(chunk->body(), desc.buffer, desc.instr_size); |
| 941 CPU::FlushICache(chunk->body(), desc.instr_size); | 940 CPU::FlushICache(chunk->body(), desc.instr_size); |
| 942 FLAG_debug_code = old_debug_code; | |
| 943 return chunk; | 941 return chunk; |
| 944 } | 942 } |
| 945 | 943 |
| 946 | 944 |
| 947 Code* Deoptimizer::FindDeoptimizingCodeFromAddress(Address addr) { | 945 Code* Deoptimizer::FindDeoptimizingCodeFromAddress(Address addr) { |
| 948 DeoptimizingCodeListNode* node = Deoptimizer::deoptimizing_code_list_; | 946 DeoptimizingCodeListNode* node = Deoptimizer::deoptimizing_code_list_; |
| 949 while (node != NULL) { | 947 while (node != NULL) { |
| 950 if (node->code()->contains(addr)) return *node->code(); | 948 if (node->code()->contains(addr)) return *node->code(); |
| 951 node = node->next(); | 949 node = node->next(); |
| 952 } | 950 } |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1180 Deoptimizer::HandleWeakDeoptimizedCode); | 1178 Deoptimizer::HandleWeakDeoptimizedCode); |
| 1181 } | 1179 } |
| 1182 | 1180 |
| 1183 | 1181 |
| 1184 DeoptimizingCodeListNode::~DeoptimizingCodeListNode() { | 1182 DeoptimizingCodeListNode::~DeoptimizingCodeListNode() { |
| 1185 GlobalHandles::Destroy(reinterpret_cast<Object**>(code_.location())); | 1183 GlobalHandles::Destroy(reinterpret_cast<Object**>(code_.location())); |
| 1186 } | 1184 } |
| 1187 | 1185 |
| 1188 | 1186 |
| 1189 } } // namespace v8::internal | 1187 } } // namespace v8::internal |
| OLD | NEW |