OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/simplified-lowering.h" | 5 #include "src/compiler/simplified-lowering.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/address-map.h" | 9 #include "src/address-map.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 value_representation == MachineRepresentation::kTaggedSigned) { | 1024 value_representation == MachineRepresentation::kTaggedSigned) { |
1025 // Write barriers are only for stores of heap objects. | 1025 // Write barriers are only for stores of heap objects. |
1026 return kNoWriteBarrier; | 1026 return kNoWriteBarrier; |
1027 } | 1027 } |
1028 if (field_type->Is(Type::BooleanOrNullOrUndefined()) || | 1028 if (field_type->Is(Type::BooleanOrNullOrUndefined()) || |
1029 value_type->Is(Type::BooleanOrNullOrUndefined())) { | 1029 value_type->Is(Type::BooleanOrNullOrUndefined())) { |
1030 // Write barriers are not necessary when storing true, false, null or | 1030 // Write barriers are not necessary when storing true, false, null or |
1031 // undefined, because these special oddballs are always in the root set. | 1031 // undefined, because these special oddballs are always in the root set. |
1032 return kNoWriteBarrier; | 1032 return kNoWriteBarrier; |
1033 } | 1033 } |
1034 if (value_type->IsHeapConstant() && | 1034 if (value_type->IsHeapConstant()) { |
1035 value_type->AsHeapConstant()->Value()->IsHeapObject()) { | 1035 Handle<HeapObject> value_object = value_type->AsHeapConstant()->Value(); |
1036 Handle<HeapObject> value_object = | |
1037 Handle<HeapObject>::cast(value_type->AsHeapConstant()->Value()); | |
1038 RootIndexMap root_index_map(jsgraph_->isolate()); | 1036 RootIndexMap root_index_map(jsgraph_->isolate()); |
1039 int root_index = root_index_map.Lookup(*value_object); | 1037 int root_index = root_index_map.Lookup(*value_object); |
1040 if (root_index != RootIndexMap::kInvalidRootIndex && | 1038 if (root_index != RootIndexMap::kInvalidRootIndex && |
1041 jsgraph_->isolate()->heap()->RootIsImmortalImmovable(root_index)) { | 1039 jsgraph_->isolate()->heap()->RootIsImmortalImmovable(root_index)) { |
1042 // Write barriers are unnecessary for immortal immovable roots. | 1040 // Write barriers are unnecessary for immortal immovable roots. |
1043 return kNoWriteBarrier; | 1041 return kNoWriteBarrier; |
1044 } | 1042 } |
1045 if (value_object->IsMap()) { | 1043 if (value_object->IsMap()) { |
1046 // Write barriers for storing maps are cheaper. | 1044 // Write barriers for storing maps are cheaper. |
1047 return kMapWriteBarrier; | 1045 return kMapWriteBarrier; |
(...skipping 2195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3243 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3241 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
3244 Operator::kNoProperties); | 3242 Operator::kNoProperties); |
3245 to_number_operator_.set(common()->Call(desc)); | 3243 to_number_operator_.set(common()->Call(desc)); |
3246 } | 3244 } |
3247 return to_number_operator_.get(); | 3245 return to_number_operator_.get(); |
3248 } | 3246 } |
3249 | 3247 |
3250 } // namespace compiler | 3248 } // namespace compiler |
3251 } // namespace internal | 3249 } // namespace internal |
3252 } // namespace v8 | 3250 } // namespace v8 |
OLD | NEW |