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

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

Issue 1742013002: [cleanup] Move ForEach vector feedback slots to ForInStatement (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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') | 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/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/prettyprinter.h" 9 #include "src/ast/prettyprinter.h"
10 #include "src/ast/scopes.h" 10 #include "src/ast/scopes.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 expr->AsVariableProxy()->var()->IsUnallocated()) || 141 expr->AsVariableProxy()->var()->IsUnallocated()) ||
142 assign_type == NAMED_PROPERTY || assign_type == KEYED_PROPERTY) { 142 assign_type == NAMED_PROPERTY || assign_type == KEYED_PROPERTY) {
143 // TODO(ishell): consider using ICSlotCache for variables here. 143 // TODO(ishell): consider using ICSlotCache for variables here.
144 FeedbackVectorSlotKind kind = assign_type == KEYED_PROPERTY 144 FeedbackVectorSlotKind kind = assign_type == KEYED_PROPERTY
145 ? FeedbackVectorSlotKind::KEYED_STORE_IC 145 ? FeedbackVectorSlotKind::KEYED_STORE_IC
146 : FeedbackVectorSlotKind::STORE_IC; 146 : FeedbackVectorSlotKind::STORE_IC;
147 *out_slot = spec->AddSlot(kind); 147 *out_slot = spec->AddSlot(kind);
148 } 148 }
149 } 149 }
150 150
151 151 void ForInStatement::AssignFeedbackVectorSlots(Isolate* isolate,
152 void ForEachStatement::AssignFeedbackVectorSlots( 152 FeedbackVectorSpec* spec,
153 Isolate* isolate, FeedbackVectorSpec* spec, 153 FeedbackVectorSlotCache* cache) {
154 FeedbackVectorSlotCache* cache) {
155 // TODO(adamk): for-of statements do not make use of this feedback slot.
156 // The each_slot_ should be specific to ForInStatement, and this work moved
157 // there.
158 if (IsForOfStatement()) return;
159 AssignVectorSlots(each(), spec, &each_slot_); 154 AssignVectorSlots(each(), spec, &each_slot_);
155 for_in_feedback_slot_ = spec->AddGeneralSlot();
160 } 156 }
161 157
162 158
163 Assignment::Assignment(Zone* zone, Token::Value op, Expression* target, 159 Assignment::Assignment(Zone* zone, Token::Value op, Expression* target,
164 Expression* value, int pos) 160 Expression* value, int pos)
165 : Expression(zone, pos), 161 : Expression(zone, pos),
166 bit_field_( 162 bit_field_(
167 IsUninitializedField::encode(false) | KeyTypeField::encode(ELEMENT) | 163 IsUninitializedField::encode(false) | KeyTypeField::encode(ELEMENT) |
168 StoreModeField::encode(STANDARD_STORE) | TokenField::encode(op)), 164 StoreModeField::encode(STANDARD_STORE) | TokenField::encode(op)),
169 target_(target), 165 target_(target),
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 bool Literal::Match(void* literal1, void* literal2) { 834 bool Literal::Match(void* literal1, void* literal2) {
839 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); 835 const AstValue* x = static_cast<Literal*>(literal1)->raw_value();
840 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); 836 const AstValue* y = static_cast<Literal*>(literal2)->raw_value();
841 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || 837 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) ||
842 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); 838 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber());
843 } 839 }
844 840
845 841
846 } // namespace internal 842 } // namespace internal
847 } // namespace v8 843 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/ast.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698