| 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 9562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9573 FixedArray* literals) { | 9573 FixedArray* literals) { |
| 9574 ASSERT(code->kind() == Code::OPTIMIZED_FUNCTION); | 9574 ASSERT(code->kind() == Code::OPTIMIZED_FUNCTION); |
| 9575 ASSERT(native_context->IsNativeContext()); | 9575 ASSERT(native_context->IsNativeContext()); |
| 9576 STATIC_ASSERT(kEntryLength == 3); | 9576 STATIC_ASSERT(kEntryLength == 3); |
| 9577 Heap* heap = GetHeap(); | 9577 Heap* heap = GetHeap(); |
| 9578 FixedArray* new_code_map; | 9578 FixedArray* new_code_map; |
| 9579 Object* value = optimized_code_map(); | 9579 Object* value = optimized_code_map(); |
| 9580 if (value->IsSmi()) { | 9580 if (value->IsSmi()) { |
| 9581 // No optimized code map. | 9581 // No optimized code map. |
| 9582 ASSERT_EQ(0, Smi::cast(value)->value()); | 9582 ASSERT_EQ(0, Smi::cast(value)->value()); |
| 9583 // Crate 3 entries per context {context, code, literals}. | 9583 // Create 3 entries per context {context, code, literals}. |
| 9584 MaybeObject* maybe = heap->AllocateFixedArray(kInitialLength); | 9584 MaybeObject* maybe = heap->AllocateFixedArray(kInitialLength); |
| 9585 if (!maybe->To(&new_code_map)) return maybe; | 9585 if (!maybe->To(&new_code_map)) return maybe; |
| 9586 new_code_map->set(kEntriesStart + 0, native_context); | 9586 new_code_map->set(kEntriesStart + 0, native_context); |
| 9587 new_code_map->set(kEntriesStart + 1, code); | 9587 new_code_map->set(kEntriesStart + 1, code); |
| 9588 new_code_map->set(kEntriesStart + 2, literals); | 9588 new_code_map->set(kEntriesStart + 2, literals); |
| 9589 } else { | 9589 } else { |
| 9590 // Copy old map and append one new entry. | 9590 // Copy old map and append one new entry. |
| 9591 FixedArray* old_code_map = FixedArray::cast(value); | 9591 FixedArray* old_code_map = FixedArray::cast(value); |
| 9592 ASSERT_EQ(-1, SearchOptimizedCodeMap(native_context)); | 9592 ASSERT_EQ(-1, SearchOptimizedCodeMap(native_context)); |
| 9593 int old_length = old_code_map->length(); | 9593 int old_length = old_code_map->length(); |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10224 code()->ClearInlineCaches(); | 10224 code()->ClearInlineCaches(); |
| 10225 set_ic_age(new_ic_age); | 10225 set_ic_age(new_ic_age); |
| 10226 if (code()->kind() == Code::FUNCTION) { | 10226 if (code()->kind() == Code::FUNCTION) { |
| 10227 code()->set_profiler_ticks(0); | 10227 code()->set_profiler_ticks(0); |
| 10228 if (optimization_disabled() && | 10228 if (optimization_disabled() && |
| 10229 opt_count() >= FLAG_max_opt_count) { | 10229 opt_count() >= FLAG_max_opt_count) { |
| 10230 // Re-enable optimizations if they were disabled due to opt_count limit. | 10230 // Re-enable optimizations if they were disabled due to opt_count limit. |
| 10231 set_optimization_disabled(false); | 10231 set_optimization_disabled(false); |
| 10232 code()->set_optimizable(true); | 10232 code()->set_optimizable(true); |
| 10233 } | 10233 } |
| 10234 set_opt_count(0); | |
| 10235 set_deopt_count(0); | |
| 10236 } | 10234 } |
| 10235 set_opt_count(0); |
| 10236 set_deopt_count(0); |
| 10237 } | 10237 } |
| 10238 | 10238 |
| 10239 | 10239 |
| 10240 static void GetMinInobjectSlack(Map* map, void* data) { | 10240 static void GetMinInobjectSlack(Map* map, void* data) { |
| 10241 int slack = map->unused_property_fields(); | 10241 int slack = map->unused_property_fields(); |
| 10242 if (*reinterpret_cast<int*>(data) > slack) { | 10242 if (*reinterpret_cast<int*>(data) > slack) { |
| 10243 *reinterpret_cast<int*>(data) = slack; | 10243 *reinterpret_cast<int*>(data) = slack; |
| 10244 } | 10244 } |
| 10245 } | 10245 } |
| 10246 | 10246 |
| (...skipping 6239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16486 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16486 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 16487 static const char* error_messages_[] = { | 16487 static const char* error_messages_[] = { |
| 16488 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16488 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 16489 }; | 16489 }; |
| 16490 #undef ERROR_MESSAGES_TEXTS | 16490 #undef ERROR_MESSAGES_TEXTS |
| 16491 return error_messages_[reason]; | 16491 return error_messages_[reason]; |
| 16492 } | 16492 } |
| 16493 | 16493 |
| 16494 | 16494 |
| 16495 } } // namespace v8::internal | 16495 } } // namespace v8::internal |
| OLD | NEW |