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 11348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11359 Isolate* isolate, | 11359 Isolate* isolate, |
11360 DependentCode::DependencyGroup group) { | 11360 DependentCode::DependencyGroup group) { |
11361 ASSERT(AllowCodeDependencyChange::IsAllowed()); | 11361 ASSERT(AllowCodeDependencyChange::IsAllowed()); |
11362 DisallowHeapAllocation no_allocation_scope; | 11362 DisallowHeapAllocation no_allocation_scope; |
11363 DependentCode::GroupStartIndexes starts(this); | 11363 DependentCode::GroupStartIndexes starts(this); |
11364 int start = starts.at(group); | 11364 int start = starts.at(group); |
11365 int end = starts.at(group + 1); | 11365 int end = starts.at(group + 1); |
11366 int code_entries = starts.number_of_entries(); | 11366 int code_entries = starts.number_of_entries(); |
11367 if (start == end) return; | 11367 if (start == end) return; |
11368 | 11368 |
11369 // Collect all the code to deoptimize. | 11369 // Mark all the code that needs to be deoptimized. |
11370 Zone zone(isolate); | 11370 bool marked = false; |
11371 ZoneList<Code*> codes(end - start, &zone); | |
11372 for (int i = start; i < end; i++) { | 11371 for (int i = start; i < end; i++) { |
11373 if (is_code_at(i)) { | 11372 if (is_code_at(i)) { |
11374 Code* code = code_at(i); | 11373 Code* code = code_at(i); |
11375 if (!code->marked_for_deoptimization()) codes.Add(code, &zone); | 11374 if (!code->marked_for_deoptimization()) { |
| 11375 code->set_marked_for_deoptimization(true); |
| 11376 marked = true; |
| 11377 } |
11376 } else { | 11378 } else { |
11377 CompilationInfo* info = compilation_info_at(i); | 11379 CompilationInfo* info = compilation_info_at(i); |
11378 info->AbortDueToDependencyChange(); | 11380 info->AbortDueToDependencyChange(); |
11379 } | 11381 } |
11380 } | 11382 } |
11381 // Compact the array by moving all subsequent groups to fill in the new holes. | 11383 // Compact the array by moving all subsequent groups to fill in the new holes. |
11382 for (int src = end, dst = start; src < code_entries; src++, dst++) { | 11384 for (int src = end, dst = start; src < code_entries; src++, dst++) { |
11383 copy(src, dst); | 11385 copy(src, dst); |
11384 } | 11386 } |
11385 // Now the holes are at the end of the array, zap them for heap-verifier. | 11387 // Now the holes are at the end of the array, zap them for heap-verifier. |
11386 int removed = end - start; | 11388 int removed = end - start; |
11387 for (int i = code_entries - removed; i < code_entries; i++) { | 11389 for (int i = code_entries - removed; i < code_entries; i++) { |
11388 clear_at(i); | 11390 clear_at(i); |
11389 } | 11391 } |
11390 set_number_of_entries(group, 0); | 11392 set_number_of_entries(group, 0); |
11391 Deoptimizer::DeoptimizeCodeList(isolate, &codes); | 11393 |
| 11394 if (marked) Deoptimizer::DeoptimizeMarkedCode(isolate); |
11392 } | 11395 } |
11393 | 11396 |
11394 | 11397 |
11395 Handle<Object> JSObject::SetPrototype(Handle<JSObject> object, | 11398 Handle<Object> JSObject::SetPrototype(Handle<JSObject> object, |
11396 Handle<Object> value, | 11399 Handle<Object> value, |
11397 bool skip_hidden_prototypes) { | 11400 bool skip_hidden_prototypes) { |
11398 #ifdef DEBUG | 11401 #ifdef DEBUG |
11399 int size = object->Size(); | 11402 int size = object->Size(); |
11400 #endif | 11403 #endif |
11401 | 11404 |
(...skipping 4583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15985 #define ERROR_MESSAGES_TEXTS(C, T) T, | 15988 #define ERROR_MESSAGES_TEXTS(C, T) T, |
15986 static const char* error_messages_[] = { | 15989 static const char* error_messages_[] = { |
15987 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 15990 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
15988 }; | 15991 }; |
15989 #undef ERROR_MESSAGES_TEXTS | 15992 #undef ERROR_MESSAGES_TEXTS |
15990 return error_messages_[reason]; | 15993 return error_messages_[reason]; |
15991 } | 15994 } |
15992 | 15995 |
15993 | 15996 |
15994 } } // namespace v8::internal | 15997 } } // namespace v8::internal |
OLD | NEW |