OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/isolate.h" | 5 #include "src/isolate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 2803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2814 Context* current_context = Context::cast(context); | 2814 Context* current_context = Context::cast(context); |
2815 if (current_context->initial_object_prototype() == object || | 2815 if (current_context->initial_object_prototype() == object || |
2816 current_context->initial_array_prototype() == object) { | 2816 current_context->initial_array_prototype() == object) { |
2817 return true; | 2817 return true; |
2818 } | 2818 } |
2819 context = current_context->next_context_link(); | 2819 context = current_context->next_context_link(); |
2820 } | 2820 } |
2821 return false; | 2821 return false; |
2822 } | 2822 } |
2823 | 2823 |
| 2824 void Isolate::ClearOSROptimizedCode() { |
| 2825 DisallowHeapAllocation no_gc; |
| 2826 Object* context = heap()->native_contexts_list(); |
| 2827 while (!context->IsUndefined(this)) { |
| 2828 Context* current_context = Context::cast(context); |
| 2829 current_context->ClearOptimizedCodeMap(); |
| 2830 context = current_context->next_context_link(); |
| 2831 } |
| 2832 } |
| 2833 |
| 2834 void Isolate::EvictOSROptimizedCode(Code* code, const char* reason) { |
| 2835 DisallowHeapAllocation no_gc; |
| 2836 Object* context = heap()->native_contexts_list(); |
| 2837 while (!context->IsUndefined(this)) { |
| 2838 Context* current_context = Context::cast(context); |
| 2839 current_context->EvictFromOptimizedCodeMap(code, reason); |
| 2840 context = current_context->next_context_link(); |
| 2841 } |
| 2842 } |
| 2843 |
2824 bool Isolate::IsInAnyContext(Object* object, uint32_t index) { | 2844 bool Isolate::IsInAnyContext(Object* object, uint32_t index) { |
2825 DisallowHeapAllocation no_gc; | 2845 DisallowHeapAllocation no_gc; |
2826 Object* context = heap()->native_contexts_list(); | 2846 Object* context = heap()->native_contexts_list(); |
2827 while (!context->IsUndefined(this)) { | 2847 while (!context->IsUndefined(this)) { |
2828 Context* current_context = Context::cast(context); | 2848 Context* current_context = Context::cast(context); |
2829 if (current_context->get(index) == object) { | 2849 if (current_context->get(index) == object) { |
2830 return true; | 2850 return true; |
2831 } | 2851 } |
2832 context = current_context->next_context_link(); | 2852 context = current_context->next_context_link(); |
2833 } | 2853 } |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3516 // Then check whether this scope intercepts. | 3536 // Then check whether this scope intercepts. |
3517 if ((flag & intercept_mask_)) { | 3537 if ((flag & intercept_mask_)) { |
3518 intercepted_flags_ |= flag; | 3538 intercepted_flags_ |= flag; |
3519 return true; | 3539 return true; |
3520 } | 3540 } |
3521 return false; | 3541 return false; |
3522 } | 3542 } |
3523 | 3543 |
3524 } // namespace internal | 3544 } // namespace internal |
3525 } // namespace v8 | 3545 } // namespace v8 |
OLD | NEW |