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/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/interpreter/bytecode-register-allocator.h" | 9 #include "src/interpreter/bytecode-register-allocator.h" |
10 #include "src/interpreter/control-flow-builders.h" | 10 #include "src/interpreter/control-flow-builders.h" |
(...skipping 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1697 builder()->CallRuntime(Runtime::kDefineGetterPropertyUnchecked, | 1697 builder()->CallRuntime(Runtime::kDefineGetterPropertyUnchecked, |
1698 literal_argument, 4); | 1698 literal_argument, 4); |
1699 break; | 1699 break; |
1700 case ObjectLiteral::Property::SETTER: | 1700 case ObjectLiteral::Property::SETTER: |
1701 builder()->CallRuntime(Runtime::kDefineSetterPropertyUnchecked, | 1701 builder()->CallRuntime(Runtime::kDefineSetterPropertyUnchecked, |
1702 literal_argument, 4); | 1702 literal_argument, 4); |
1703 break; | 1703 break; |
1704 } | 1704 } |
1705 } | 1705 } |
1706 | 1706 |
1707 // Transform literals that contain functions to fast properties. | |
1708 if (expr->has_function()) { | |
1709 builder()->CallRuntime(Runtime::kToFastProperties, literal, 1); | |
1710 } | |
1711 | |
1712 execution_result()->SetResultInRegister(literal); | 1707 execution_result()->SetResultInRegister(literal); |
1713 } | 1708 } |
1714 | 1709 |
1715 | 1710 |
1716 void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { | 1711 void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
1717 // Deep-copy the literal boilerplate. | 1712 // Deep-copy the literal boilerplate. |
1718 builder()->CreateArrayLiteral(expr->constant_elements(), | 1713 builder()->CreateArrayLiteral(expr->constant_elements(), |
1719 expr->literal_index(), | 1714 expr->literal_index(), |
1720 expr->ComputeFlags(true)); | 1715 expr->ComputeFlags(true)); |
1721 Register index, literal; | 1716 Register index, literal; |
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3156 } | 3151 } |
3157 | 3152 |
3158 | 3153 |
3159 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3154 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
3160 return info()->feedback_vector()->GetIndex(slot); | 3155 return info()->feedback_vector()->GetIndex(slot); |
3161 } | 3156 } |
3162 | 3157 |
3163 } // namespace interpreter | 3158 } // namespace interpreter |
3164 } // namespace internal | 3159 } // namespace internal |
3165 } // namespace v8 | 3160 } // namespace v8 |
OLD | NEW |