| 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.h" | 5 #include "src/ast.h" |
| 6 | 6 |
| 7 #include <cmath> // For isfinite. | 7 #include <cmath> // For isfinite. |
| 8 #include "src/builtins.h" | 8 #include "src/builtins.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/contexts.h" | 10 #include "src/contexts.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 if ((assign_type == VARIABLE && | 134 if ((assign_type == VARIABLE && |
| 135 expr->AsVariableProxy()->var()->IsUnallocated()) || | 135 expr->AsVariableProxy()->var()->IsUnallocated()) || |
| 136 assign_type == NAMED_PROPERTY || assign_type == KEYED_PROPERTY) { | 136 assign_type == NAMED_PROPERTY || assign_type == KEYED_PROPERTY) { |
| 137 ic_slots++; | 137 ic_slots++; |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 return ic_slots; | 140 return ic_slots; |
| 141 } | 141 } |
| 142 | 142 |
| 143 | 143 |
| 144 static Code::Kind GetStoreICKind(Expression* expr) { | 144 static FeedbackVectorSlotKind GetStoreICKind(Expression* expr) { |
| 145 LhsKind assign_type = Property::GetAssignType(expr->AsProperty()); | 145 LhsKind assign_type = Property::GetAssignType(expr->AsProperty()); |
| 146 return assign_type == KEYED_PROPERTY ? Code::KEYED_STORE_IC : Code::STORE_IC; | 146 return assign_type == KEYED_PROPERTY ? FeedbackVectorSlotKind::KEYED_STORE_IC |
| 147 : FeedbackVectorSlotKind::STORE_IC; |
| 147 } | 148 } |
| 148 | 149 |
| 149 | 150 |
| 150 FeedbackVectorRequirements ForEachStatement::ComputeFeedbackRequirements( | 151 FeedbackVectorRequirements ForEachStatement::ComputeFeedbackRequirements( |
| 151 Isolate* isolate, const ICSlotCache* cache) { | 152 Isolate* isolate, const ICSlotCache* cache) { |
| 152 int ic_slots = GetStoreICSlots(each()); | 153 int ic_slots = GetStoreICSlots(each()); |
| 153 return FeedbackVectorRequirements(0, ic_slots); | 154 return FeedbackVectorRequirements(0, ic_slots); |
| 154 } | 155 } |
| 155 | 156 |
| 156 | 157 |
| 157 Code::Kind ForEachStatement::FeedbackICSlotKind(int index) { | 158 FeedbackVectorSlotKind ForEachStatement::FeedbackICSlotKind(int index) { |
| 158 return GetStoreICKind(each()); | 159 return GetStoreICKind(each()); |
| 159 } | 160 } |
| 160 | 161 |
| 161 | 162 |
| 162 Assignment::Assignment(Zone* zone, Token::Value op, Expression* target, | 163 Assignment::Assignment(Zone* zone, Token::Value op, Expression* target, |
| 163 Expression* value, int pos) | 164 Expression* value, int pos) |
| 164 : Expression(zone, pos), | 165 : Expression(zone, pos), |
| 165 bit_field_( | 166 bit_field_( |
| 166 IsUninitializedField::encode(false) | KeyTypeField::encode(ELEMENT) | | 167 IsUninitializedField::encode(false) | KeyTypeField::encode(ELEMENT) | |
| 167 StoreModeField::encode(STANDARD_STORE) | TokenField::encode(op)), | 168 StoreModeField::encode(STANDARD_STORE) | TokenField::encode(op)), |
| 168 target_(target), | 169 target_(target), |
| 169 value_(value), | 170 value_(value), |
| 170 binary_operation_(NULL), | 171 binary_operation_(NULL), |
| 171 slot_(FeedbackVectorICSlot::Invalid()) {} | 172 slot_(FeedbackVectorICSlot::Invalid()) {} |
| 172 | 173 |
| 173 | 174 |
| 174 FeedbackVectorRequirements Assignment::ComputeFeedbackRequirements( | 175 FeedbackVectorRequirements Assignment::ComputeFeedbackRequirements( |
| 175 Isolate* isolate, const ICSlotCache* cache) { | 176 Isolate* isolate, const ICSlotCache* cache) { |
| 176 int ic_slots = GetStoreICSlots(target()); | 177 int ic_slots = GetStoreICSlots(target()); |
| 177 return FeedbackVectorRequirements(0, ic_slots); | 178 return FeedbackVectorRequirements(0, ic_slots); |
| 178 } | 179 } |
| 179 | 180 |
| 180 | 181 |
| 181 Code::Kind Assignment::FeedbackICSlotKind(int index) { | 182 FeedbackVectorSlotKind Assignment::FeedbackICSlotKind(int index) { |
| 182 return GetStoreICKind(target()); | 183 return GetStoreICKind(target()); |
| 183 } | 184 } |
| 184 | 185 |
| 185 | 186 |
| 186 FeedbackVectorRequirements CountOperation::ComputeFeedbackRequirements( | 187 FeedbackVectorRequirements CountOperation::ComputeFeedbackRequirements( |
| 187 Isolate* isolate, const ICSlotCache* cache) { | 188 Isolate* isolate, const ICSlotCache* cache) { |
| 188 int ic_slots = GetStoreICSlots(expression()); | 189 int ic_slots = GetStoreICSlots(expression()); |
| 189 return FeedbackVectorRequirements(0, ic_slots); | 190 return FeedbackVectorRequirements(0, ic_slots); |
| 190 } | 191 } |
| 191 | 192 |
| 192 | 193 |
| 193 Code::Kind CountOperation::FeedbackICSlotKind(int index) { | 194 FeedbackVectorSlotKind CountOperation::FeedbackICSlotKind(int index) { |
| 194 return GetStoreICKind(expression()); | 195 return GetStoreICKind(expression()); |
| 195 } | 196 } |
| 196 | 197 |
| 197 | 198 |
| 198 Token::Value Assignment::binary_op() const { | 199 Token::Value Assignment::binary_op() const { |
| 199 switch (op()) { | 200 switch (op()) { |
| 200 case Token::ASSIGN_BIT_OR: return Token::BIT_OR; | 201 case Token::ASSIGN_BIT_OR: return Token::BIT_OR; |
| 201 case Token::ASSIGN_BIT_XOR: return Token::BIT_XOR; | 202 case Token::ASSIGN_BIT_XOR: return Token::BIT_XOR; |
| 202 case Token::ASSIGN_BIT_AND: return Token::BIT_AND; | 203 case Token::ASSIGN_BIT_AND: return Token::BIT_AND; |
| 203 case Token::ASSIGN_SHL: return Token::SHL; | 204 case Token::ASSIGN_SHL: return Token::SHL; |
| (...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1187 bool Literal::Match(void* literal1, void* literal2) { | 1188 bool Literal::Match(void* literal1, void* literal2) { |
| 1188 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1189 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
| 1189 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1190 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
| 1190 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 1191 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
| 1191 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1192 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
| 1192 } | 1193 } |
| 1193 | 1194 |
| 1194 | 1195 |
| 1195 } // namespace internal | 1196 } // namespace internal |
| 1196 } // namespace v8 | 1197 } // namespace v8 |
| OLD | NEW |