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 9446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9457 } else { | 9457 } else { |
9458 ASSERT(function->shared()->allows_lazy_compilation()); | 9458 ASSERT(function->shared()->allows_lazy_compilation()); |
9459 CompilationInfoWithZone info(function); | 9459 CompilationInfoWithZone info(function); |
9460 result = CompileLazyHelper(&info, flag); | 9460 result = CompileLazyHelper(&info, flag); |
9461 ASSERT(!result || function->is_compiled()); | 9461 ASSERT(!result || function->is_compiled()); |
9462 } | 9462 } |
9463 return result; | 9463 return result; |
9464 } | 9464 } |
9465 | 9465 |
9466 | 9466 |
| 9467 Handle<Code> JSFunction::CompileOsr(Handle<JSFunction> function, |
| 9468 BailoutId osr_ast_id, |
| 9469 ClearExceptionFlag flag) { |
| 9470 CompilationInfoWithZone info(function); |
| 9471 info.SetOptimizing(osr_ast_id); |
| 9472 if (CompileLazyHelper(&info, flag)) { |
| 9473 ASSERT(function->code() != *info.code()); |
| 9474 return info.code(); |
| 9475 } else { |
| 9476 return Handle<Code>::null(); |
| 9477 } |
| 9478 } |
| 9479 |
| 9480 |
9467 bool JSFunction::CompileOptimized(Handle<JSFunction> function, | 9481 bool JSFunction::CompileOptimized(Handle<JSFunction> function, |
9468 BailoutId osr_ast_id, | |
9469 ClearExceptionFlag flag) { | 9482 ClearExceptionFlag flag) { |
9470 CompilationInfoWithZone info(function); | 9483 CompilationInfoWithZone info(function); |
9471 info.SetOptimizing(osr_ast_id); | 9484 info.SetOptimizing(BailoutId::None()); |
9472 return CompileLazyHelper(&info, flag); | 9485 return CompileLazyHelper(&info, flag); |
9473 } | 9486 } |
9474 | 9487 |
9475 | 9488 |
9476 bool JSFunction::EnsureCompiled(Handle<JSFunction> function, | 9489 bool JSFunction::EnsureCompiled(Handle<JSFunction> function, |
9477 ClearExceptionFlag flag) { | 9490 ClearExceptionFlag flag) { |
9478 return function->is_compiled() || CompileLazy(function, flag); | 9491 return function->is_compiled() || CompileLazy(function, flag); |
9479 } | 9492 } |
9480 | 9493 |
9481 | 9494 |
(...skipping 6490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15972 | 15985 |
15973 void PropertyCell::AddDependentCode(Handle<Code> code) { | 15986 void PropertyCell::AddDependentCode(Handle<Code> code) { |
15974 Handle<DependentCode> codes = DependentCode::Insert( | 15987 Handle<DependentCode> codes = DependentCode::Insert( |
15975 Handle<DependentCode>(dependent_code()), | 15988 Handle<DependentCode>(dependent_code()), |
15976 DependentCode::kPropertyCellChangedGroup, code); | 15989 DependentCode::kPropertyCellChangedGroup, code); |
15977 if (*codes != dependent_code()) set_dependent_code(*codes); | 15990 if (*codes != dependent_code()) set_dependent_code(*codes); |
15978 } | 15991 } |
15979 | 15992 |
15980 | 15993 |
15981 } } // namespace v8::internal | 15994 } } // namespace v8::internal |
OLD | NEW |