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/deoptimizer.h" | 5 #include "src/deoptimizer.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
10 #include "src/assembler-inl.h" | 10 #include "src/assembler-inl.h" |
(...skipping 3053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3064 value_ = Handle<Object>(isolate()->factory()->NewNumber(uint32_value())); | 3064 value_ = Handle<Object>(isolate()->factory()->NewNumber(uint32_value())); |
3065 return; | 3065 return; |
3066 | 3066 |
3067 case kFloat: { | 3067 case kFloat: { |
3068 double scalar_value = float_value().get_scalar(); | 3068 double scalar_value = float_value().get_scalar(); |
3069 value_ = Handle<Object>(isolate()->factory()->NewNumber(scalar_value)); | 3069 value_ = Handle<Object>(isolate()->factory()->NewNumber(scalar_value)); |
3070 return; | 3070 return; |
3071 } | 3071 } |
3072 | 3072 |
3073 case kDouble: { | 3073 case kDouble: { |
3074 if (double_value().is_hole_nan()) { | |
3075 value_ = isolate()->factory()->hole_nan_value(); | |
3076 return; | |
3077 } | |
3078 double scalar_value = double_value().get_scalar(); | 3074 double scalar_value = double_value().get_scalar(); |
3079 value_ = Handle<Object>(isolate()->factory()->NewNumber(scalar_value)); | 3075 value_ = Handle<Object>(isolate()->factory()->NewNumber(scalar_value)); |
3080 return; | 3076 return; |
3081 } | 3077 } |
3082 | 3078 |
3083 case kCapturedObject: | 3079 case kCapturedObject: |
3084 case kDuplicatedObject: | 3080 case kDuplicatedObject: |
3085 case kArgumentsObject: | 3081 case kArgumentsObject: |
3086 case kInvalid: | 3082 case kInvalid: |
3087 case kTagged: | 3083 case kTagged: |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4106 int32_t length = 0; | 4102 int32_t length = 0; |
4107 CHECK(lengthObject->ToInt32(&length)); | 4103 CHECK(lengthObject->ToInt32(&length)); |
4108 Handle<FixedArrayBase> object = | 4104 Handle<FixedArrayBase> object = |
4109 isolate_->factory()->NewFixedDoubleArray(length); | 4105 isolate_->factory()->NewFixedDoubleArray(length); |
4110 slot->value_ = object; | 4106 slot->value_ = object; |
4111 if (length > 0) { | 4107 if (length > 0) { |
4112 Handle<FixedDoubleArray> double_array = | 4108 Handle<FixedDoubleArray> double_array = |
4113 Handle<FixedDoubleArray>::cast(object); | 4109 Handle<FixedDoubleArray>::cast(object); |
4114 for (int i = 0; i < length; ++i) { | 4110 for (int i = 0; i < length; ++i) { |
4115 Handle<Object> value = materializer.FieldAt(value_index); | 4111 Handle<Object> value = materializer.FieldAt(value_index); |
4116 CHECK(value->IsNumber()); | 4112 if (value.is_identical_to(isolate_->factory()->the_hole_value())) { |
4117 if (value.is_identical_to(isolate_->factory()->hole_nan_value())) { | |
4118 double_array->set_the_hole(isolate_, i); | 4113 double_array->set_the_hole(isolate_, i); |
4119 } else { | 4114 } else { |
| 4115 CHECK(value->IsNumber()); |
4120 double_array->set(i, value->Number()); | 4116 double_array->set(i, value->Number()); |
4121 } | 4117 } |
4122 } | 4118 } |
4123 } | 4119 } |
4124 return object; | 4120 return object; |
4125 } | 4121 } |
4126 case STRING_TYPE: | 4122 case STRING_TYPE: |
4127 case ONE_BYTE_STRING_TYPE: | 4123 case ONE_BYTE_STRING_TYPE: |
4128 case CONS_ONE_BYTE_STRING_TYPE: | 4124 case CONS_ONE_BYTE_STRING_TYPE: |
4129 case SLICED_STRING_TYPE: | 4125 case SLICED_STRING_TYPE: |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4447 CHECK(value_info->IsMaterializedObject()); | 4443 CHECK(value_info->IsMaterializedObject()); |
4448 | 4444 |
4449 value_info->value_ = | 4445 value_info->value_ = |
4450 Handle<Object>(previously_materialized_objects->get(i), isolate_); | 4446 Handle<Object>(previously_materialized_objects->get(i), isolate_); |
4451 } | 4447 } |
4452 } | 4448 } |
4453 } | 4449 } |
4454 | 4450 |
4455 } // namespace internal | 4451 } // namespace internal |
4456 } // namespace v8 | 4452 } // namespace v8 |
OLD | NEW |