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