Chromium Code Reviews| Index: src/interpreter/bytecode-generator.cc |
| diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
| index a81e1726179a27c1ccd10b70fdee885961cb2c21..a35d181a903eb58d706d3cb6946c732ae1b39c16 100644 |
| --- a/src/interpreter/bytecode-generator.cc |
| +++ b/src/interpreter/bytecode-generator.cc |
| @@ -5,6 +5,7 @@ |
| #include "src/interpreter/bytecode-generator.h" |
| #include "src/ast/scopes.h" |
| +#include "src/code-stubs.h" |
| #include "src/compiler.h" |
| #include "src/interpreter/bytecode-register-allocator.h" |
| #include "src/interpreter/control-flow-builders.h" |
| @@ -1543,10 +1544,21 @@ void BytecodeGenerator::VisitRegExpLiteral(RegExpLiteral* expr) { |
| void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
| - // Deep-copy the literal boilerplate. |
| + // Copy the literal boilerplate. |
| + int fast_clone_properties_count = 0; |
| + if (FastCloneShallowObjectStub::IsSupported(expr)) { |
| + STATIC_ASSERT( |
|
oth
2016/04/28 14:17:15
This assertion might be better placed in the encod
rmcilroy
2016/04/29 13:53:21
I can't put it in the encode routine since that is
|
| + FastCloneShallowObjectStub::kMaximumClonedProperties <= |
| + 1 << CreateObjectLiteralFlags::FastClonePropertiesCountBits::kShift); |
| + fast_clone_properties_count = |
| + FastCloneShallowObjectStub::PropertiesCount(expr->properties_count()); |
| + } |
| + uint8_t flags = |
| + CreateObjectLiteralFlags::FlagsBits::encode(expr->ComputeFlags()) | |
|
oth
2016/04/28 14:17:15
The code could DCHECK here that the components of
rmcilroy
2016/04/29 13:53:21
Good point. Switched to using kNext in the definit
|
| + CreateObjectLiteralFlags::FastClonePropertiesCountBits::encode( |
| + fast_clone_properties_count); |
| builder()->CreateObjectLiteral(expr->constant_properties(), |
| - expr->literal_index(), |
| - expr->ComputeFlags(true)); |
| + expr->literal_index(), flags); |
| // Allocate in the outer scope since this register is used to return the |
| // expression's results to the caller. |