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/prettyprinter.h" | 9 #include "src/ast/prettyprinter.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 if (UsesVariableFeedbackSlot()) { | 127 if (UsesVariableFeedbackSlot()) { |
128 // VariableProxies that point to the same Variable within a function can | 128 // VariableProxies that point to the same Variable within a function can |
129 // make their loads from the same IC slot. | 129 // make their loads from the same IC slot. |
130 if (var()->IsUnallocated() || var()->mode() == DYNAMIC_GLOBAL) { | 130 if (var()->IsUnallocated() || var()->mode() == DYNAMIC_GLOBAL) { |
131 ZoneHashMap::Entry* entry = cache->Get(var()); | 131 ZoneHashMap::Entry* entry = cache->Get(var()); |
132 if (entry != NULL) { | 132 if (entry != NULL) { |
133 variable_feedback_slot_ = FeedbackVectorSlot( | 133 variable_feedback_slot_ = FeedbackVectorSlot( |
134 static_cast<int>(reinterpret_cast<intptr_t>(entry->value))); | 134 static_cast<int>(reinterpret_cast<intptr_t>(entry->value))); |
135 return; | 135 return; |
136 } | 136 } |
137 variable_feedback_slot_ = spec->AddLoadGlobalICSlot(); | 137 variable_feedback_slot_ = spec->AddLoadGlobalICSlot(var()->name()); |
138 cache->Put(var(), variable_feedback_slot_); | 138 cache->Put(var(), variable_feedback_slot_); |
139 } else { | 139 } else { |
140 variable_feedback_slot_ = spec->AddLoadICSlot(); | 140 variable_feedback_slot_ = spec->AddLoadICSlot(); |
141 } | 141 } |
142 } | 142 } |
143 } | 143 } |
144 | 144 |
145 | 145 |
146 static void AssignVectorSlots(Expression* expr, FeedbackVectorSpec* spec, | 146 static void AssignVectorSlots(Expression* expr, FeedbackVectorSpec* spec, |
147 FeedbackVectorSlot* out_slot) { | 147 FeedbackVectorSlot* out_slot) { |
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 bool Literal::Match(void* literal1, void* literal2) { | 1141 bool Literal::Match(void* literal1, void* literal2) { |
1142 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1142 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
1143 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1143 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
1144 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 1144 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
1145 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1145 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
1146 } | 1146 } |
1147 | 1147 |
1148 | 1148 |
1149 } // namespace internal | 1149 } // namespace internal |
1150 } // namespace v8 | 1150 } // namespace v8 |
OLD | NEW |