OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 return false; | 669 return false; |
670 } | 670 } |
671 | 671 |
672 | 672 |
673 Handle<SharedFunctionInfo> Compiler::BuildFunctionInfo(FunctionLiteral* literal, | 673 Handle<SharedFunctionInfo> Compiler::BuildFunctionInfo(FunctionLiteral* literal, |
674 Handle<Script> script) { | 674 Handle<Script> script) { |
675 // Precondition: code has been parsed and scopes have been analyzed. | 675 // Precondition: code has been parsed and scopes have been analyzed. |
676 CompilationInfo info(script); | 676 CompilationInfo info(script); |
677 info.SetFunction(literal); | 677 info.SetFunction(literal); |
678 info.SetScope(literal->scope()); | 678 info.SetScope(literal->scope()); |
| 679 if (literal->scope()->is_strict_mode()) info.MarkAsStrictMode(); |
679 | 680 |
680 LiveEditFunctionTracker live_edit_tracker(info.isolate(), literal); | 681 LiveEditFunctionTracker live_edit_tracker(info.isolate(), literal); |
681 // Determine if the function can be lazily compiled. This is necessary to | 682 // Determine if the function can be lazily compiled. This is necessary to |
682 // allow some of our builtin JS files to be lazily compiled. These | 683 // allow some of our builtin JS files to be lazily compiled. These |
683 // builtins cannot be handled lazily by the parser, since we have to know | 684 // builtins cannot be handled lazily by the parser, since we have to know |
684 // if a function uses the special natives syntax, which is something the | 685 // if a function uses the special natives syntax, which is something the |
685 // parser records. | 686 // parser records. |
686 bool allow_lazy = literal->AllowsLazyCompilation() && | 687 bool allow_lazy = literal->AllowsLazyCompilation() && |
687 !LiveEditFunctionTracker::IsActive(info.isolate()); | 688 !LiveEditFunctionTracker::IsActive(info.isolate()); |
688 | 689 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 shared->DebugName())); | 777 shared->DebugName())); |
777 } | 778 } |
778 } | 779 } |
779 | 780 |
780 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 781 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
781 Handle<Script>(info->script()), | 782 Handle<Script>(info->script()), |
782 Handle<Code>(info->code()))); | 783 Handle<Code>(info->code()))); |
783 } | 784 } |
784 | 785 |
785 } } // namespace v8::internal | 786 } } // namespace v8::internal |
OLD | NEW |