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 21 matching lines...) Expand all Loading... |
32 #include "arguments.h" | 32 #include "arguments.h" |
33 #include "bootstrapper.h" | 33 #include "bootstrapper.h" |
34 #include "codegen.h" | 34 #include "codegen.h" |
35 #include "debug.h" | 35 #include "debug.h" |
36 #include "deoptimizer.h" | 36 #include "deoptimizer.h" |
37 #include "date.h" | 37 #include "date.h" |
38 #include "elements.h" | 38 #include "elements.h" |
39 #include "execution.h" | 39 #include "execution.h" |
40 #include "full-codegen.h" | 40 #include "full-codegen.h" |
41 #include "hydrogen.h" | 41 #include "hydrogen.h" |
| 42 #include "isolate-inl.h" |
42 #include "objects-inl.h" | 43 #include "objects-inl.h" |
43 #include "objects-visiting.h" | 44 #include "objects-visiting.h" |
44 #include "objects-visiting-inl.h" | 45 #include "objects-visiting-inl.h" |
45 #include "macro-assembler.h" | 46 #include "macro-assembler.h" |
46 #include "mark-compact.h" | 47 #include "mark-compact.h" |
47 #include "safepoint-table.h" | 48 #include "safepoint-table.h" |
48 #include "string-stream.h" | 49 #include "string-stream.h" |
49 #include "utils.h" | 50 #include "utils.h" |
50 | 51 |
51 #ifdef ENABLE_DISASSEMBLER | 52 #ifdef ENABLE_DISASSEMBLER |
(...skipping 9081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9133 void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) { | 9134 void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) { |
9134 // Iterate over all fields in the body but take care in dealing with | 9135 // Iterate over all fields in the body but take care in dealing with |
9135 // the code entry. | 9136 // the code entry. |
9136 IteratePointers(v, kPropertiesOffset, kCodeEntryOffset); | 9137 IteratePointers(v, kPropertiesOffset, kCodeEntryOffset); |
9137 v->VisitCodeEntry(this->address() + kCodeEntryOffset); | 9138 v->VisitCodeEntry(this->address() + kCodeEntryOffset); |
9138 IteratePointers(v, kCodeEntryOffset + kPointerSize, object_size); | 9139 IteratePointers(v, kCodeEntryOffset + kPointerSize, object_size); |
9139 } | 9140 } |
9140 | 9141 |
9141 | 9142 |
9142 void JSFunction::MarkForLazyRecompilation() { | 9143 void JSFunction::MarkForLazyRecompilation() { |
9143 ASSERT(is_compiled() || GetIsolate()->debugger()->IsDebuggerActive()); | 9144 ASSERT(is_compiled() || GetIsolate()->DebuggerHasBreakPoints()); |
9144 ASSERT(!IsOptimized()); | 9145 ASSERT(!IsOptimized()); |
9145 ASSERT(shared()->allows_lazy_compilation() || | 9146 ASSERT(shared()->allows_lazy_compilation() || |
9146 code()->optimizable()); | 9147 code()->optimizable()); |
9147 set_code_no_write_barrier( | 9148 set_code_no_write_barrier( |
9148 GetIsolate()->builtins()->builtin(Builtins::kLazyRecompile)); | 9149 GetIsolate()->builtins()->builtin(Builtins::kLazyRecompile)); |
9149 // No write barrier required, since the builtin is part of the root set. | 9150 // No write barrier required, since the builtin is part of the root set. |
9150 } | 9151 } |
9151 | 9152 |
9152 | 9153 |
9153 void JSFunction::MarkForParallelRecompilation() { | 9154 void JSFunction::MarkForParallelRecompilation() { |
9154 ASSERT(is_compiled() || GetIsolate()->debugger()->IsDebuggerActive()); | 9155 ASSERT(is_compiled() || GetIsolate()->DebuggerHasBreakPoints()); |
9155 ASSERT(!IsOptimized()); | 9156 ASSERT(!IsOptimized()); |
9156 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); | 9157 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); |
9157 if (!FLAG_parallel_recompilation) { | 9158 if (!FLAG_parallel_recompilation) { |
9158 JSFunction::MarkForLazyRecompilation(); | 9159 JSFunction::MarkForLazyRecompilation(); |
9159 return; | 9160 return; |
9160 } | 9161 } |
9161 if (FLAG_trace_parallel_recompilation) { | 9162 if (FLAG_trace_parallel_recompilation) { |
9162 PrintF(" ** Marking "); | 9163 PrintF(" ** Marking "); |
9163 PrintName(); | 9164 PrintName(); |
9164 PrintF(" for parallel recompilation.\n"); | 9165 PrintF(" for parallel recompilation.\n"); |
9165 } | 9166 } |
9166 set_code_no_write_barrier( | 9167 set_code_no_write_barrier( |
9167 GetIsolate()->builtins()->builtin(Builtins::kParallelRecompile)); | 9168 GetIsolate()->builtins()->builtin(Builtins::kParallelRecompile)); |
9168 // No write barrier required, since the builtin is part of the root set. | 9169 // No write barrier required, since the builtin is part of the root set. |
9169 } | 9170 } |
9170 | 9171 |
9171 | 9172 |
9172 void JSFunction::MarkForInstallingRecompiledCode() { | 9173 void JSFunction::MarkForInstallingRecompiledCode() { |
9173 ASSERT(is_compiled() || GetIsolate()->debugger()->IsDebuggerActive()); | 9174 // The debugger could have switched the builtin to lazy compile. |
| 9175 // In that case, simply carry on. It will be dealt with later. |
| 9176 ASSERT(IsInRecompileQueue() || GetIsolate()->DebuggerHasBreakPoints()); |
9174 ASSERT(!IsOptimized()); | 9177 ASSERT(!IsOptimized()); |
9175 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); | 9178 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); |
9176 ASSERT(FLAG_parallel_recompilation); | 9179 ASSERT(FLAG_parallel_recompilation); |
9177 set_code_no_write_barrier( | 9180 set_code_no_write_barrier( |
9178 GetIsolate()->builtins()->builtin(Builtins::kInstallRecompiledCode)); | 9181 GetIsolate()->builtins()->builtin(Builtins::kInstallRecompiledCode)); |
9179 // No write barrier required, since the builtin is part of the root set. | 9182 // No write barrier required, since the builtin is part of the root set. |
9180 } | 9183 } |
9181 | 9184 |
9182 | 9185 |
9183 void JSFunction::MarkInRecompileQueue() { | 9186 void JSFunction::MarkInRecompileQueue() { |
9184 ASSERT(is_compiled() || GetIsolate()->debugger()->IsDebuggerActive()); | 9187 // We can only arrive here via the parallel-recompilation builtin. If |
9185 ASSERT(!IsOptimized()); | 9188 // break points were set, the code would point to the lazy-compile builtin. |
| 9189 ASSERT(!GetIsolate()->DebuggerHasBreakPoints()); |
| 9190 ASSERT(IsMarkedForParallelRecompilation() && !IsOptimized()); |
9186 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); | 9191 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); |
9187 ASSERT(FLAG_parallel_recompilation); | 9192 ASSERT(FLAG_parallel_recompilation); |
9188 if (FLAG_trace_parallel_recompilation) { | 9193 if (FLAG_trace_parallel_recompilation) { |
9189 PrintF(" ** Queueing "); | 9194 PrintF(" ** Queueing "); |
9190 PrintName(); | 9195 PrintName(); |
9191 PrintF(" for parallel recompilation.\n"); | 9196 PrintF(" for parallel recompilation.\n"); |
9192 } | 9197 } |
9193 set_code_no_write_barrier( | 9198 set_code_no_write_barrier( |
9194 GetIsolate()->builtins()->builtin(Builtins::kInRecompileQueue)); | 9199 GetIsolate()->builtins()->builtin(Builtins::kInRecompileQueue)); |
9195 // No write barrier required, since the builtin is part of the root set. | 9200 // 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... |
15819 | 15824 |
15820 void PropertyCell::AddDependentCode(Handle<Code> code) { | 15825 void PropertyCell::AddDependentCode(Handle<Code> code) { |
15821 Handle<DependentCode> codes = DependentCode::Insert( | 15826 Handle<DependentCode> codes = DependentCode::Insert( |
15822 Handle<DependentCode>(dependent_code()), | 15827 Handle<DependentCode>(dependent_code()), |
15823 DependentCode::kPropertyCellChangedGroup, code); | 15828 DependentCode::kPropertyCellChangedGroup, code); |
15824 if (*codes != dependent_code()) set_dependent_code(*codes); | 15829 if (*codes != dependent_code()) set_dependent_code(*codes); |
15825 } | 15830 } |
15826 | 15831 |
15827 | 15832 |
15828 } } // namespace v8::internal | 15833 } } // namespace v8::internal |
OLD | NEW |