| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 382          context->fall_through()); | 382          context->fall_through()); | 
| 383 } | 383 } | 
| 384 | 384 | 
| 385 | 385 | 
| 386 void FullCodeGenerator::VisitDeclarations( | 386 void FullCodeGenerator::VisitDeclarations( | 
| 387     ZoneList<Declaration*>* declarations) { | 387     ZoneList<Declaration*>* declarations) { | 
| 388   ZoneList<Handle<Object> >* saved_globals = globals_; | 388   ZoneList<Handle<Object> >* saved_globals = globals_; | 
| 389   ZoneList<Handle<Object> > inner_globals(10, zone()); | 389   ZoneList<Handle<Object> > inner_globals(10, zone()); | 
| 390   globals_ = &inner_globals; | 390   globals_ = &inner_globals; | 
| 391 | 391 | 
| 392   AstVisitor::VisitDeclarations(declarations); | 392   AstVisitor<FullCodeGenerator>::VisitDeclarations(declarations); | 
| 393 | 393 | 
| 394   if (!globals_->is_empty()) { | 394   if (!globals_->is_empty()) { | 
| 395     // Invoke the platform-dependent code generator to do the actual | 395     // Invoke the platform-dependent code generator to do the actual | 
| 396     // declaration of the global functions and variables. | 396     // declaration of the global functions and variables. | 
| 397     Handle<FixedArray> array = | 397     Handle<FixedArray> array = | 
| 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   } | 
| (...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1967   return var->scope()->is_nonlinear() || | 1967   return var->scope()->is_nonlinear() || | 
| 1968          var->initializer_position() >= proxy->position(); | 1968          var->initializer_position() >= proxy->position(); | 
| 1969 } | 1969 } | 
| 1970 | 1970 | 
| 1971 | 1971 | 
| 1972 #undef __ | 1972 #undef __ | 
| 1973 | 1973 | 
| 1974 | 1974 | 
| 1975 }  // namespace internal | 1975 }  // namespace internal | 
| 1976 }  // namespace v8 | 1976 }  // namespace v8 | 
| OLD | NEW | 
|---|