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 7962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7973 IteratePointers(v, kPropertiesOffset, kCodeEntryOffset); | 7973 IteratePointers(v, kPropertiesOffset, kCodeEntryOffset); |
7974 v->VisitCodeEntry(this->address() + kCodeEntryOffset); | 7974 v->VisitCodeEntry(this->address() + kCodeEntryOffset); |
7975 IteratePointers(v, kCodeEntryOffset + kPointerSize, object_size); | 7975 IteratePointers(v, kCodeEntryOffset + kPointerSize, object_size); |
7976 } | 7976 } |
7977 | 7977 |
7978 | 7978 |
7979 void JSFunction::MarkForLazyRecompilation() { | 7979 void JSFunction::MarkForLazyRecompilation() { |
7980 ASSERT(is_compiled() && !IsOptimized()); | 7980 ASSERT(is_compiled() && !IsOptimized()); |
7981 ASSERT(shared()->allows_lazy_compilation() || | 7981 ASSERT(shared()->allows_lazy_compilation() || |
7982 code()->optimizable()); | 7982 code()->optimizable()); |
7983 Builtins* builtins = GetIsolate()->builtins(); | 7983 set_code_no_write_barrier( |
7984 ReplaceCode(builtins->builtin(Builtins::kLazyRecompile)); | 7984 GetIsolate()->builtins()->builtin(Builtins::kLazyRecompile)); |
| 7985 // No write barrier required, since the builtin is part of the root set. |
7985 } | 7986 } |
7986 | 7987 |
| 7988 |
7987 void JSFunction::MarkForParallelRecompilation() { | 7989 void JSFunction::MarkForParallelRecompilation() { |
7988 ASSERT(is_compiled() && !IsOptimized()); | 7990 ASSERT(is_compiled() && !IsOptimized()); |
7989 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); | 7991 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); |
7990 Builtins* builtins = GetIsolate()->builtins(); | 7992 ASSERT(FLAG_parallel_recompilation); |
7991 ReplaceCode(builtins->builtin(Builtins::kParallelRecompile)); | 7993 if (FLAG_trace_parallel_recompilation) { |
| 7994 PrintF(" ** Marking "); |
| 7995 PrintName(); |
| 7996 PrintF(" for parallel recompilation.\n"); |
| 7997 } |
| 7998 set_code_no_write_barrier( |
| 7999 GetIsolate()->builtins()->builtin(Builtins::kParallelRecompile)); |
| 8000 // No write barrier required, since the builtin is part of the root set. |
| 8001 } |
7992 | 8002 |
7993 // Unlike MarkForLazyRecompilation, after queuing a function for | 8003 |
7994 // recompilation on the compiler thread, we actually tail-call into | 8004 void JSFunction::MarkForInstallingRecompiledCode() { |
7995 // the full code. We reset the profiler ticks here so that the | 8005 ASSERT(is_compiled() && !IsOptimized()); |
7996 // function doesn't bother the runtime profiler too much. | 8006 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); |
7997 shared()->code()->set_profiler_ticks(0); | 8007 ASSERT(FLAG_parallel_recompilation); |
| 8008 set_code_no_write_barrier( |
| 8009 GetIsolate()->builtins()->builtin(Builtins::kInstallRecompiledCode)); |
| 8010 // No write barrier required, since the builtin is part of the root set. |
7998 } | 8011 } |
7999 | 8012 |
| 8013 |
| 8014 void JSFunction::MarkInRecompileQueue() { |
| 8015 ASSERT(is_compiled() && !IsOptimized()); |
| 8016 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); |
| 8017 ASSERT(FLAG_parallel_recompilation); |
| 8018 if (FLAG_trace_parallel_recompilation) { |
| 8019 PrintF(" ** Queueing "); |
| 8020 PrintName(); |
| 8021 PrintF(" for parallel recompilation.\n"); |
| 8022 } |
| 8023 set_code_no_write_barrier( |
| 8024 GetIsolate()->builtins()->builtin(Builtins::kInRecompileQueue)); |
| 8025 // No write barrier required, since the builtin is part of the root set. |
| 8026 } |
| 8027 |
| 8028 |
8000 static bool CompileLazyHelper(CompilationInfo* info, | 8029 static bool CompileLazyHelper(CompilationInfo* info, |
8001 ClearExceptionFlag flag) { | 8030 ClearExceptionFlag flag) { |
8002 // Compile the source information to a code object. | 8031 // Compile the source information to a code object. |
8003 ASSERT(info->IsOptimizing() || !info->shared_info()->is_compiled()); | 8032 ASSERT(info->IsOptimizing() || !info->shared_info()->is_compiled()); |
8004 ASSERT(!info->isolate()->has_pending_exception()); | 8033 ASSERT(!info->isolate()->has_pending_exception()); |
8005 bool result = Compiler::CompileLazy(info); | 8034 bool result = Compiler::CompileLazy(info); |
8006 ASSERT(result != Isolate::Current()->has_pending_exception()); | 8035 ASSERT(result != Isolate::Current()->has_pending_exception()); |
8007 if (!result && flag == CLEAR_EXCEPTION) { | 8036 if (!result && flag == CLEAR_EXCEPTION) { |
8008 info->isolate()->clear_pending_exception(); | 8037 info->isolate()->clear_pending_exception(); |
8009 } | 8038 } |
(...skipping 6286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14296 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 14325 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
14297 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 14326 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
14298 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 14327 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
14299 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 14328 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
14300 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 14329 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
14301 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 14330 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
14302 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 14331 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
14303 } | 14332 } |
14304 | 14333 |
14305 } } // namespace v8::internal | 14334 } } // namespace v8::internal |
OLD | NEW |