| 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 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 __ Push(pairs); | 773 __ Push(pairs); |
| 774 __ Push(Smi::FromInt(is_eval() ? 1 : 0)); | 774 __ Push(Smi::FromInt(is_eval() ? 1 : 0)); |
| 775 __ CallRuntime(Runtime::kDeclareGlobals, 3); | 775 __ CallRuntime(Runtime::kDeclareGlobals, 3); |
| 776 // Return value is ignored. | 776 // Return value is ignored. |
| 777 } | 777 } |
| 778 | 778 |
| 779 | 779 |
| 780 void FullCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) { | 780 void FullCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) { |
| 781 Comment cmnt(masm_, "[ FunctionLiteral"); | 781 Comment cmnt(masm_, "[ FunctionLiteral"); |
| 782 | 782 |
| 783 // Build the function boilerplate and instantiate it. | 783 // Build the shared function info and instantiate the function based |
| 784 // on it. |
| 784 Handle<SharedFunctionInfo> function_info = | 785 Handle<SharedFunctionInfo> function_info = |
| 785 Compiler::BuildFunctionInfo(expr, script(), this); | 786 Compiler::BuildFunctionInfo(expr, script(), this); |
| 786 if (HasStackOverflow()) return; | 787 if (HasStackOverflow()) return; |
| 787 | 788 |
| 788 // Create a new closure. | 789 // Create a new closure. |
| 789 __ push(rsi); | 790 __ push(rsi); |
| 790 __ Push(function_info); | 791 __ Push(function_info); |
| 791 __ CallRuntime(Runtime::kNewClosure, 2); | 792 __ CallRuntime(Runtime::kNewClosure, 2); |
| 792 Apply(context_, rax); | 793 Apply(context_, rax); |
| 793 } | 794 } |
| (...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1983 __ movq(Operand(rsp, 0), rdx); | 1984 __ movq(Operand(rsp, 0), rdx); |
| 1984 // And return. | 1985 // And return. |
| 1985 __ ret(0); | 1986 __ ret(0); |
| 1986 } | 1987 } |
| 1987 | 1988 |
| 1988 | 1989 |
| 1989 #undef __ | 1990 #undef __ |
| 1990 | 1991 |
| 1991 | 1992 |
| 1992 } } // namespace v8::internal | 1993 } } // namespace v8::internal |
| OLD | NEW |