Chromium Code Reviews| 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 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 920 | 920 |
| 921 | 921 |
| 922 void Deoptimizer::AddDoubleValue(int frame_index, | 922 void Deoptimizer::AddDoubleValue(int frame_index, |
| 923 int slot_index, | 923 int slot_index, |
| 924 double value) { | 924 double value) { |
| 925 ValueDescriptionDouble value_desc(slot_index, value); | 925 ValueDescriptionDouble value_desc(slot_index, value); |
| 926 double_values_[frame_index].Add(value_desc); | 926 double_values_[frame_index].Add(value_desc); |
| 927 } | 927 } |
| 928 | 928 |
| 929 | 929 |
| 930 static Mutex* flag_mutex = OS::CreateMutex(); | 930 static Mutex* flag_mutex = OS::CreateMutex(); |
|
Vitaly Repeshko
2011/03/16 13:21:50
Can be removed.
Mads Ager (chromium)
2011/03/16 13:54:28
Done.
| |
| 931 | 931 |
| 932 | 932 |
| 933 LargeObjectChunk* Deoptimizer::CreateCode(BailoutType type) { | 933 LargeObjectChunk* Deoptimizer::CreateCode(BailoutType type) { |
| 934 // We cannot run this if the serializer is enabled because this will | 934 // We cannot run this if the serializer is enabled because this will |
| 935 // cause us to emit relocation information for the external | 935 // cause us to emit relocation information for the external |
| 936 // references. This is fine because the deoptimizer's code section | 936 // references. This is fine because the deoptimizer's code section |
| 937 // isn't meant to be serialized at all. | 937 // isn't meant to be serialized at all. |
| 938 ASSERT(!Serializer::enabled()); | 938 ASSERT(!Serializer::enabled()); |
| 939 // Grab a mutex because we're changing a global flag. | |
| 940 ScopedLock lock(flag_mutex); | |
| 941 bool old_debug_code = FLAG_debug_code; | |
| 942 FLAG_debug_code = false; | |
| 943 | 939 |
| 944 MacroAssembler masm(NULL, 16 * KB); | 940 MacroAssembler masm(NULL, 16 * KB); |
| 941 masm.set_emit_debug_code(false); | |
| 945 GenerateDeoptimizationEntries(&masm, kNumberOfEntries, type); | 942 GenerateDeoptimizationEntries(&masm, kNumberOfEntries, type); |
| 946 CodeDesc desc; | 943 CodeDesc desc; |
| 947 masm.GetCode(&desc); | 944 masm.GetCode(&desc); |
| 948 ASSERT(desc.reloc_size == 0); | 945 ASSERT(desc.reloc_size == 0); |
| 949 | 946 |
| 950 LargeObjectChunk* chunk = LargeObjectChunk::New(desc.instr_size, EXECUTABLE); | 947 LargeObjectChunk* chunk = LargeObjectChunk::New(desc.instr_size, EXECUTABLE); |
| 951 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size); | 948 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size); |
| 952 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size); | 949 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size); |
| 953 FLAG_debug_code = old_debug_code; | |
| 954 return chunk; | 950 return chunk; |
| 955 } | 951 } |
| 956 | 952 |
| 957 | 953 |
| 958 Code* Deoptimizer::FindDeoptimizingCodeFromAddress(Address addr) { | 954 Code* Deoptimizer::FindDeoptimizingCodeFromAddress(Address addr) { |
| 959 DeoptimizingCodeListNode* node = | 955 DeoptimizingCodeListNode* node = |
| 960 Isolate::Current()->deoptimizer_data()->deoptimizing_code_list_; | 956 Isolate::Current()->deoptimizer_data()->deoptimizing_code_list_; |
| 961 while (node != NULL) { | 957 while (node != NULL) { |
| 962 if (node->code()->contains(addr)) return *node->code(); | 958 if (node->code()->contains(addr)) return *node->code(); |
| 963 node = node->next(); | 959 node = node->next(); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1196 } | 1192 } |
| 1197 | 1193 |
| 1198 | 1194 |
| 1199 DeoptimizingCodeListNode::~DeoptimizingCodeListNode() { | 1195 DeoptimizingCodeListNode::~DeoptimizingCodeListNode() { |
| 1200 GlobalHandles* global_handles = Isolate::Current()->global_handles(); | 1196 GlobalHandles* global_handles = Isolate::Current()->global_handles(); |
| 1201 global_handles->Destroy(reinterpret_cast<Object**>(code_.location())); | 1197 global_handles->Destroy(reinterpret_cast<Object**>(code_.location())); |
| 1202 } | 1198 } |
| 1203 | 1199 |
| 1204 | 1200 |
| 1205 } } // namespace v8::internal | 1201 } } // namespace v8::internal |
| OLD | NEW |