| 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-numbering.h" | 7 #include "src/ast/ast-numbering.h" |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 int FullCodeGenerator::NewHandlerTableEntry() { | 137 int FullCodeGenerator::NewHandlerTableEntry() { |
| 138 int index = static_cast<int>(handler_table_.size()); | 138 int index = static_cast<int>(handler_table_.size()); |
| 139 HandlerTableEntry entry = {0, 0, 0, 0, 0}; | 139 HandlerTableEntry entry = {0, 0, 0, 0, 0}; |
| 140 handler_table_.push_back(entry); | 140 handler_table_.push_back(entry); |
| 141 return index; | 141 return index; |
| 142 } | 142 } |
| 143 | 143 |
| 144 | 144 |
| 145 bool FullCodeGenerator::MustCreateObjectLiteralWithRuntime( | 145 bool FullCodeGenerator::MustCreateObjectLiteralWithRuntime( |
| 146 ObjectLiteral* expr) const { | 146 ObjectLiteral* expr) const { |
| 147 // FastCloneShallowObjectStub doesn't copy elements, and object literals don't | 147 return masm()->serializer_enabled() || |
| 148 // support copy-on-write (COW) elements for now. | 148 !FastCloneShallowObjectStub::IsSupported(expr); |
| 149 // TODO(mvstanton): make object literals support COW elements. | |
| 150 return masm()->serializer_enabled() || !expr->fast_elements() || | |
| 151 !expr->has_shallow_properties() || | |
| 152 expr->properties_count() > | |
| 153 FastCloneShallowObjectStub::kMaximumClonedProperties; | |
| 154 } | 149 } |
| 155 | 150 |
| 156 | 151 |
| 157 bool FullCodeGenerator::MustCreateArrayLiteralWithRuntime( | 152 bool FullCodeGenerator::MustCreateArrayLiteralWithRuntime( |
| 158 ArrayLiteral* expr) const { | 153 ArrayLiteral* expr) const { |
| 159 return expr->depth() > 1 || | 154 return expr->depth() > 1 || |
| 160 expr->values()->length() > JSArray::kInitialMaxFastElementArray; | 155 expr->values()->length() > JSArray::kInitialMaxFastElementArray; |
| 161 } | 156 } |
| 162 | 157 |
| 163 | 158 |
| (...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1936 return var->scope()->is_nonlinear() || | 1931 return var->scope()->is_nonlinear() || |
| 1937 var->initializer_position() >= proxy->position(); | 1932 var->initializer_position() >= proxy->position(); |
| 1938 } | 1933 } |
| 1939 | 1934 |
| 1940 | 1935 |
| 1941 #undef __ | 1936 #undef __ |
| 1942 | 1937 |
| 1943 | 1938 |
| 1944 } // namespace internal | 1939 } // namespace internal |
| 1945 } // namespace v8 | 1940 } // namespace v8 |
| OLD | NEW |