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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 void VariableProxy::BindTo(Variable* var) { | 216 void VariableProxy::BindTo(Variable* var) { |
217 DCHECK((is_this() && var->is_this()) || raw_name() == var->raw_name()); | 217 DCHECK((is_this() && var->is_this()) || raw_name() == var->raw_name()); |
218 set_var(var); | 218 set_var(var); |
219 set_is_resolved(); | 219 set_is_resolved(); |
220 var->set_is_used(); | 220 var->set_is_used(); |
221 if (is_assigned()) var->set_maybe_assigned(); | 221 if (is_assigned()) var->set_maybe_assigned(); |
222 } | 222 } |
223 | 223 |
224 void VariableProxy::AssignFeedbackVectorSlots(FeedbackVectorSpec* spec, | 224 void VariableProxy::AssignFeedbackVectorSlots(FeedbackVectorSpec* spec, |
225 LanguageMode language_mode, | 225 TypeofMode typeof_mode, |
226 FeedbackVectorSlotCache* cache) { | 226 FeedbackVectorSlotCache* cache) { |
227 if (UsesVariableFeedbackSlot()) { | 227 if (UsesVariableFeedbackSlot()) { |
228 // VariableProxies that point to the same Variable within a function can | 228 // VariableProxies that point to the same Variable within a function can |
229 // make their loads from the same IC slot. | 229 // make their loads from the same IC slot. |
230 if (var()->IsUnallocated() || var()->mode() == DYNAMIC_GLOBAL) { | 230 if (var()->IsUnallocated() || var()->mode() == DYNAMIC_GLOBAL) { |
231 ZoneHashMap::Entry* entry = cache->Get(var()); | 231 FeedbackVectorSlot slot = cache->Get(typeof_mode, var()); |
232 if (entry != NULL) { | 232 if (!slot.IsInvalid()) { |
233 variable_feedback_slot_ = FeedbackVectorSlot( | 233 variable_feedback_slot_ = slot; |
234 static_cast<int>(reinterpret_cast<intptr_t>(entry->value))); | |
235 return; | 234 return; |
236 } | 235 } |
237 variable_feedback_slot_ = spec->AddLoadGlobalICSlot(); | 236 variable_feedback_slot_ = spec->AddLoadGlobalICSlot(typeof_mode); |
238 cache->Put(var(), variable_feedback_slot_); | 237 cache->Put(typeof_mode, var(), variable_feedback_slot_); |
239 } else { | 238 } else { |
240 variable_feedback_slot_ = spec->AddLoadICSlot(); | 239 variable_feedback_slot_ = spec->AddLoadICSlot(); |
241 } | 240 } |
242 } | 241 } |
243 } | 242 } |
244 | 243 |
245 static void AssignVectorSlots(Expression* expr, FeedbackVectorSpec* spec, | 244 static void AssignVectorSlots(Expression* expr, FeedbackVectorSpec* spec, |
246 LanguageMode language_mode, | 245 LanguageMode language_mode, |
247 FeedbackVectorSlot* out_slot) { | 246 FeedbackVectorSlot* out_slot) { |
248 Property* property = expr->AsProperty(); | 247 Property* property = expr->AsProperty(); |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 const char* CallRuntime::debug_name() { | 1104 const char* CallRuntime::debug_name() { |
1106 #ifdef DEBUG | 1105 #ifdef DEBUG |
1107 return NameForNativeContextIntrinsicIndex(context_index_); | 1106 return NameForNativeContextIntrinsicIndex(context_index_); |
1108 #else | 1107 #else |
1109 return is_jsruntime() ? "(context function)" : function_->name; | 1108 return is_jsruntime() ? "(context function)" : function_->name; |
1110 #endif // DEBUG | 1109 #endif // DEBUG |
1111 } | 1110 } |
1112 | 1111 |
1113 } // namespace internal | 1112 } // namespace internal |
1114 } // namespace v8 | 1113 } // namespace v8 |
OLD | NEW |