OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/parser.h" | 5 #include "src/parser.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast.h" | 8 #include "src/ast.h" |
9 #include "src/ast-literal-reindexer.h" | 9 #include "src/ast-literal-reindexer.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 4713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4724 } | 4724 } |
4725 VariableMode fvar_mode = use_strict_const ? CONST : CONST_LEGACY; | 4725 VariableMode fvar_mode = use_strict_const ? CONST : CONST_LEGACY; |
4726 Variable* fvar = new (zone()) | 4726 Variable* fvar = new (zone()) |
4727 Variable(scope_, function_name, fvar_mode, Variable::NORMAL, | 4727 Variable(scope_, function_name, fvar_mode, Variable::NORMAL, |
4728 kCreatedInitialized, kNotAssigned); | 4728 kCreatedInitialized, kNotAssigned); |
4729 VariableProxy* proxy = factory()->NewVariableProxy(fvar); | 4729 VariableProxy* proxy = factory()->NewVariableProxy(fvar); |
4730 VariableDeclaration* fvar_declaration = factory()->NewVariableDeclaration( | 4730 VariableDeclaration* fvar_declaration = factory()->NewVariableDeclaration( |
4731 proxy, fvar_mode, scope_, RelocInfo::kNoPosition); | 4731 proxy, fvar_mode, scope_, RelocInfo::kNoPosition); |
4732 scope_->DeclareFunctionVar(fvar_declaration); | 4732 scope_->DeclareFunctionVar(fvar_declaration); |
4733 | 4733 |
4734 VariableProxy* fproxy = scope_->NewUnresolved(factory(), function_name); | 4734 VariableProxy* fproxy = factory()->NewVariableProxy(fvar); |
4735 fproxy->BindTo(fvar); | |
4736 result->Set(kFunctionNameAssignmentIndex, | 4735 result->Set(kFunctionNameAssignmentIndex, |
4737 factory()->NewExpressionStatement( | 4736 factory()->NewExpressionStatement( |
4738 factory()->NewAssignment(fvar_init_op, fproxy, | 4737 factory()->NewAssignment(fvar_init_op, fproxy, |
4739 factory()->NewThisFunction(pos), | 4738 factory()->NewThisFunction(pos), |
4740 RelocInfo::kNoPosition), | 4739 RelocInfo::kNoPosition), |
4741 RelocInfo::kNoPosition)); | 4740 RelocInfo::kNoPosition)); |
4742 } | 4741 } |
4743 | 4742 |
4744 return result; | 4743 return result; |
4745 } | 4744 } |
(...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6340 | 6339 |
6341 Expression* Parser::SpreadCallNew(Expression* function, | 6340 Expression* Parser::SpreadCallNew(Expression* function, |
6342 ZoneList<v8::internal::Expression*>* args, | 6341 ZoneList<v8::internal::Expression*>* args, |
6343 int pos) { | 6342 int pos) { |
6344 args->InsertAt(0, function, zone()); | 6343 args->InsertAt(0, function, zone()); |
6345 | 6344 |
6346 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); | 6345 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); |
6347 } | 6346 } |
6348 } // namespace internal | 6347 } // namespace internal |
6349 } // namespace v8 | 6348 } // namespace v8 |
OLD | NEW |