OLD | NEW |
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 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/builtins.h" | 9 #include "src/builtins.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 ? FeedbackVectorSlotKind::KEYED_STORE_IC | 130 ? FeedbackVectorSlotKind::KEYED_STORE_IC |
131 : FeedbackVectorSlotKind::STORE_IC; | 131 : FeedbackVectorSlotKind::STORE_IC; |
132 *out_slot = spec->AddSlot(kind); | 132 *out_slot = spec->AddSlot(kind); |
133 } | 133 } |
134 } | 134 } |
135 | 135 |
136 | 136 |
137 void ForEachStatement::AssignFeedbackVectorSlots( | 137 void ForEachStatement::AssignFeedbackVectorSlots( |
138 Isolate* isolate, FeedbackVectorSpec* spec, | 138 Isolate* isolate, FeedbackVectorSpec* spec, |
139 FeedbackVectorSlotCache* cache) { | 139 FeedbackVectorSlotCache* cache) { |
| 140 // TODO(adamk): for-of statements do not make use of this feedback slot. |
| 141 // The each_slot_ should be specific to ForInStatement, and this work moved |
| 142 // there. |
| 143 if (IsForOfStatement()) return; |
140 AssignVectorSlots(each(), spec, &each_slot_); | 144 AssignVectorSlots(each(), spec, &each_slot_); |
141 } | 145 } |
142 | 146 |
143 | 147 |
144 Assignment::Assignment(Zone* zone, Token::Value op, Expression* target, | 148 Assignment::Assignment(Zone* zone, Token::Value op, Expression* target, |
145 Expression* value, int pos) | 149 Expression* value, int pos) |
146 : Expression(zone, pos), | 150 : Expression(zone, pos), |
147 bit_field_( | 151 bit_field_( |
148 IsUninitializedField::encode(false) | KeyTypeField::encode(ELEMENT) | | 152 IsUninitializedField::encode(false) | KeyTypeField::encode(ELEMENT) | |
149 StoreModeField::encode(STANDARD_STORE) | TokenField::encode(op)), | 153 StoreModeField::encode(STANDARD_STORE) | TokenField::encode(op)), |
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 bool Literal::Match(void* literal1, void* literal2) { | 1147 bool Literal::Match(void* literal1, void* literal2) { |
1144 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1148 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
1145 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1149 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
1146 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 1150 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
1147 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1151 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
1148 } | 1152 } |
1149 | 1153 |
1150 | 1154 |
1151 } // namespace internal | 1155 } // namespace internal |
1152 } // namespace v8 | 1156 } // namespace v8 |
OLD | NEW |