| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/full-codegen/full-codegen.h" | 5 #include "src/full-codegen/full-codegen.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
| 8 #include "src/ast/ast-numbering.h" | 8 #include "src/ast/ast-numbering.h" |
| 9 #include "src/ast/prettyprinter.h" | 9 #include "src/ast/prettyprinter.h" |
| 10 #include "src/ast/scopeinfo.h" | 10 #include "src/ast/scopeinfo.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 int FullCodeGenerator::NewHandlerTableEntry() { | 136 int FullCodeGenerator::NewHandlerTableEntry() { |
| 137 int index = static_cast<int>(handler_table_.size()); | 137 int index = static_cast<int>(handler_table_.size()); |
| 138 HandlerTableEntry entry = {0, 0, 0, 0, 0}; | 138 HandlerTableEntry entry = {0, 0, 0, 0, 0}; |
| 139 handler_table_.push_back(entry); | 139 handler_table_.push_back(entry); |
| 140 return index; | 140 return index; |
| 141 } | 141 } |
| 142 | 142 |
| 143 | 143 |
| 144 bool FullCodeGenerator::MustCreateObjectLiteralWithRuntime( | 144 bool FullCodeGenerator::MustCreateObjectLiteralWithRuntime( |
| 145 ObjectLiteral* expr) const { | 145 ObjectLiteral* expr) const { |
| 146 int literal_flags = expr->ComputeFlags(); | |
| 147 // FastCloneShallowObjectStub doesn't copy elements, and object literals don't | 146 // FastCloneShallowObjectStub doesn't copy elements, and object literals don't |
| 148 // support copy-on-write (COW) elements for now. | 147 // support copy-on-write (COW) elements for now. |
| 149 // TODO(mvstanton): make object literals support COW elements. | 148 // TODO(mvstanton): make object literals support COW elements. |
| 150 return masm()->serializer_enabled() || | 149 return masm()->serializer_enabled() || !expr->fast_elements() || |
| 151 (literal_flags & ObjectLiteral::kShallowProperties) == 0 || | 150 !expr->has_shallow_properties() || |
| 152 (literal_flags & ObjectLiteral::kFastElements) == 0 || | |
| 153 expr->properties_count() > | 151 expr->properties_count() > |
| 154 FastCloneShallowObjectStub::kMaximumClonedProperties; | 152 FastCloneShallowObjectStub::kMaximumClonedProperties; |
| 155 } | 153 } |
| 156 | 154 |
| 157 | 155 |
| 158 bool FullCodeGenerator::MustCreateArrayLiteralWithRuntime( | 156 bool FullCodeGenerator::MustCreateArrayLiteralWithRuntime( |
| 159 ArrayLiteral* expr) const { | 157 ArrayLiteral* expr) const { |
| 160 // TODO(rossberg): Teach strong mode to FastCloneShallowArrayStub. | 158 // TODO(rossberg): Teach strong mode to FastCloneShallowArrayStub. |
| 161 return expr->depth() > 1 || expr->is_strong() || | 159 return expr->depth() > 1 || expr->is_strong() || |
| 162 expr->values()->length() > JSArray::kInitialMaxFastElementArray; | 160 expr->values()->length() > JSArray::kInitialMaxFastElementArray; |
| (...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1710 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || | 1708 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || |
| 1711 var->initializer_position() >= proxy->position(); | 1709 var->initializer_position() >= proxy->position(); |
| 1712 } | 1710 } |
| 1713 | 1711 |
| 1714 | 1712 |
| 1715 #undef __ | 1713 #undef __ |
| 1716 | 1714 |
| 1717 | 1715 |
| 1718 } // namespace internal | 1716 } // namespace internal |
| 1719 } // namespace v8 | 1717 } // namespace v8 |
| OLD | NEW |