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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 if (UsesVariableFeedbackSlot()) { | 204 if (UsesVariableFeedbackSlot()) { |
205 // VariableProxies that point to the same Variable within a function can | 205 // VariableProxies that point to the same Variable within a function can |
206 // make their loads from the same IC slot. | 206 // make their loads from the same IC slot. |
207 if (var()->IsUnallocated() || var()->mode() == DYNAMIC_GLOBAL) { | 207 if (var()->IsUnallocated() || var()->mode() == DYNAMIC_GLOBAL) { |
208 ZoneHashMap::Entry* entry = cache->Get(var()); | 208 ZoneHashMap::Entry* entry = cache->Get(var()); |
209 if (entry != NULL) { | 209 if (entry != NULL) { |
210 variable_feedback_slot_ = FeedbackVectorSlot( | 210 variable_feedback_slot_ = FeedbackVectorSlot( |
211 static_cast<int>(reinterpret_cast<intptr_t>(entry->value))); | 211 static_cast<int>(reinterpret_cast<intptr_t>(entry->value))); |
212 return; | 212 return; |
213 } | 213 } |
214 variable_feedback_slot_ = spec->AddLoadGlobalICSlot(var()->name()); | 214 variable_feedback_slot_ = spec->AddLoadGlobalICSlot(); |
215 cache->Put(var(), variable_feedback_slot_); | 215 cache->Put(var(), variable_feedback_slot_); |
216 } else { | 216 } else { |
217 variable_feedback_slot_ = spec->AddLoadICSlot(); | 217 variable_feedback_slot_ = spec->AddLoadICSlot(); |
218 } | 218 } |
219 } | 219 } |
220 } | 220 } |
221 | 221 |
222 | 222 |
223 static void AssignVectorSlots(Expression* expr, FeedbackVectorSpec* spec, | 223 static void AssignVectorSlots(Expression* expr, FeedbackVectorSpec* spec, |
224 FeedbackVectorSlot* out_slot) { | 224 FeedbackVectorSlot* out_slot) { |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 // static | 947 // static |
948 bool Literal::Match(void* literal1, void* literal2) { | 948 bool Literal::Match(void* literal1, void* literal2) { |
949 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 949 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
950 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 950 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
951 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 951 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
952 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 952 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
953 } | 953 } |
954 | 954 |
955 } // namespace internal | 955 } // namespace internal |
956 } // namespace v8 | 956 } // namespace v8 |
OLD | NEW |