OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/bytecode-generator.h" | 5 #include "src/interpreter/bytecode-generator.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/interpreter/bytecode-flags.h" | 10 #include "src/interpreter/bytecode-flags.h" |
(...skipping 2764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2775 execution_result()->SetResultInAccumulator(); | 2775 execution_result()->SetResultInAccumulator(); |
2776 } | 2776 } |
2777 | 2777 |
2778 void BytecodeGenerator::VisitCountOperation(CountOperation* expr) { | 2778 void BytecodeGenerator::VisitCountOperation(CountOperation* expr) { |
2779 DCHECK(expr->expression()->IsValidReferenceExpressionOrThis()); | 2779 DCHECK(expr->expression()->IsValidReferenceExpressionOrThis()); |
2780 | 2780 |
2781 // Left-hand side can only be a property, a global or a variable slot. | 2781 // Left-hand side can only be a property, a global or a variable slot. |
2782 Property* property = expr->expression()->AsProperty(); | 2782 Property* property = expr->expression()->AsProperty(); |
2783 LhsKind assign_type = Property::GetAssignType(property); | 2783 LhsKind assign_type = Property::GetAssignType(property); |
2784 | 2784 |
2785 // TODO(rmcilroy): Set is_postfix to false if visiting for effect. | 2785 bool is_postfix = expr->is_postfix() && !execution_result()->IsEffect(); |
2786 bool is_postfix = expr->is_postfix(); | |
2787 | 2786 |
2788 // Evaluate LHS expression and get old value. | 2787 // Evaluate LHS expression and get old value. |
2789 Register object, home_object, key, old_value, value; | 2788 Register object, home_object, key, old_value, value; |
2790 Handle<String> name; | 2789 Handle<String> name; |
2791 switch (assign_type) { | 2790 switch (assign_type) { |
2792 case VARIABLE: { | 2791 case VARIABLE: { |
2793 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 2792 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
2794 VisitVariableLoadForAccumulatorValue(proxy->var(), | 2793 VisitVariableLoadForAccumulatorValue(proxy->var(), |
2795 proxy->VariableFeedbackSlot()); | 2794 proxy->VariableFeedbackSlot()); |
2796 break; | 2795 break; |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3240 return execution_context()->scope()->language_mode(); | 3239 return execution_context()->scope()->language_mode(); |
3241 } | 3240 } |
3242 | 3241 |
3243 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3242 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
3244 return TypeFeedbackVector::GetIndex(slot); | 3243 return TypeFeedbackVector::GetIndex(slot); |
3245 } | 3244 } |
3246 | 3245 |
3247 } // namespace interpreter | 3246 } // namespace interpreter |
3248 } // namespace internal | 3247 } // namespace internal |
3249 } // namespace v8 | 3248 } // namespace v8 |
OLD | NEW |