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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 Comment cmnt(masm_, "[ VariableProxy"); | 478 Comment cmnt(masm_, "[ VariableProxy"); |
479 EmitVariableLoad(expr); | 479 EmitVariableLoad(expr); |
480 } | 480 } |
481 | 481 |
482 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, | 482 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, |
483 TypeofMode typeof_mode) { | 483 TypeofMode typeof_mode) { |
484 Variable* var = proxy->var(); | 484 Variable* var = proxy->var(); |
485 DCHECK(var->IsUnallocated()); | 485 DCHECK(var->IsUnallocated()); |
486 __ Move(LoadDescriptor::NameRegister(), var->name()); | 486 __ Move(LoadDescriptor::NameRegister(), var->name()); |
487 | 487 |
488 EmitLoadSlot(LoadGlobalDescriptor::SlotRegister(), | 488 FeedbackVectorSlot slot = proxy->VariableFeedbackSlot(); |
489 proxy->VariableFeedbackSlot()); | 489 // Ensure that typeof mode is in sync with the IC slot kind. |
| 490 DCHECK_EQ(GetTypeofModeFromICKind(feedback_vector_spec()->GetKind(slot)), |
| 491 typeof_mode); |
| 492 |
| 493 EmitLoadSlot(LoadGlobalDescriptor::SlotRegister(), slot); |
490 Handle<Code> code = CodeFactory::LoadGlobalIC(isolate(), typeof_mode).code(); | 494 Handle<Code> code = CodeFactory::LoadGlobalIC(isolate(), typeof_mode).code(); |
491 __ Call(code, RelocInfo::CODE_TARGET); | 495 __ Call(code, RelocInfo::CODE_TARGET); |
492 RestoreContext(); | 496 RestoreContext(); |
493 } | 497 } |
494 | 498 |
495 void FullCodeGenerator::VisitSloppyBlockFunctionStatement( | 499 void FullCodeGenerator::VisitSloppyBlockFunctionStatement( |
496 SloppyBlockFunctionStatement* declaration) { | 500 SloppyBlockFunctionStatement* declaration) { |
497 Visit(declaration->statement()); | 501 Visit(declaration->statement()); |
498 } | 502 } |
499 | 503 |
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1613 | 1617 |
1614 const FeedbackVectorSpec* FullCodeGenerator::feedback_vector_spec() const { | 1618 const FeedbackVectorSpec* FullCodeGenerator::feedback_vector_spec() const { |
1615 return literal()->feedback_vector_spec(); | 1619 return literal()->feedback_vector_spec(); |
1616 } | 1620 } |
1617 | 1621 |
1618 #undef __ | 1622 #undef __ |
1619 | 1623 |
1620 | 1624 |
1621 } // namespace internal | 1625 } // namespace internal |
1622 } // namespace v8 | 1626 } // namespace v8 |
OLD | NEW |