| 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 3050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3061 if (type->NumClasses() == 1) { | 3061 if (type->NumClasses() == 1) { |
| 3062 BuildCheckHeapObject(value); | 3062 BuildCheckHeapObject(value); |
| 3063 // For ICs, the map checked below is a sentinel map that gets replaced by | 3063 // For ICs, the map checked below is a sentinel map that gets replaced by |
| 3064 // the monomorphic map when the code is used as a template to generate a | 3064 // the monomorphic map when the code is used as a template to generate a |
| 3065 // new IC. For optimized functions, there is no sentinel map, the map | 3065 // new IC. For optimized functions, there is no sentinel map, the map |
| 3066 // emitted below is the actual monomorphic map. | 3066 // emitted below is the actual monomorphic map. |
| 3067 if (map_embedding == kEmbedMapsViaWeakCells) { | 3067 if (map_embedding == kEmbedMapsViaWeakCells) { |
| 3068 HValue* cell = | 3068 HValue* cell = |
| 3069 Add<HConstant>(Map::WeakCellForMap(type->Classes().Current())); | 3069 Add<HConstant>(Map::WeakCellForMap(type->Classes().Current())); |
| 3070 HValue* expected_map = Add<HLoadNamedField>( | 3070 HValue* expected_map = Add<HLoadNamedField>( |
| 3071 cell, nullptr, HObjectAccess::ForWeakCellValue()); | 3071 cell, nullptr, HObjectAccess::ForWeakCellValueComparison()); |
| 3072 HValue* map = | 3072 HValue* map = |
| 3073 Add<HLoadNamedField>(value, nullptr, HObjectAccess::ForMap()); | 3073 Add<HLoadNamedField>(value, nullptr, HObjectAccess::ForMap()); |
| 3074 IfBuilder map_check(this); | 3074 IfBuilder map_check(this); |
| 3075 map_check.IfNot<HCompareObjectEqAndBranch>(expected_map, map); | 3075 map_check.IfNot<HCompareObjectEqAndBranch>(expected_map, map); |
| 3076 map_check.ThenDeopt(Deoptimizer::kUnknownMap); | 3076 map_check.ThenDeopt(Deoptimizer::kUnknownMap); |
| 3077 map_check.End(); | 3077 map_check.End(); |
| 3078 } else { | 3078 } else { |
| 3079 DCHECK(map_embedding == kEmbedMapsDirectly); | 3079 DCHECK(map_embedding == kEmbedMapsDirectly); |
| 3080 Add<HCheckMaps>(value, type->Classes().Current()); | 3080 Add<HCheckMaps>(value, type->Classes().Current()); |
| 3081 } | 3081 } |
| (...skipping 10406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13488 if (ShouldProduceTraceOutput()) { | 13488 if (ShouldProduceTraceOutput()) { |
| 13489 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13489 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13490 } | 13490 } |
| 13491 | 13491 |
| 13492 #ifdef DEBUG | 13492 #ifdef DEBUG |
| 13493 graph_->Verify(false); // No full verify. | 13493 graph_->Verify(false); // No full verify. |
| 13494 #endif | 13494 #endif |
| 13495 } | 13495 } |
| 13496 | 13496 |
| 13497 } } // namespace v8::internal | 13497 } } // namespace v8::internal |
| OLD | NEW |