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

Side by Side Diff: src/code-stubs.cc

Issue 2570843002: Fix usage of literal cloning for large double arrays. (Closed)
Patch Set: Addressed comments. Created 4 years 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/code-stubs.h ('k') | src/compiler/js-create-lowering.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/code-stubs.h" 5 #include "src/code-stubs.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after
2148 assembler.Bind(&if_keyispositivesmi); 2148 assembler.Bind(&if_keyispositivesmi);
2149 assembler.TailCallRuntime(Runtime::kLoadElementWithInterceptor, context, 2149 assembler.TailCallRuntime(Runtime::kLoadElementWithInterceptor, context,
2150 receiver, key); 2150 receiver, key);
2151 2151
2152 assembler.Bind(&if_keyisinvalid); 2152 assembler.Bind(&if_keyisinvalid);
2153 assembler.TailCallRuntime(Runtime::kKeyedLoadIC_Miss, context, receiver, key, 2153 assembler.TailCallRuntime(Runtime::kKeyedLoadIC_Miss, context, receiver, key,
2154 slot, vector); 2154 slot, vector);
2155 } 2155 }
2156 2156
2157 // static 2157 // static
2158 bool FastCloneShallowObjectStub::IsSupported(ObjectLiteral* expr) {
2159 // FastCloneShallowObjectStub doesn't copy elements, and object literals don't
2160 // support copy-on-write (COW) elements for now.
2161 // TODO(mvstanton): make object literals support COW elements.
2162 return expr->fast_elements() && expr->has_shallow_properties() &&
2163 expr->properties_count() <= kMaximumClonedProperties;
2164 }
2165
2166 // static
2167 int FastCloneShallowObjectStub::PropertiesCount(int literal_length) { 2158 int FastCloneShallowObjectStub::PropertiesCount(int literal_length) {
2168 // This heuristic of setting empty literals to have 2159 // This heuristic of setting empty literals to have
2169 // kInitialGlobalObjectUnusedPropertiesCount must remain in-sync with the 2160 // kInitialGlobalObjectUnusedPropertiesCount must remain in-sync with the
2170 // runtime. 2161 // runtime.
2171 // TODO(verwaest): Unify this with the heuristic in the runtime. 2162 // TODO(verwaest): Unify this with the heuristic in the runtime.
2172 return literal_length == 0 2163 return literal_length == 0
2173 ? JSObject::kInitialGlobalObjectUnusedPropertiesCount 2164 ? JSObject::kInitialGlobalObjectUnusedPropertiesCount
2174 : literal_length; 2165 : literal_length;
2175 } 2166 }
2176 2167
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
3217 } 3208 }
3218 3209
3219 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) 3210 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate)
3220 : PlatformCodeStub(isolate) {} 3211 : PlatformCodeStub(isolate) {}
3221 3212
3222 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate) 3213 InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate)
3223 : PlatformCodeStub(isolate) {} 3214 : PlatformCodeStub(isolate) {}
3224 3215
3225 } // namespace internal 3216 } // namespace internal
3226 } // namespace v8 3217 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler/js-create-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698