| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 11211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11222 #ifdef DEBUG | 11222 #ifdef DEBUG |
| 11223 for (int i = start; i < end - 1; i++) { | 11223 for (int i = start; i < end - 1; i++) { |
| 11224 ASSERT(is_code_at(i) || compilation_info_at(i) != info); | 11224 ASSERT(is_code_at(i) || compilation_info_at(i) != info); |
| 11225 } | 11225 } |
| 11226 #endif | 11226 #endif |
| 11227 } | 11227 } |
| 11228 | 11228 |
| 11229 | 11229 |
| 11230 bool DependentCode::Contains(DependencyGroup group, Code* code) { | 11230 bool DependentCode::Contains(DependencyGroup group, Code* code) { |
| 11231 GroupStartIndexes starts(this); | 11231 GroupStartIndexes starts(this); |
| 11232 int number_of_entries = starts.number_of_code_entries(); | 11232 int number_of_entries = starts.number_of_entries(); |
| 11233 for (int i = 0; i < number_of_entries; i++) { | 11233 for (int i = 0; i < number_of_entries; i++) { |
| 11234 if (object_at(i) == code) return true; | 11234 if (object_at(i) == code) return true; |
| 11235 } | 11235 } |
| 11236 return false; | 11236 return false; |
| 11237 } | 11237 } |
| 11238 | 11238 |
| 11239 | 11239 |
| 11240 class DeoptimizeDependentCodeFilter : public OptimizedFunctionFilter { | 11240 class DeoptimizeDependentCodeFilter : public OptimizedFunctionFilter { |
| 11241 public: | 11241 public: |
| 11242 virtual bool TakeFunction(JSFunction* function) { | 11242 virtual bool TakeFunction(JSFunction* function) { |
| 11243 return function->code()->marked_for_deoptimization(); | 11243 return function->code()->marked_for_deoptimization(); |
| 11244 } | 11244 } |
| 11245 }; | 11245 }; |
| 11246 | 11246 |
| 11247 | 11247 |
| 11248 void DependentCode::DeoptimizeDependentCodeGroup( | 11248 void DependentCode::DeoptimizeDependentCodeGroup( |
| 11249 Isolate* isolate, | 11249 Isolate* isolate, |
| 11250 DependentCode::DependencyGroup group) { | 11250 DependentCode::DependencyGroup group) { |
| 11251 DisallowHeapAllocation no_allocation_scope; | 11251 DisallowHeapAllocation no_allocation_scope; |
| 11252 DependentCode::GroupStartIndexes starts(this); | 11252 DependentCode::GroupStartIndexes starts(this); |
| 11253 int start = starts.at(group); | 11253 int start = starts.at(group); |
| 11254 int end = starts.at(group + 1); | 11254 int end = starts.at(group + 1); |
| 11255 int code_entries = starts.number_of_code_entries(); | 11255 int code_entries = starts.number_of_entries(); |
| 11256 if (start == end) return; | 11256 if (start == end) return; |
| 11257 for (int i = start; i < end; i++) { | 11257 for (int i = start; i < end; i++) { |
| 11258 if (is_code_at(i)) { | 11258 if (is_code_at(i)) { |
| 11259 Code* code = code_at(i); | 11259 Code* code = code_at(i); |
| 11260 code->set_marked_for_deoptimization(true); | 11260 code->set_marked_for_deoptimization(true); |
| 11261 } else { | 11261 } else { |
| 11262 CompilationInfo* info = compilation_info_at(i); | 11262 CompilationInfo* info = compilation_info_at(i); |
| 11263 info->AbortDueToDependentMap(); | 11263 info->AbortDueToDependentMap(); |
| 11264 } | 11264 } |
| 11265 } | 11265 } |
| (...skipping 4522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15788 | 15788 |
| 15789 | 15789 |
| 15790 void JSTypedArray::Neuter() { | 15790 void JSTypedArray::Neuter() { |
| 15791 set_byte_offset(Smi::FromInt(0)); | 15791 set_byte_offset(Smi::FromInt(0)); |
| 15792 set_byte_length(Smi::FromInt(0)); | 15792 set_byte_length(Smi::FromInt(0)); |
| 15793 set_length(Smi::FromInt(0)); | 15793 set_length(Smi::FromInt(0)); |
| 15794 set_elements(GetHeap()->EmptyExternalArrayForMap(map())); | 15794 set_elements(GetHeap()->EmptyExternalArrayForMap(map())); |
| 15795 } | 15795 } |
| 15796 | 15796 |
| 15797 } } // namespace v8::internal | 15797 } } // namespace v8::internal |
| OLD | NEW |