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 AssignVectorSlots(each(), spec, &each_slot_); | 140 if (each()->IsValidReferenceExpression()) { |
adamk
2015/12/10 20:08:15
Do you still need this check?
caitp (gmail)
2015/12/10 20:32:25
I can avoid needing it, but it means an extra vari
adamk
2015/12/10 23:03:31
A TODO to further separate ForIn and ForOf here wo
caitp (gmail)
2015/12/10 23:18:16
TODO() added
| |
141 AssignVectorSlots(each(), spec, &each_slot_); | |
142 } | |
141 } | 143 } |
142 | 144 |
143 | 145 |
144 Assignment::Assignment(Zone* zone, Token::Value op, Expression* target, | 146 Assignment::Assignment(Zone* zone, Token::Value op, Expression* target, |
145 Expression* value, int pos) | 147 Expression* value, int pos) |
146 : Expression(zone, pos), | 148 : Expression(zone, pos), |
147 bit_field_( | 149 bit_field_( |
148 IsUninitializedField::encode(false) | KeyTypeField::encode(ELEMENT) | | 150 IsUninitializedField::encode(false) | KeyTypeField::encode(ELEMENT) | |
149 StoreModeField::encode(STANDARD_STORE) | TokenField::encode(op)), | 151 StoreModeField::encode(STANDARD_STORE) | TokenField::encode(op)), |
150 target_(target), | 152 target_(target), |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1143 bool Literal::Match(void* literal1, void* literal2) { | 1145 bool Literal::Match(void* literal1, void* literal2) { |
1144 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1146 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
1145 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1147 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
1146 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 1148 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
1147 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1149 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
1148 } | 1150 } |
1149 | 1151 |
1150 | 1152 |
1151 } // namespace internal | 1153 } // namespace internal |
1152 } // namespace v8 | 1154 } // namespace v8 |
OLD | NEW |