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/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 TypeofMode typeof_mode) { | 501 TypeofMode typeof_mode) { |
502 Variable* var = proxy->var(); | 502 Variable* var = proxy->var(); |
503 DCHECK(var->IsUnallocated() || | 503 DCHECK(var->IsUnallocated() || |
504 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); | 504 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); |
505 __ Move(LoadDescriptor::NameRegister(), var->name()); | 505 __ Move(LoadDescriptor::NameRegister(), var->name()); |
506 | 506 |
507 EmitLoadSlot(LoadGlobalDescriptor::SlotRegister(), | 507 EmitLoadSlot(LoadGlobalDescriptor::SlotRegister(), |
508 proxy->VariableFeedbackSlot()); | 508 proxy->VariableFeedbackSlot()); |
509 Handle<Code> code = CodeFactory::LoadGlobalIC(isolate(), typeof_mode).code(); | 509 Handle<Code> code = CodeFactory::LoadGlobalIC(isolate(), typeof_mode).code(); |
510 __ Call(code, RelocInfo::CODE_TARGET); | 510 __ Call(code, RelocInfo::CODE_TARGET); |
| 511 RestoreContext(); |
511 } | 512 } |
512 | 513 |
513 void FullCodeGenerator::VisitSloppyBlockFunctionStatement( | 514 void FullCodeGenerator::VisitSloppyBlockFunctionStatement( |
514 SloppyBlockFunctionStatement* declaration) { | 515 SloppyBlockFunctionStatement* declaration) { |
515 Visit(declaration->statement()); | 516 Visit(declaration->statement()); |
516 } | 517 } |
517 | 518 |
518 | 519 |
519 int FullCodeGenerator::DeclareGlobalsFlags() { | 520 int FullCodeGenerator::DeclareGlobalsFlags() { |
520 return info_->GetDeclareGlobalsFlags(); | 521 return info_->GetDeclareGlobalsFlags(); |
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1993 return info_->has_simple_parameters(); | 1994 return info_->has_simple_parameters(); |
1994 } | 1995 } |
1995 | 1996 |
1996 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); } | 1997 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); } |
1997 | 1998 |
1998 #undef __ | 1999 #undef __ |
1999 | 2000 |
2000 | 2001 |
2001 } // namespace internal | 2002 } // namespace internal |
2002 } // namespace v8 | 2003 } // namespace v8 |
OLD | NEW |