| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 // since we have to know if a function uses the special natives | 487 // since we have to know if a function uses the special natives |
| 488 // syntax, which is something the parser records. | 488 // syntax, which is something the parser records. |
| 489 bool allow_lazy = literal->AllowsLazyCompilation() && | 489 bool allow_lazy = literal->AllowsLazyCompilation() && |
| 490 !LiveEditFunctionTracker::IsActive(); | 490 !LiveEditFunctionTracker::IsActive(); |
| 491 | 491 |
| 492 Handle<SerializedScopeInfo> scope_info(SerializedScopeInfo::Empty()); | 492 Handle<SerializedScopeInfo> scope_info(SerializedScopeInfo::Empty()); |
| 493 | 493 |
| 494 // Generate code | 494 // Generate code |
| 495 Handle<Code> code; | 495 Handle<Code> code; |
| 496 if (FLAG_lazy && allow_lazy) { | 496 if (FLAG_lazy && allow_lazy) { |
| 497 code = ComputeLazyCompile(literal->num_parameters()); | 497 code = Handle<Code>(Builtins::builtin(Builtins::LazyCompile)); |
| 498 } else { | 498 } else { |
| 499 // The bodies of function literals have not yet been visited by | 499 // The bodies of function literals have not yet been visited by |
| 500 // the AST optimizer/analyzer. | 500 // the AST optimizer/analyzer. |
| 501 if (!Rewriter::Optimize(literal)) { | 501 if (!Rewriter::Optimize(literal)) { |
| 502 return Handle<SharedFunctionInfo>::null(); | 502 return Handle<SharedFunctionInfo>::null(); |
| 503 } | 503 } |
| 504 | 504 |
| 505 if (literal->scope()->num_parameters() > 0 || | 505 if (literal->scope()->num_parameters() > 0 || |
| 506 literal->scope()->num_stack_slots()) { | 506 literal->scope()->num_stack_slots()) { |
| 507 AssignedVariablesAnalyzer ava(literal); | 507 AssignedVariablesAnalyzer ava(literal); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 PROFILE(CodeCreateEvent(Logger::ToNativeByScript(tag, *script), | 645 PROFILE(CodeCreateEvent(Logger::ToNativeByScript(tag, *script), |
| 646 *code, *func_name)); | 646 *code, *func_name)); |
| 647 OPROFILE(CreateNativeCodeRegion(*func_name, | 647 OPROFILE(CreateNativeCodeRegion(*func_name, |
| 648 code->instruction_start(), | 648 code->instruction_start(), |
| 649 code->instruction_size())); | 649 code->instruction_size())); |
| 650 } | 650 } |
| 651 } | 651 } |
| 652 } | 652 } |
| 653 | 653 |
| 654 } } // namespace v8::internal | 654 } } // namespace v8::internal |
| OLD | NEW |