| 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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 function boilerplate and instantiate it. |
| 784 Handle<JSFunction> boilerplate = | 784 Handle<SharedFunctionInfo> function_info = |
| 785 Compiler::BuildBoilerplate(expr, script(), this); | 785 Compiler::BuildFunctionInfo(expr, script(), this); |
| 786 if (HasStackOverflow()) return; | 786 if (HasStackOverflow()) return; |
| 787 | 787 |
| 788 ASSERT(boilerplate->IsBoilerplate()); | |
| 789 | |
| 790 // Create a new closure. | 788 // Create a new closure. |
| 791 __ push(rsi); | 789 __ push(rsi); |
| 792 __ Push(boilerplate); | 790 __ Push(function_info); |
| 793 __ CallRuntime(Runtime::kNewClosure, 2); | 791 __ CallRuntime(Runtime::kNewClosure, 2); |
| 794 Apply(context_, rax); | 792 Apply(context_, rax); |
| 795 } | 793 } |
| 796 | 794 |
| 797 | 795 |
| 798 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { | 796 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { |
| 799 Comment cmnt(masm_, "[ VariableProxy"); | 797 Comment cmnt(masm_, "[ VariableProxy"); |
| 800 EmitVariableLoad(expr->var(), context_); | 798 EmitVariableLoad(expr->var(), context_); |
| 801 } | 799 } |
| 802 | 800 |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1985 __ movq(Operand(rsp, 0), rdx); | 1983 __ movq(Operand(rsp, 0), rdx); |
| 1986 // And return. | 1984 // And return. |
| 1987 __ ret(0); | 1985 __ ret(0); |
| 1988 } | 1986 } |
| 1989 | 1987 |
| 1990 | 1988 |
| 1991 #undef __ | 1989 #undef __ |
| 1992 | 1990 |
| 1993 | 1991 |
| 1994 } } // namespace v8::internal | 1992 } } // namespace v8::internal |
| OLD | NEW |