| 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/compiler.h" | 7 #include "src/compiler.h" |
| 8 #include "src/interpreter/control-flow-builders.h" | 8 #include "src/interpreter/control-flow-builders.h" |
| 9 #include "src/objects.h" | 9 #include "src/objects.h" |
| 10 #include "src/parser.h" | 10 #include "src/parser.h" |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 Register flags = temporary_register_scope.NewRegister(); | 941 Register flags = temporary_register_scope.NewRegister(); |
| 942 builder() | 942 builder() |
| 943 ->LoadLiteral(expr->flags()) | 943 ->LoadLiteral(expr->flags()) |
| 944 .StoreAccumulatorInRegister(flags) | 944 .StoreAccumulatorInRegister(flags) |
| 945 .LoadLiteral(expr->pattern()) | 945 .LoadLiteral(expr->pattern()) |
| 946 .CreateRegExpLiteral(expr->literal_index(), flags); | 946 .CreateRegExpLiteral(expr->literal_index(), flags); |
| 947 execution_result()->SetResultInAccumulator(); | 947 execution_result()->SetResultInAccumulator(); |
| 948 } | 948 } |
| 949 | 949 |
| 950 | 950 |
| 951 void BytecodeGenerator::VisitAssignmentPattern(AssignmentPattern* expr) { |
| 952 Visit(expr->expression()); |
| 953 } |
| 954 |
| 955 |
| 951 void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 956 void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
| 952 // Deep-copy the literal boilerplate. | 957 // Deep-copy the literal boilerplate. |
| 953 builder() | 958 builder() |
| 954 ->LoadLiteral(expr->constant_properties()) | 959 ->LoadLiteral(expr->constant_properties()) |
| 955 .CreateObjectLiteral(expr->literal_index(), expr->ComputeFlags(true)); | 960 .CreateObjectLiteral(expr->literal_index(), expr->ComputeFlags(true)); |
| 956 | 961 |
| 957 TemporaryRegisterScope temporary_register_scope(builder()); | 962 TemporaryRegisterScope temporary_register_scope(builder()); |
| 958 Register literal; | 963 Register literal; |
| 959 | 964 |
| 960 // Store computed values into the literal. | 965 // Store computed values into the literal. |
| (...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2160 } | 2165 } |
| 2161 | 2166 |
| 2162 | 2167 |
| 2163 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 2168 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
| 2164 return info()->feedback_vector()->GetIndex(slot); | 2169 return info()->feedback_vector()->GetIndex(slot); |
| 2165 } | 2170 } |
| 2166 | 2171 |
| 2167 } // namespace interpreter | 2172 } // namespace interpreter |
| 2168 } // namespace internal | 2173 } // namespace internal |
| 2169 } // namespace v8 | 2174 } // namespace v8 |
| OLD | NEW |