Chromium Code Reviews| 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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 813 VisitForAccumulatorValue(right); | 813 VisitForAccumulatorValue(right); |
| 814 | 814 |
| 815 SetExpressionPosition(expr); | 815 SetExpressionPosition(expr); |
| 816 if (ShouldInlineSmiCase(op)) { | 816 if (ShouldInlineSmiCase(op)) { |
| 817 EmitInlineSmiBinaryOp(expr, op, left, right); | 817 EmitInlineSmiBinaryOp(expr, op, left, right); |
| 818 } else { | 818 } else { |
| 819 EmitBinaryOp(expr, op); | 819 EmitBinaryOp(expr, op); |
| 820 } | 820 } |
| 821 } | 821 } |
| 822 | 822 |
| 823 void FullCodeGenerator::VisitProperty(Property* expr) { | |
|
titzer
2016/05/09 14:15:33
Why would do this? :)
| |
| 824 Comment cmnt(masm_, "[ Property"); | |
| 825 SetExpressionPosition(expr); | |
| 826 | |
| 827 Expression* key = expr->key(); | |
| 828 | |
| 829 if (key->IsPropertyName()) { | |
| 830 if (!expr->IsSuperAccess()) { | |
| 831 VisitForAccumulatorValue(expr->obj()); | |
| 832 __ Move(LoadDescriptor::ReceiverRegister(), result_register()); | |
| 833 EmitNamedPropertyLoad(expr); | |
| 834 } else { | |
| 835 VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var()); | |
| 836 VisitForStackValue( | |
| 837 expr->obj()->AsSuperPropertyReference()->home_object()); | |
| 838 EmitNamedSuperPropertyLoad(expr); | |
| 839 } | |
| 840 } else { | |
| 841 if (!expr->IsSuperAccess()) { | |
| 842 VisitForStackValue(expr->obj()); | |
| 843 VisitForAccumulatorValue(expr->key()); | |
| 844 __ Move(LoadDescriptor::NameRegister(), result_register()); | |
| 845 PopOperand(LoadDescriptor::ReceiverRegister()); | |
| 846 EmitKeyedPropertyLoad(expr); | |
| 847 } else { | |
| 848 VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var()); | |
| 849 VisitForStackValue( | |
| 850 expr->obj()->AsSuperPropertyReference()->home_object()); | |
| 851 VisitForStackValue(expr->key()); | |
| 852 EmitKeyedSuperPropertyLoad(expr); | |
| 853 } | |
| 854 } | |
| 855 PrepareForBailoutForId(expr->LoadId(), TOS_REG); | |
| 856 context()->Plug(result_register()); | |
| 857 } | |
| 823 | 858 |
| 824 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { | 859 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { |
| 825 VariableProxy* proxy = expr->AsVariableProxy(); | 860 VariableProxy* proxy = expr->AsVariableProxy(); |
| 826 DCHECK(!context()->IsEffect()); | 861 DCHECK(!context()->IsEffect()); |
| 827 DCHECK(!context()->IsTest()); | 862 DCHECK(!context()->IsTest()); |
| 828 | 863 |
| 829 if (proxy != NULL && (proxy->var()->IsUnallocatedOrGlobalSlot() || | 864 if (proxy != NULL && (proxy->var()->IsUnallocatedOrGlobalSlot() || |
| 830 proxy->var()->IsLookupSlot())) { | 865 proxy->var()->IsLookupSlot())) { |
| 831 EmitVariableLoad(proxy, INSIDE_TYPEOF); | 866 EmitVariableLoad(proxy, INSIDE_TYPEOF); |
| 832 PrepareForBailout(proxy, TOS_REG); | 867 PrepareForBailout(proxy, TOS_REG); |
| (...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1939 return var->scope()->is_nonlinear() || | 1974 return var->scope()->is_nonlinear() || |
| 1940 var->initializer_position() >= proxy->position(); | 1975 var->initializer_position() >= proxy->position(); |
| 1941 } | 1976 } |
| 1942 | 1977 |
| 1943 | 1978 |
| 1944 #undef __ | 1979 #undef __ |
| 1945 | 1980 |
| 1946 | 1981 |
| 1947 } // namespace internal | 1982 } // namespace internal |
| 1948 } // namespace v8 | 1983 } // namespace v8 |
| OLD | NEW |