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/hydrogen.h" | 5 #include "src/hydrogen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 5328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5339 if (*current_value == *isolate()->factory()->the_hole_value()) { | 5339 if (*current_value == *isolate()->factory()->the_hole_value()) { |
5340 return Bailout(kReferenceToUninitializedVariable); | 5340 return Bailout(kReferenceToUninitializedVariable); |
5341 } | 5341 } |
5342 HInstruction* result = New<HLoadNamedField>( | 5342 HInstruction* result = New<HLoadNamedField>( |
5343 Add<HConstant>(script_context), nullptr, | 5343 Add<HConstant>(script_context), nullptr, |
5344 HObjectAccess::ForContextSlot(lookup.slot_index)); | 5344 HObjectAccess::ForContextSlot(lookup.slot_index)); |
5345 return ast_context()->ReturnInstruction(result, expr->id()); | 5345 return ast_context()->ReturnInstruction(result, expr->id()); |
5346 } | 5346 } |
5347 } | 5347 } |
5348 | 5348 |
5349 LookupIterator it(global, variable->name(), | 5349 LookupIterator it(global, variable->name(), LookupIterator::OWN); |
5350 LookupIterator::OWN_SKIP_INTERCEPTOR); | |
5351 GlobalPropertyAccess type = LookupGlobalProperty(variable, &it, LOAD); | 5350 GlobalPropertyAccess type = LookupGlobalProperty(variable, &it, LOAD); |
5352 | 5351 |
5353 if (type == kUseCell) { | 5352 if (type == kUseCell) { |
5354 Handle<PropertyCell> cell = it.GetPropertyCell(); | 5353 Handle<PropertyCell> cell = it.GetPropertyCell(); |
5355 PropertyCell::AddDependentCompilationInfo(cell, top_info()); | 5354 PropertyCell::AddDependentCompilationInfo(cell, top_info()); |
5356 if (it.property_details().cell_type() == PropertyCellType::kConstant) { | 5355 if (it.property_details().cell_type() == PropertyCellType::kConstant) { |
5357 Handle<Object> constant_object(cell->value(), isolate()); | 5356 Handle<Object> constant_object(cell->value(), isolate()); |
5358 if (constant_object->IsConsString()) { | 5357 if (constant_object->IsConsString()) { |
5359 constant_object = | 5358 constant_object = |
5360 String::Flatten(Handle<String>::cast(constant_object)); | 5359 String::Flatten(Handle<String>::cast(constant_object)); |
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6503 HStoreNamedField* instr = Add<HStoreNamedField>( | 6502 HStoreNamedField* instr = Add<HStoreNamedField>( |
6504 Add<HConstant>(script_context), | 6503 Add<HConstant>(script_context), |
6505 HObjectAccess::ForContextSlot(lookup.slot_index), value); | 6504 HObjectAccess::ForContextSlot(lookup.slot_index), value); |
6506 USE(instr); | 6505 USE(instr); |
6507 DCHECK(instr->HasObservableSideEffects()); | 6506 DCHECK(instr->HasObservableSideEffects()); |
6508 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE); | 6507 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE); |
6509 return; | 6508 return; |
6510 } | 6509 } |
6511 } | 6510 } |
6512 | 6511 |
6513 LookupIterator it(global, var->name(), LookupIterator::OWN_SKIP_INTERCEPTOR); | 6512 LookupIterator it(global, var->name(), LookupIterator::OWN); |
6514 GlobalPropertyAccess type = LookupGlobalProperty(var, &it, STORE); | 6513 GlobalPropertyAccess type = LookupGlobalProperty(var, &it, STORE); |
6515 if (type == kUseCell) { | 6514 if (type == kUseCell) { |
6516 Handle<PropertyCell> cell = it.GetPropertyCell(); | 6515 Handle<PropertyCell> cell = it.GetPropertyCell(); |
6517 PropertyCell::AddDependentCompilationInfo(cell, top_info()); | 6516 PropertyCell::AddDependentCompilationInfo(cell, top_info()); |
6518 if (it.property_details().cell_type() == PropertyCellType::kConstant) { | 6517 if (it.property_details().cell_type() == PropertyCellType::kConstant) { |
6519 Handle<Object> constant(cell->value(), isolate()); | 6518 Handle<Object> constant(cell->value(), isolate()); |
6520 if (value->IsConstant()) { | 6519 if (value->IsConstant()) { |
6521 HConstant* c_value = HConstant::cast(value); | 6520 HConstant* c_value = HConstant::cast(value); |
6522 if (!constant.is_identical_to(c_value->handle(isolate()))) { | 6521 if (!constant.is_identical_to(c_value->handle(isolate()))) { |
6523 Add<HDeoptimize>(Deoptimizer::kConstantGlobalVariableAssignment, | 6522 Add<HDeoptimize>(Deoptimizer::kConstantGlobalVariableAssignment, |
(...skipping 6401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12925 if (ShouldProduceTraceOutput()) { | 12924 if (ShouldProduceTraceOutput()) { |
12926 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12925 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
12927 } | 12926 } |
12928 | 12927 |
12929 #ifdef DEBUG | 12928 #ifdef DEBUG |
12930 graph_->Verify(false); // No full verify. | 12929 graph_->Verify(false); // No full verify. |
12931 #endif | 12930 #endif |
12932 } | 12931 } |
12933 | 12932 |
12934 } } // namespace v8::internal | 12933 } } // namespace v8::internal |
OLD | NEW |