| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/allocation-site-scopes.h" | 8 #include "src/allocation-site-scopes.h" |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
| (...skipping 9095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9106 | 9106 |
| 9107 | 9107 |
| 9108 void JSFunction::MarkForConcurrentOptimization() { | 9108 void JSFunction::MarkForConcurrentOptimization() { |
| 9109 DCHECK(is_compiled() || GetIsolate()->DebuggerHasBreakPoints()); | 9109 DCHECK(is_compiled() || GetIsolate()->DebuggerHasBreakPoints()); |
| 9110 DCHECK(!IsOptimized()); | 9110 DCHECK(!IsOptimized()); |
| 9111 DCHECK(shared()->allows_lazy_compilation() || code()->optimizable()); | 9111 DCHECK(shared()->allows_lazy_compilation() || code()->optimizable()); |
| 9112 DCHECK(!shared()->is_generator()); | 9112 DCHECK(!shared()->is_generator()); |
| 9113 DCHECK(GetIsolate()->concurrent_recompilation_enabled()); | 9113 DCHECK(GetIsolate()->concurrent_recompilation_enabled()); |
| 9114 if (FLAG_trace_concurrent_recompilation) { | 9114 if (FLAG_trace_concurrent_recompilation) { |
| 9115 PrintF(" ** Marking "); | 9115 PrintF(" ** Marking "); |
| 9116 PrintName(); | 9116 ShortPrint(); |
| 9117 PrintF(" for concurrent recompilation.\n"); | 9117 PrintF(" for concurrent recompilation.\n"); |
| 9118 } | 9118 } |
| 9119 set_code_no_write_barrier( | 9119 set_code_no_write_barrier( |
| 9120 GetIsolate()->builtins()->builtin(Builtins::kCompileOptimizedConcurrent)); | 9120 GetIsolate()->builtins()->builtin(Builtins::kCompileOptimizedConcurrent)); |
| 9121 // No write barrier required, since the builtin is part of the root set. | 9121 // No write barrier required, since the builtin is part of the root set. |
| 9122 } | 9122 } |
| 9123 | 9123 |
| 9124 | 9124 |
| 9125 void JSFunction::MarkInOptimizationQueue() { | 9125 void JSFunction::MarkInOptimizationQueue() { |
| 9126 // We can only arrive here via the concurrent-recompilation builtin. If | 9126 // We can only arrive here via the concurrent-recompilation builtin. If |
| 9127 // break points were set, the code would point to the lazy-compile builtin. | 9127 // break points were set, the code would point to the lazy-compile builtin. |
| 9128 DCHECK(!GetIsolate()->DebuggerHasBreakPoints()); | 9128 DCHECK(!GetIsolate()->DebuggerHasBreakPoints()); |
| 9129 DCHECK(IsMarkedForConcurrentOptimization() && !IsOptimized()); | 9129 DCHECK(IsMarkedForConcurrentOptimization() && !IsOptimized()); |
| 9130 DCHECK(shared()->allows_lazy_compilation() || code()->optimizable()); | 9130 DCHECK(shared()->allows_lazy_compilation() || code()->optimizable()); |
| 9131 DCHECK(GetIsolate()->concurrent_recompilation_enabled()); | 9131 DCHECK(GetIsolate()->concurrent_recompilation_enabled()); |
| 9132 if (FLAG_trace_concurrent_recompilation) { | 9132 if (FLAG_trace_concurrent_recompilation) { |
| 9133 PrintF(" ** Queueing "); | 9133 PrintF(" ** Queueing "); |
| 9134 PrintName(); | 9134 ShortPrint(); |
| 9135 PrintF(" for concurrent recompilation.\n"); | 9135 PrintF(" for concurrent recompilation.\n"); |
| 9136 } | 9136 } |
| 9137 set_code_no_write_barrier( | 9137 set_code_no_write_barrier( |
| 9138 GetIsolate()->builtins()->builtin(Builtins::kInOptimizationQueue)); | 9138 GetIsolate()->builtins()->builtin(Builtins::kInOptimizationQueue)); |
| 9139 // No write barrier required, since the builtin is part of the root set. | 9139 // No write barrier required, since the builtin is part of the root set. |
| 9140 } | 9140 } |
| 9141 | 9141 |
| 9142 | 9142 |
| 9143 Handle<JSFunction> JSFunction::CloneClosure(Handle<JSFunction> function) { | 9143 Handle<JSFunction> JSFunction::CloneClosure(Handle<JSFunction> function) { |
| 9144 Isolate* isolate = function->GetIsolate(); | 9144 Isolate* isolate = function->GetIsolate(); |
| (...skipping 7208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16353 CompilationInfo* info) { | 16353 CompilationInfo* info) { |
| 16354 Handle<DependentCode> codes = | 16354 Handle<DependentCode> codes = |
| 16355 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16355 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
| 16356 DependentCode::kPropertyCellChangedGroup, | 16356 DependentCode::kPropertyCellChangedGroup, |
| 16357 info->object_wrapper()); | 16357 info->object_wrapper()); |
| 16358 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16358 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
| 16359 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16359 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
| 16360 cell, info->zone()); | 16360 cell, info->zone()); |
| 16361 } | 16361 } |
| 16362 | 16362 |
| 16363 | |
| 16364 const char* GetBailoutReason(BailoutReason reason) { | |
| 16365 DCHECK(reason < kLastErrorMessage); | |
| 16366 #define ERROR_MESSAGES_TEXTS(C, T) T, | |
| 16367 static const char* error_messages_[] = { | |
| 16368 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | |
| 16369 }; | |
| 16370 #undef ERROR_MESSAGES_TEXTS | |
| 16371 return error_messages_[reason]; | |
| 16372 } | |
| 16373 | |
| 16374 | |
| 16375 } } // namespace v8::internal | 16363 } } // namespace v8::internal |
| OLD | NEW |