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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 } | 492 } |
493 | 493 |
494 | 494 |
495 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { | 495 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { |
496 Comment cmnt(masm_, "[ VariableProxy"); | 496 Comment cmnt(masm_, "[ VariableProxy"); |
497 EmitVariableLoad(expr); | 497 EmitVariableLoad(expr); |
498 } | 498 } |
499 | 499 |
500 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, | 500 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, |
501 TypeofMode typeof_mode) { | 501 TypeofMode typeof_mode) { |
502 #ifdef DEBUG | |
503 Variable* var = proxy->var(); | 502 Variable* var = proxy->var(); |
504 DCHECK(var->IsUnallocated() || | 503 DCHECK(var->IsUnallocated() || |
505 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); | 504 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); |
506 #endif | 505 __ Move(LoadDescriptor::NameRegister(), var->name()); |
| 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 } | 511 } |
512 | 512 |
513 void FullCodeGenerator::VisitSloppyBlockFunctionStatement( | 513 void FullCodeGenerator::VisitSloppyBlockFunctionStatement( |
514 SloppyBlockFunctionStatement* declaration) { | 514 SloppyBlockFunctionStatement* declaration) { |
515 Visit(declaration->statement()); | 515 Visit(declaration->statement()); |
516 } | 516 } |
(...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1993 return info_->has_simple_parameters(); | 1993 return info_->has_simple_parameters(); |
1994 } | 1994 } |
1995 | 1995 |
1996 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); } | 1996 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); } |
1997 | 1997 |
1998 #undef __ | 1998 #undef __ |
1999 | 1999 |
2000 | 2000 |
2001 } // namespace internal | 2001 } // namespace internal |
2002 } // namespace v8 | 2002 } // namespace v8 |
OLD | NEW |