Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Side by Side Diff: src/full-codegen/full-codegen.cc

Issue 1922523002: [Interpreter] Use FastCloneShallowObjectStub in CreateObjectLiteral bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add todo Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/code-assembler.cc ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/compiler/code-assembler.cc ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698