| 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 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2107 !IsLexicalVariableMode(mode)) { | 2107 !IsLexicalVariableMode(mode)) { |
| 2108 // In a var binding in a sloppy direct eval, pollute the enclosing scope | 2108 // In a var binding in a sloppy direct eval, pollute the enclosing scope |
| 2109 // with this new binding by doing the following: | 2109 // with this new binding by doing the following: |
| 2110 // The proxy is bound to a lookup variable to force a dynamic declaration | 2110 // The proxy is bound to a lookup variable to force a dynamic declaration |
| 2111 // using the DeclareLookupSlot runtime function. | 2111 // using the DeclareLookupSlot runtime function. |
| 2112 Variable::Kind kind = Variable::NORMAL; | 2112 Variable::Kind kind = Variable::NORMAL; |
| 2113 // TODO(sigurds) figure out if kNotAssigned is OK here | 2113 // TODO(sigurds) figure out if kNotAssigned is OK here |
| 2114 var = new (zone()) Variable(declaration_scope, name, mode, kind, | 2114 var = new (zone()) Variable(declaration_scope, name, mode, kind, |
| 2115 declaration->initialization(), kNotAssigned); | 2115 declaration->initialization(), kNotAssigned); |
| 2116 var->AllocateTo(VariableLocation::LOOKUP, -1); | 2116 var->AllocateTo(VariableLocation::LOOKUP, -1); |
| 2117 var->SetFromEval(); |
| 2117 resolve = true; | 2118 resolve = true; |
| 2118 } | 2119 } |
| 2119 | 2120 |
| 2120 | 2121 |
| 2121 // We add a declaration node for every declaration. The compiler | 2122 // We add a declaration node for every declaration. The compiler |
| 2122 // will only generate code if necessary. In particular, declarations | 2123 // will only generate code if necessary. In particular, declarations |
| 2123 // for inner local variables that do not represent functions won't | 2124 // for inner local variables that do not represent functions won't |
| 2124 // result in any generated code. | 2125 // result in any generated code. |
| 2125 // | 2126 // |
| 2126 // Note that we always add an unresolved proxy even if it's not | 2127 // Note that we always add an unresolved proxy even if it's not |
| (...skipping 4215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6342 | 6343 |
| 6343 Expression* Parser::SpreadCallNew(Expression* function, | 6344 Expression* Parser::SpreadCallNew(Expression* function, |
| 6344 ZoneList<v8::internal::Expression*>* args, | 6345 ZoneList<v8::internal::Expression*>* args, |
| 6345 int pos) { | 6346 int pos) { |
| 6346 args->InsertAt(0, function, zone()); | 6347 args->InsertAt(0, function, zone()); |
| 6347 | 6348 |
| 6348 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); | 6349 return factory()->NewCallRuntime(Context::REFLECT_CONSTRUCT_INDEX, args, pos); |
| 6349 } | 6350 } |
| 6350 } // namespace internal | 6351 } // namespace internal |
| 6351 } // namespace v8 | 6352 } // namespace v8 |
| OLD | NEW |