| 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 9122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9133 void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) { | 9133 void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) { |
| 9134 // Iterate over all fields in the body but take care in dealing with | 9134 // Iterate over all fields in the body but take care in dealing with |
| 9135 // the code entry. | 9135 // the code entry. |
| 9136 IteratePointers(v, kPropertiesOffset, kCodeEntryOffset); | 9136 IteratePointers(v, kPropertiesOffset, kCodeEntryOffset); |
| 9137 v->VisitCodeEntry(this->address() + kCodeEntryOffset); | 9137 v->VisitCodeEntry(this->address() + kCodeEntryOffset); |
| 9138 IteratePointers(v, kCodeEntryOffset + kPointerSize, object_size); | 9138 IteratePointers(v, kCodeEntryOffset + kPointerSize, object_size); |
| 9139 } | 9139 } |
| 9140 | 9140 |
| 9141 | 9141 |
| 9142 void JSFunction::MarkForLazyRecompilation() { | 9142 void JSFunction::MarkForLazyRecompilation() { |
| 9143 ASSERT(is_compiled() && !IsOptimized()); | 9143 ASSERT(is_compiled() || GetIsolate()->debugger()->IsDebuggerActive()); |
| 9144 ASSERT(!IsOptimized()); |
| 9144 ASSERT(shared()->allows_lazy_compilation() || | 9145 ASSERT(shared()->allows_lazy_compilation() || |
| 9145 code()->optimizable()); | 9146 code()->optimizable()); |
| 9146 set_code_no_write_barrier( | 9147 set_code_no_write_barrier( |
| 9147 GetIsolate()->builtins()->builtin(Builtins::kLazyRecompile)); | 9148 GetIsolate()->builtins()->builtin(Builtins::kLazyRecompile)); |
| 9148 // No write barrier required, since the builtin is part of the root set. | 9149 // No write barrier required, since the builtin is part of the root set. |
| 9149 } | 9150 } |
| 9150 | 9151 |
| 9151 | 9152 |
| 9152 void JSFunction::MarkForParallelRecompilation() { | 9153 void JSFunction::MarkForParallelRecompilation() { |
| 9153 ASSERT(is_compiled() && !IsOptimized()); | 9154 ASSERT(is_compiled() || GetIsolate()->debugger()->IsDebuggerActive()); |
| 9155 ASSERT(!IsOptimized()); |
| 9154 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); | 9156 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); |
| 9155 if (!FLAG_parallel_recompilation) { | 9157 if (!FLAG_parallel_recompilation) { |
| 9156 JSFunction::MarkForLazyRecompilation(); | 9158 JSFunction::MarkForLazyRecompilation(); |
| 9157 return; | 9159 return; |
| 9158 } | 9160 } |
| 9159 if (FLAG_trace_parallel_recompilation) { | 9161 if (FLAG_trace_parallel_recompilation) { |
| 9160 PrintF(" ** Marking "); | 9162 PrintF(" ** Marking "); |
| 9161 PrintName(); | 9163 PrintName(); |
| 9162 PrintF(" for parallel recompilation.\n"); | 9164 PrintF(" for parallel recompilation.\n"); |
| 9163 } | 9165 } |
| 9164 set_code_no_write_barrier( | 9166 set_code_no_write_barrier( |
| 9165 GetIsolate()->builtins()->builtin(Builtins::kParallelRecompile)); | 9167 GetIsolate()->builtins()->builtin(Builtins::kParallelRecompile)); |
| 9166 // No write barrier required, since the builtin is part of the root set. | 9168 // No write barrier required, since the builtin is part of the root set. |
| 9167 } | 9169 } |
| 9168 | 9170 |
| 9169 | 9171 |
| 9170 void JSFunction::MarkForInstallingRecompiledCode() { | 9172 void JSFunction::MarkForInstallingRecompiledCode() { |
| 9171 ASSERT(is_compiled() && !IsOptimized()); | 9173 ASSERT(is_compiled() || GetIsolate()->debugger()->IsDebuggerActive()); |
| 9174 ASSERT(!IsOptimized()); |
| 9172 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); | 9175 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); |
| 9173 ASSERT(FLAG_parallel_recompilation); | 9176 ASSERT(FLAG_parallel_recompilation); |
| 9174 set_code_no_write_barrier( | 9177 set_code_no_write_barrier( |
| 9175 GetIsolate()->builtins()->builtin(Builtins::kInstallRecompiledCode)); | 9178 GetIsolate()->builtins()->builtin(Builtins::kInstallRecompiledCode)); |
| 9176 // No write barrier required, since the builtin is part of the root set. | 9179 // No write barrier required, since the builtin is part of the root set. |
| 9177 } | 9180 } |
| 9178 | 9181 |
| 9179 | 9182 |
| 9180 void JSFunction::MarkInRecompileQueue() { | 9183 void JSFunction::MarkInRecompileQueue() { |
| 9181 ASSERT(is_compiled() && !IsOptimized()); | 9184 ASSERT(is_compiled() || GetIsolate()->debugger()->IsDebuggerActive()); |
| 9185 ASSERT(!IsOptimized()); |
| 9182 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); | 9186 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); |
| 9183 ASSERT(FLAG_parallel_recompilation); | 9187 ASSERT(FLAG_parallel_recompilation); |
| 9184 if (FLAG_trace_parallel_recompilation) { | 9188 if (FLAG_trace_parallel_recompilation) { |
| 9185 PrintF(" ** Queueing "); | 9189 PrintF(" ** Queueing "); |
| 9186 PrintName(); | 9190 PrintName(); |
| 9187 PrintF(" for parallel recompilation.\n"); | 9191 PrintF(" for parallel recompilation.\n"); |
| 9188 } | 9192 } |
| 9189 set_code_no_write_barrier( | 9193 set_code_no_write_barrier( |
| 9190 GetIsolate()->builtins()->builtin(Builtins::kInRecompileQueue)); | 9194 GetIsolate()->builtins()->builtin(Builtins::kInRecompileQueue)); |
| 9191 // No write barrier required, since the builtin is part of the root set. | 9195 // No write barrier required, since the builtin is part of the root set. |
| (...skipping 6623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15815 | 15819 |
| 15816 void PropertyCell::AddDependentCode(Handle<Code> code) { | 15820 void PropertyCell::AddDependentCode(Handle<Code> code) { |
| 15817 Handle<DependentCode> codes = DependentCode::Insert( | 15821 Handle<DependentCode> codes = DependentCode::Insert( |
| 15818 Handle<DependentCode>(dependent_code()), | 15822 Handle<DependentCode>(dependent_code()), |
| 15819 DependentCode::kPropertyCellChangedGroup, code); | 15823 DependentCode::kPropertyCellChangedGroup, code); |
| 15820 if (*codes != dependent_code()) set_dependent_code(*codes); | 15824 if (*codes != dependent_code()) set_dependent_code(*codes); |
| 15821 } | 15825 } |
| 15822 | 15826 |
| 15823 | 15827 |
| 15824 } } // namespace v8::internal | 15828 } } // namespace v8::internal |
| OLD | NEW |