OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
(...skipping 5269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5280 } | 5280 } |
5281 } | 5281 } |
5282 | 5282 |
5283 LookupIterator it(global, variable->name(), LookupIterator::OWN); | 5283 LookupIterator it(global, variable->name(), LookupIterator::OWN); |
5284 it.TryLookupCachedProperty(); | 5284 it.TryLookupCachedProperty(); |
5285 if (CanInlineGlobalPropertyAccess(variable, &it, LOAD)) { | 5285 if (CanInlineGlobalPropertyAccess(variable, &it, LOAD)) { |
5286 InlineGlobalPropertyLoad(&it, expr->id()); | 5286 InlineGlobalPropertyLoad(&it, expr->id()); |
5287 return; | 5287 return; |
5288 } else { | 5288 } else { |
5289 Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate()); | 5289 Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate()); |
| 5290 FeedbackVectorSlot slot = expr->VariableFeedbackSlot(); |
| 5291 DCHECK(vector->IsLoadGlobalIC(slot)); |
5290 | 5292 |
5291 HValue* vector_value = Add<HConstant>(vector); | 5293 HValue* vector_value = Add<HConstant>(vector); |
5292 HValue* slot_value = | 5294 HValue* slot_value = Add<HConstant>(vector->GetIndex(slot)); |
5293 Add<HConstant>(vector->GetIndex(expr->VariableFeedbackSlot())); | |
5294 Callable callable = CodeFactory::LoadGlobalICInOptimizedCode( | 5295 Callable callable = CodeFactory::LoadGlobalICInOptimizedCode( |
5295 isolate(), ast_context()->typeof_mode()); | 5296 isolate(), ast_context()->typeof_mode()); |
5296 HValue* stub = Add<HConstant>(callable.code()); | 5297 HValue* stub = Add<HConstant>(callable.code()); |
5297 HValue* name = Add<HConstant>(variable->name()); | 5298 HValue* name = Add<HConstant>(variable->name()); |
5298 HValue* values[] = {name, slot_value, vector_value}; | 5299 HValue* values[] = {name, slot_value, vector_value}; |
5299 HCallWithDescriptor* instr = New<HCallWithDescriptor>( | 5300 HCallWithDescriptor* instr = New<HCallWithDescriptor>( |
5300 Code::LOAD_GLOBAL_IC, stub, 0, callable.descriptor(), | 5301 Code::LOAD_GLOBAL_IC, stub, 0, callable.descriptor(), |
5301 ArrayVector(values)); | 5302 ArrayVector(values)); |
5302 return ast_context()->ReturnInstruction(instr, expr->id()); | 5303 return ast_context()->ReturnInstruction(instr, expr->id()); |
5303 } | 5304 } |
(...skipping 7723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13027 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13028 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13028 } | 13029 } |
13029 | 13030 |
13030 #ifdef DEBUG | 13031 #ifdef DEBUG |
13031 graph_->Verify(false); // No full verify. | 13032 graph_->Verify(false); // No full verify. |
13032 #endif | 13033 #endif |
13033 } | 13034 } |
13034 | 13035 |
13035 } // namespace internal | 13036 } // namespace internal |
13036 } // namespace v8 | 13037 } // namespace v8 |
OLD | NEW |