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

Side by Side Diff: src/ast/ast.cc

Issue 2655853010: [TypeFeedbackVector] Combine the literals array and the feedback vector. (Closed)
Patch Set: more comments. Created 3 years, 10 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/ast/ast.h ('k') | src/ast/ast-literal-reindexer.h » ('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/ast/ast.h" 5 #include "src/ast/ast.h"
6 6
7 #include <cmath> // For isfinite. 7 #include <cmath> // For isfinite.
8 8
9 #include "src/ast/compile-time-value.h" 9 #include "src/ast/compile-time-value.h"
10 #include "src/ast/prettyprinter.h" 10 #include "src/ast/prettyprinter.h"
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 418
419 419
420 void ObjectLiteral::Property::set_emit_store(bool emit_store) { 420 void ObjectLiteral::Property::set_emit_store(bool emit_store) {
421 emit_store_ = emit_store; 421 emit_store_ = emit_store;
422 } 422 }
423 423
424 bool ObjectLiteral::Property::emit_store() const { return emit_store_; } 424 bool ObjectLiteral::Property::emit_store() const { return emit_store_; }
425 425
426 void ObjectLiteral::AssignFeedbackVectorSlots(FeedbackVectorSpec* spec, 426 void ObjectLiteral::AssignFeedbackVectorSlots(FeedbackVectorSpec* spec,
427 FeedbackVectorSlotCache* cache) { 427 FeedbackVectorSlotCache* cache) {
428 MaterializedLiteral::AssignFeedbackVectorSlots(spec, cache);
429
428 // This logic that computes the number of slots needed for vector store 430 // This logic that computes the number of slots needed for vector store
429 // ics must mirror FullCodeGenerator::VisitObjectLiteral. 431 // ics must mirror FullCodeGenerator::VisitObjectLiteral.
430 int property_index = 0; 432 int property_index = 0;
431 for (; property_index < properties()->length(); property_index++) { 433 for (; property_index < properties()->length(); property_index++) {
432 ObjectLiteral::Property* property = properties()->at(property_index); 434 ObjectLiteral::Property* property = properties()->at(property_index);
433 if (property->is_computed_name()) break; 435 if (property->is_computed_name()) break;
434 if (property->IsCompileTimeValue()) continue; 436 if (property->IsCompileTimeValue()) continue;
435 437
436 Literal* key = property->key()->AsLiteral(); 438 Literal* key = property->key()->AsLiteral();
437 Expression* value = property->value(); 439 Expression* value = property->value();
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 } 773 }
772 774
773 bool ArrayLiteral::IsFastCloningSupported() const { 775 bool ArrayLiteral::IsFastCloningSupported() const {
774 return depth() <= 1 && 776 return depth() <= 1 &&
775 values()->length() <= 777 values()->length() <=
776 ConstructorBuiltinsAssembler::kMaximumClonedShallowArrayElements; 778 ConstructorBuiltinsAssembler::kMaximumClonedShallowArrayElements;
777 } 779 }
778 780
779 void ArrayLiteral::AssignFeedbackVectorSlots(FeedbackVectorSpec* spec, 781 void ArrayLiteral::AssignFeedbackVectorSlots(FeedbackVectorSpec* spec,
780 FeedbackVectorSlotCache* cache) { 782 FeedbackVectorSlotCache* cache) {
783 MaterializedLiteral::AssignFeedbackVectorSlots(spec, cache);
784
781 // This logic that computes the number of slots needed for vector store 785 // This logic that computes the number of slots needed for vector store
782 // ics must mirror FullCodeGenerator::VisitArrayLiteral. 786 // ics must mirror FullCodeGenerator::VisitArrayLiteral.
783 for (int array_index = 0; array_index < values()->length(); array_index++) { 787 for (int array_index = 0; array_index < values()->length(); array_index++) {
784 Expression* subexpr = values()->at(array_index); 788 Expression* subexpr = values()->at(array_index);
785 DCHECK(!subexpr->IsSpread()); 789 DCHECK(!subexpr->IsSpread());
786 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; 790 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;
787 791
788 // We'll reuse the same literal slot for all of the non-constant 792 // We'll reuse the same literal slot for all of the non-constant
789 // subexpressions that use a keyed store IC. 793 // subexpressions that use a keyed store IC.
790 literal_slot_ = spec->AddKeyedStoreICSlot(); 794 literal_slot_ = spec->AddKeyedStoreICSlot();
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 const char* CallRuntime::debug_name() { 1091 const char* CallRuntime::debug_name() {
1088 #ifdef DEBUG 1092 #ifdef DEBUG
1089 return NameForNativeContextIntrinsicIndex(context_index_); 1093 return NameForNativeContextIntrinsicIndex(context_index_);
1090 #else 1094 #else
1091 return is_jsruntime() ? "(context function)" : function_->name; 1095 return is_jsruntime() ? "(context function)" : function_->name;
1092 #endif // DEBUG 1096 #endif // DEBUG
1093 } 1097 }
1094 1098
1095 } // namespace internal 1099 } // namespace internal
1096 } // namespace v8 1100 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/ast.h ('k') | src/ast/ast-literal-reindexer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698