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/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1596 void BytecodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { | 1596 void BytecodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { |
1597 // Materialize a regular expression literal. | 1597 // Materialize a regular expression literal. |
1598 builder()->CreateRegExpLiteral(expr->pattern(), expr->literal_index(), | 1598 builder()->CreateRegExpLiteral(expr->pattern(), expr->literal_index(), |
1599 expr->flags()); | 1599 expr->flags()); |
1600 } | 1600 } |
1601 | 1601 |
1602 void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 1602 void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
1603 // Deep-copy the literal boilerplate. | 1603 // Deep-copy the literal boilerplate. |
1604 uint8_t flags = CreateObjectLiteralFlags::Encode( | 1604 uint8_t flags = CreateObjectLiteralFlags::Encode( |
1605 expr->IsFastCloningSupported(), | 1605 expr->IsFastCloningSupported(), |
1606 FastCloneShallowObjectStub::PropertiesCount(expr->properties_count()), | 1606 ConstructorBuiltinsAssembler::FastCloneShallowObjectPropertiesCount( |
| 1607 expr->properties_count()), |
1607 expr->ComputeFlags()); | 1608 expr->ComputeFlags()); |
1608 // If constant properties is an empty fixed array, use our cached | 1609 // If constant properties is an empty fixed array, use our cached |
1609 // empty_fixed_array to ensure it's only added to the constant pool once. | 1610 // empty_fixed_array to ensure it's only added to the constant pool once. |
1610 Handle<FixedArray> constant_properties = expr->properties_count() == 0 | 1611 Handle<FixedArray> constant_properties = expr->properties_count() == 0 |
1611 ? empty_fixed_array() | 1612 ? empty_fixed_array() |
1612 : expr->constant_properties(); | 1613 : expr->constant_properties(); |
1613 Register literal = register_allocator()->NewRegister(); | 1614 Register literal = register_allocator()->NewRegister(); |
1614 builder()->CreateObjectLiteral(constant_properties, expr->literal_index(), | 1615 builder()->CreateObjectLiteral(constant_properties, expr->literal_index(), |
1615 flags, literal); | 1616 flags, literal); |
1616 | 1617 |
(...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3308 } | 3309 } |
3309 | 3310 |
3310 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { | 3311 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { |
3311 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict | 3312 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict |
3312 : Runtime::kStoreKeyedToSuper_Sloppy; | 3313 : Runtime::kStoreKeyedToSuper_Sloppy; |
3313 } | 3314 } |
3314 | 3315 |
3315 } // namespace interpreter | 3316 } // namespace interpreter |
3316 } // namespace internal | 3317 } // namespace internal |
3317 } // namespace v8 | 3318 } // namespace v8 |
OLD | NEW |