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

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

Issue 1638333002: ObjectLiterals in full code went to the runtime unnecessarily. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | 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.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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(); 146 int literal_flags = expr->ComputeFlags();
147 // FastCloneShallowObjectStub doesn't copy elements, and object literals don't 147 // FastCloneShallowObjectStub doesn't copy elements, and object literals don't
148 // support copy-on-write (COW) elements for now. 148 // support copy-on-write (COW) elements for now.
149 // TODO(mvstanton): make object literals support COW elements. 149 // TODO(mvstanton): make object literals support COW elements.
150 return masm()->serializer_enabled() || 150 return masm()->serializer_enabled() ||
151 literal_flags != ObjectLiteral::kShallowProperties || 151 (literal_flags & ObjectLiteral::kShallowProperties) == 0 ||
152 literal_flags != ObjectLiteral::kFastElements || 152 (literal_flags & ObjectLiteral::kFastElements) == 0 ||
153 expr->properties_count() > 153 expr->properties_count() >
154 FastCloneShallowObjectStub::kMaximumClonedProperties; 154 FastCloneShallowObjectStub::kMaximumClonedProperties;
155 } 155 }
156 156
157 157
158 bool FullCodeGenerator::MustCreateArrayLiteralWithRuntime( 158 bool FullCodeGenerator::MustCreateArrayLiteralWithRuntime(
159 ArrayLiteral* expr) const { 159 ArrayLiteral* expr) const {
160 // TODO(rossberg): Teach strong mode to FastCloneShallowArrayStub. 160 // TODO(rossberg): Teach strong mode to FastCloneShallowArrayStub.
161 return expr->depth() > 1 || expr->is_strong() || 161 return expr->depth() > 1 || expr->is_strong() ||
162 expr->values()->length() > JSArray::kInitialMaxFastElementArray; 162 expr->values()->length() > JSArray::kInitialMaxFastElementArray;
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || 1710 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() ||
1711 var->initializer_position() >= proxy->position(); 1711 var->initializer_position() >= proxy->position();
1712 } 1712 }
1713 1713
1714 1714
1715 #undef __ 1715 #undef __
1716 1716
1717 1717
1718 } // namespace internal 1718 } // namespace internal
1719 } // namespace v8 1719 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698