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

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

Issue 1097963002: [turbofan] Use FastCloneShallow[Array|Object]Stub if possible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 5 years, 8 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/linkage.cc ('k') | test/unittests/compiler/js-intrinsic-lowering-unittest.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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/ast-numbering.h" 8 #include "src/ast-numbering.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 void FullCodeGenerator::PopulateTypeFeedbackInfo(Handle<Code> code) { 413 void FullCodeGenerator::PopulateTypeFeedbackInfo(Handle<Code> code) {
414 Handle<TypeFeedbackInfo> info = isolate()->factory()->NewTypeFeedbackInfo(); 414 Handle<TypeFeedbackInfo> info = isolate()->factory()->NewTypeFeedbackInfo();
415 info->set_ic_total_count(ic_total_count_); 415 info->set_ic_total_count(ic_total_count_);
416 DCHECK(!isolate()->heap()->InNewSpace(*info)); 416 DCHECK(!isolate()->heap()->InNewSpace(*info));
417 code->set_type_feedback_info(*info); 417 code->set_type_feedback_info(*info);
418 } 418 }
419 419
420 420
421 bool FullCodeGenerator::MustCreateObjectLiteralWithRuntime( 421 bool FullCodeGenerator::MustCreateObjectLiteralWithRuntime(
422 ObjectLiteral* expr) const { 422 ObjectLiteral* expr) const {
423 int literal_flags = expr->ComputeFlags();
423 // FastCloneShallowObjectStub doesn't copy elements, and object literals don't 424 // FastCloneShallowObjectStub doesn't copy elements, and object literals don't
424 // support copy-on-write (COW) elements for now. 425 // support copy-on-write (COW) elements for now.
425 // TODO(mvstanton): make object literals support COW elements. 426 // TODO(mvstanton): make object literals support COW elements.
426 return expr->may_store_doubles() || expr->depth() > 1 || 427 return masm()->serializer_enabled() ||
427 masm()->serializer_enabled() || 428 literal_flags != ObjectLiteral::kShallowProperties ||
428 expr->ComputeFlags() != ObjectLiteral::kFastElements || 429 literal_flags != ObjectLiteral::kFastElements ||
429 expr->has_elements() ||
430 expr->properties_count() > 430 expr->properties_count() >
431 FastCloneShallowObjectStub::kMaximumClonedProperties; 431 FastCloneShallowObjectStub::kMaximumClonedProperties;
432 } 432 }
433 433
434 434
435 bool FullCodeGenerator::MustCreateArrayLiteralWithRuntime( 435 bool FullCodeGenerator::MustCreateArrayLiteralWithRuntime(
436 ArrayLiteral* expr) const { 436 ArrayLiteral* expr) const {
437 return expr->depth() > 1 || 437 return expr->depth() > 1 ||
438 expr->values()->length() > JSObject::kInitialMaxFastElementArray; 438 expr->values()->length() > JSObject::kInitialMaxFastElementArray;
439 } 439 }
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after
1851 } 1851 }
1852 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); 1852 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS);
1853 codegen_->scope_ = saved_scope_; 1853 codegen_->scope_ = saved_scope_;
1854 } 1854 }
1855 1855
1856 1856
1857 #undef __ 1857 #undef __
1858 1858
1859 1859
1860 } } // namespace v8::internal 1860 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler/linkage.cc ('k') | test/unittests/compiler/js-intrinsic-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698