| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/compiler/js-type-feedback.h" | 5 #include "src/compiler/js-type-feedback.h" |
| 6 | 6 |
| 7 #include "src/property-details.h" | 7 #include "src/property-details.h" |
| 8 | 8 |
| 9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
| 10 #include "src/ast.h" | 10 #include "src/ast.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 } | 166 } |
| 167 | 167 |
| 168 | 168 |
| 169 Reduction JSTypeFeedbackSpecializer::ReduceJSLoadNamed(Node* node) { | 169 Reduction JSTypeFeedbackSpecializer::ReduceJSLoadNamed(Node* node) { |
| 170 DCHECK(node->opcode() == IrOpcode::kJSLoadNamed); | 170 DCHECK(node->opcode() == IrOpcode::kJSLoadNamed); |
| 171 Node* receiver = node->InputAt(0); | 171 Node* receiver = node->InputAt(0); |
| 172 if (IsGlobalObject(receiver)) { | 172 if (IsGlobalObject(receiver)) { |
| 173 return ReduceJSLoadNamedForGlobalVariable(node); | 173 return ReduceJSLoadNamedForGlobalVariable(node); |
| 174 } | 174 } |
| 175 | 175 |
| 176 if (!FLAG_turbo_deoptimization) return NoChange(); | 176 if (mode() != kDeoptimizationEnabled) return NoChange(); |
| 177 Node* frame_state_before = GetFrameStateBefore(node); | 177 Node* frame_state_before = GetFrameStateBefore(node); |
| 178 if (frame_state_before == nullptr) return NoChange(); | 178 if (frame_state_before == nullptr) return NoChange(); |
| 179 | 179 |
| 180 const LoadNamedParameters& p = LoadNamedParametersOf(node->op()); | 180 const LoadNamedParameters& p = LoadNamedParametersOf(node->op()); |
| 181 Handle<Name> name = p.name().handle(); | 181 Handle<Name> name = p.name().handle(); |
| 182 SmallMapList maps; | 182 SmallMapList maps; |
| 183 | 183 |
| 184 FeedbackVectorICSlot slot = js_type_feedback_->FindFeedbackVectorICSlot(node); | 184 FeedbackVectorICSlot slot = js_type_feedback_->FindFeedbackVectorICSlot(node); |
| 185 if (slot.IsInvalid() || | 185 if (slot.IsInvalid() || |
| 186 oracle()->LoadInlineCacheState(slot) == UNINITIALIZED) { | 186 oracle()->LoadInlineCacheState(slot) == UNINITIALIZED) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 Node* constant = jsgraph()->Constant(constant_value); | 238 Node* constant = jsgraph()->Constant(constant_value); |
| 239 ReplaceWithValue(node, constant); | 239 ReplaceWithValue(node, constant); |
| 240 return Replace(constant); | 240 return Replace(constant); |
| 241 } | 241 } |
| 242 | 242 |
| 243 if (global_object_.is_null()) { | 243 if (global_object_.is_null()) { |
| 244 // Nothing else can be done if we don't have a global object. | 244 // Nothing else can be done if we don't have a global object. |
| 245 return NoChange(); | 245 return NoChange(); |
| 246 } | 246 } |
| 247 | 247 |
| 248 if (FLAG_turbo_deoptimization) { | 248 if (mode() == kDeoptimizationEnabled) { |
| 249 // Handle lookups in the script context. | 249 // Handle lookups in the script context. |
| 250 { | 250 { |
| 251 Handle<ScriptContextTable> script_contexts( | 251 Handle<ScriptContextTable> script_contexts( |
| 252 global_object_->native_context()->script_context_table()); | 252 global_object_->native_context()->script_context_table()); |
| 253 ScriptContextTable::LookupResult lookup; | 253 ScriptContextTable::LookupResult lookup; |
| 254 if (ScriptContextTable::Lookup(script_contexts, name, &lookup)) { | 254 if (ScriptContextTable::Lookup(script_contexts, name, &lookup)) { |
| 255 // TODO(turbofan): introduce a LoadContext here. | 255 // TODO(turbofan): introduce a LoadContext here. |
| 256 return NoChange(); | 256 return NoChange(); |
| 257 } | 257 } |
| 258 } | 258 } |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 BailoutId id = OpParameter<FrameStateCallInfo>(node).bailout_id(); | 402 BailoutId id = OpParameter<FrameStateCallInfo>(node).bailout_id(); |
| 403 if (id != BailoutId::None()) return frame_state; | 403 if (id != BailoutId::None()) return frame_state; |
| 404 } | 404 } |
| 405 } | 405 } |
| 406 return nullptr; | 406 return nullptr; |
| 407 } | 407 } |
| 408 | 408 |
| 409 } // namespace compiler | 409 } // namespace compiler |
| 410 } // namespace internal | 410 } // namespace internal |
| 411 } // namespace v8 | 411 } // namespace v8 |
| OLD | NEW |