Chromium Code Reviews| 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 7961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7972 | 7972 |
| 7973 | 7973 |
| 7974 void JSFunction::MarkForLazyRecompilation() { | 7974 void JSFunction::MarkForLazyRecompilation() { |
| 7975 ASSERT(is_compiled() && !IsOptimized()); | 7975 ASSERT(is_compiled() && !IsOptimized()); |
| 7976 ASSERT(shared()->allows_lazy_compilation() || | 7976 ASSERT(shared()->allows_lazy_compilation() || |
| 7977 code()->optimizable()); | 7977 code()->optimizable()); |
| 7978 Builtins* builtins = GetIsolate()->builtins(); | 7978 Builtins* builtins = GetIsolate()->builtins(); |
| 7979 ReplaceCode(builtins->builtin(Builtins::kLazyRecompile)); | 7979 ReplaceCode(builtins->builtin(Builtins::kLazyRecompile)); |
| 7980 } | 7980 } |
| 7981 | 7981 |
| 7982 | |
| 7982 void JSFunction::MarkForParallelRecompilation() { | 7983 void JSFunction::MarkForParallelRecompilation() { |
| 7983 ASSERT(is_compiled() && !IsOptimized()); | 7984 ASSERT(is_compiled() && !IsOptimized()); |
| 7984 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); | 7985 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); |
| 7986 ASSERT(FLAG_parallel_recompilation); | |
| 7987 if (FLAG_trace_parallel_recompilation) { | |
| 7988 PrintF(" ** Marking "); | |
| 7989 PrintName(); | |
| 7990 PrintF(" for parallel recompilation.\n"); | |
| 7991 } | |
| 7985 Builtins* builtins = GetIsolate()->builtins(); | 7992 Builtins* builtins = GetIsolate()->builtins(); |
| 7986 ReplaceCode(builtins->builtin(Builtins::kParallelRecompile)); | 7993 ReplaceCode(builtins->builtin(Builtins::kParallelRecompile)); |
| 7994 } | |
| 7987 | 7995 |
| 7988 // Unlike MarkForLazyRecompilation, after queuing a function for | 7996 |
| 7989 // recompilation on the compiler thread, we actually tail-call into | 7997 void JSFunction::MarkForInstallingRecompiledCode() { |
| 7990 // the full code. We reset the profiler ticks here so that the | 7998 ASSERT(is_compiled() && !IsOptimized()); |
| 7991 // function doesn't bother the runtime profiler too much. | 7999 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); |
| 7992 shared()->code()->set_profiler_ticks(0); | 8000 ASSERT(FLAG_parallel_recompilation); |
| 8001 set_code_no_write_barrier( | |
| 8002 GetIsolate()->builtins()->builtin(Builtins::kInstallRecompiledCode)); | |
| 8003 // No write barrier required, since the builtin is part of the root set. | |
|
Jakob Kummerow
2013/03/12 15:19:30
Since this is true for all builtins, please update
Yang
2013/03/12 18:03:38
Done.
| |
| 7993 } | 8004 } |
| 7994 | 8005 |
| 8006 | |
| 8007 void JSFunction::MarkInRecompileQueue() { | |
| 8008 ASSERT(is_compiled() && !IsOptimized()); | |
| 8009 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable()); | |
| 8010 ASSERT(FLAG_parallel_recompilation); | |
| 8011 if (FLAG_trace_parallel_recompilation) { | |
| 8012 PrintF(" ** Queueing "); | |
| 8013 PrintName(); | |
| 8014 PrintF(" for parallel recompilation.\n"); | |
| 8015 } | |
| 8016 Builtins* builtins = GetIsolate()->builtins(); | |
| 8017 ReplaceCode(builtins->builtin(Builtins::kInRecompileQueue)); | |
| 8018 } | |
| 8019 | |
| 8020 | |
| 7995 static bool CompileLazyHelper(CompilationInfo* info, | 8021 static bool CompileLazyHelper(CompilationInfo* info, |
| 7996 ClearExceptionFlag flag) { | 8022 ClearExceptionFlag flag) { |
| 7997 // Compile the source information to a code object. | 8023 // Compile the source information to a code object. |
| 7998 ASSERT(info->IsOptimizing() || !info->shared_info()->is_compiled()); | 8024 ASSERT(info->IsOptimizing() || !info->shared_info()->is_compiled()); |
| 7999 ASSERT(!info->isolate()->has_pending_exception()); | 8025 ASSERT(!info->isolate()->has_pending_exception()); |
| 8000 bool result = Compiler::CompileLazy(info); | 8026 bool result = Compiler::CompileLazy(info); |
| 8001 ASSERT(result != Isolate::Current()->has_pending_exception()); | 8027 ASSERT(result != Isolate::Current()->has_pending_exception()); |
| 8002 if (!result && flag == CLEAR_EXCEPTION) { | 8028 if (!result && flag == CLEAR_EXCEPTION) { |
| 8003 info->isolate()->clear_pending_exception(); | 8029 info->isolate()->clear_pending_exception(); |
| 8004 } | 8030 } |
| (...skipping 6274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14279 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 14305 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
| 14280 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 14306 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
| 14281 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 14307 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
| 14282 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 14308 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
| 14283 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 14309 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
| 14284 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 14310 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
| 14285 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 14311 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
| 14286 } | 14312 } |
| 14287 | 14313 |
| 14288 } } // namespace v8::internal | 14314 } } // namespace v8::internal |
| OLD | NEW |