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 | 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 bit_field_ = copy_from->bit_field_; | 195 bit_field_ = copy_from->bit_field_; |
196 DCHECK(!copy_from->is_resolved()); | 196 DCHECK(!copy_from->is_resolved()); |
197 raw_name_ = copy_from->raw_name_; | 197 raw_name_ = copy_from->raw_name_; |
198 } | 198 } |
199 | 199 |
200 void VariableProxy::BindTo(Variable* var) { | 200 void VariableProxy::BindTo(Variable* var) { |
201 DCHECK((is_this() && var->is_this()) || raw_name() == var->raw_name()); | 201 DCHECK((is_this() && var->is_this()) || raw_name() == var->raw_name()); |
202 set_var(var); | 202 set_var(var); |
203 set_is_resolved(); | 203 set_is_resolved(); |
204 var->set_is_used(); | 204 var->set_is_used(); |
| 205 if (is_assigned()) var->set_maybe_assigned(); |
205 } | 206 } |
206 | 207 |
207 void VariableProxy::AssignFeedbackVectorSlots(FeedbackVectorSpec* spec, | 208 void VariableProxy::AssignFeedbackVectorSlots(FeedbackVectorSpec* spec, |
208 FeedbackVectorSlotCache* cache) { | 209 FeedbackVectorSlotCache* cache) { |
209 if (UsesVariableFeedbackSlot()) { | 210 if (UsesVariableFeedbackSlot()) { |
210 // VariableProxies that point to the same Variable within a function can | 211 // VariableProxies that point to the same Variable within a function can |
211 // make their loads from the same IC slot. | 212 // make their loads from the same IC slot. |
212 if (var()->IsUnallocated() || var()->mode() == DYNAMIC_GLOBAL) { | 213 if (var()->IsUnallocated() || var()->mode() == DYNAMIC_GLOBAL) { |
213 ZoneHashMap::Entry* entry = cache->Get(var()); | 214 ZoneHashMap::Entry* entry = cache->Get(var()); |
214 if (entry != NULL) { | 215 if (entry != NULL) { |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 // static | 1060 // static |
1060 bool Literal::Match(void* literal1, void* literal2) { | 1061 bool Literal::Match(void* literal1, void* literal2) { |
1061 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1062 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
1062 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1063 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
1063 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 1064 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
1064 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1065 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
1065 } | 1066 } |
1066 | 1067 |
1067 } // namespace internal | 1068 } // namespace internal |
1068 } // namespace v8 | 1069 } // namespace v8 |
OLD | NEW |