| 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/full-codegen/full-codegen.h" | 5 #include "src/full-codegen/full-codegen.h" |
| 6 | 6 |
| 7 #include "src/ast/ast-numbering.h" | 7 #include "src/ast/ast-numbering.h" |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/ast/prettyprinter.h" | 9 #include "src/ast/prettyprinter.h" |
| 10 #include "src/ast/scopeinfo.h" | 10 #include "src/ast/scopeinfo.h" |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 isolate()->factory()->NewFixedArray(globals_->length(), TENURED); | 398 isolate()->factory()->NewFixedArray(globals_->length(), TENURED); |
| 399 for (int i = 0; i < globals_->length(); ++i) | 399 for (int i = 0; i < globals_->length(); ++i) |
| 400 array->set(i, *globals_->at(i)); | 400 array->set(i, *globals_->at(i)); |
| 401 DeclareGlobals(array); | 401 DeclareGlobals(array); |
| 402 } | 402 } |
| 403 | 403 |
| 404 globals_ = saved_globals; | 404 globals_ = saved_globals; |
| 405 } | 405 } |
| 406 | 406 |
| 407 | 407 |
| 408 void FullCodeGenerator::VisitImportDeclaration(ImportDeclaration* declaration) { | |
| 409 VariableProxy* proxy = declaration->proxy(); | |
| 410 Variable* variable = proxy->var(); | |
| 411 switch (variable->location()) { | |
| 412 case VariableLocation::GLOBAL: | |
| 413 case VariableLocation::UNALLOCATED: | |
| 414 // TODO(rossberg) | |
| 415 break; | |
| 416 | |
| 417 case VariableLocation::CONTEXT: { | |
| 418 Comment cmnt(masm_, "[ ImportDeclaration"); | |
| 419 EmitDebugCheckDeclarationContext(variable); | |
| 420 // TODO(rossberg) | |
| 421 break; | |
| 422 } | |
| 423 | |
| 424 case VariableLocation::PARAMETER: | |
| 425 case VariableLocation::LOCAL: | |
| 426 case VariableLocation::LOOKUP: | |
| 427 UNREACHABLE(); | |
| 428 } | |
| 429 } | |
| 430 | |
| 431 | |
| 432 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { | 408 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { |
| 433 Comment cmnt(masm_, "[ VariableProxy"); | 409 Comment cmnt(masm_, "[ VariableProxy"); |
| 434 EmitVariableLoad(expr); | 410 EmitVariableLoad(expr); |
| 435 } | 411 } |
| 436 | 412 |
| 437 | 413 |
| 438 void FullCodeGenerator::VisitSloppyBlockFunctionStatement( | 414 void FullCodeGenerator::VisitSloppyBlockFunctionStatement( |
| 439 SloppyBlockFunctionStatement* declaration) { | 415 SloppyBlockFunctionStatement* declaration) { |
| 440 Visit(declaration->statement()); | 416 Visit(declaration->statement()); |
| 441 } | 417 } |
| (...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1960 return var->scope()->is_nonlinear() || | 1936 return var->scope()->is_nonlinear() || |
| 1961 var->initializer_position() >= proxy->position(); | 1937 var->initializer_position() >= proxy->position(); |
| 1962 } | 1938 } |
| 1963 | 1939 |
| 1964 | 1940 |
| 1965 #undef __ | 1941 #undef __ |
| 1966 | 1942 |
| 1967 | 1943 |
| 1968 } // namespace internal | 1944 } // namespace internal |
| 1969 } // namespace v8 | 1945 } // namespace v8 |
| OLD | NEW |