OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 3580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3591 // function and let it refer to the function itself (closure). | 3591 // function and let it refer to the function itself (closure). |
3592 // NOTE: We create a proxy and resolve it here so that in the | 3592 // NOTE: We create a proxy and resolve it here so that in the |
3593 // future we can change the AST to only refer to VariableProxies | 3593 // future we can change the AST to only refer to VariableProxies |
3594 // instead of Variables and Proxis as is the case now. | 3594 // instead of Variables and Proxis as is the case now. |
3595 if (!function_name.is_null() && function_name->length() > 0) { | 3595 if (!function_name.is_null() && function_name->length() > 0) { |
3596 Variable* fvar = top_scope_->DeclareFunctionVar(function_name); | 3596 Variable* fvar = top_scope_->DeclareFunctionVar(function_name); |
3597 VariableProxy* fproxy = | 3597 VariableProxy* fproxy = |
3598 top_scope_->NewUnresolved(function_name, inside_with()); | 3598 top_scope_->NewUnresolved(function_name, inside_with()); |
3599 fproxy->BindTo(fvar); | 3599 fproxy->BindTo(fvar); |
3600 body.Add(new ExpressionStatement( | 3600 body.Add(new ExpressionStatement( |
3601 new Assignment(Token::INIT_VAR, fproxy, | 3601 new Assignment(Token::INIT_CONST, fproxy, |
3602 NEW(ThisFunction()), | 3602 NEW(ThisFunction()), |
3603 RelocInfo::kNoPosition))); | 3603 RelocInfo::kNoPosition))); |
3604 } | 3604 } |
3605 | 3605 |
3606 // Determine if the function will be lazily compiled. The mode can | 3606 // Determine if the function will be lazily compiled. The mode can |
3607 // only be PARSE_LAZILY if the --lazy flag is true. | 3607 // only be PARSE_LAZILY if the --lazy flag is true. |
3608 bool is_lazily_compiled = | 3608 bool is_lazily_compiled = |
3609 mode() == PARSE_LAZILY && top_scope_->HasTrivialOuterContext(); | 3609 mode() == PARSE_LAZILY && top_scope_->HasTrivialOuterContext(); |
3610 | 3610 |
3611 int materialized_literal_count; | 3611 int materialized_literal_count; |
(...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4801 start_position, | 4801 start_position, |
4802 is_expression); | 4802 is_expression); |
4803 return result; | 4803 return result; |
4804 } | 4804 } |
4805 | 4805 |
4806 | 4806 |
4807 #undef NEW | 4807 #undef NEW |
4808 | 4808 |
4809 | 4809 |
4810 } } // namespace v8::internal | 4810 } } // namespace v8::internal |
OLD | NEW |