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/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1516 Simd128Value* a = Simd128Value::cast(this); | 1516 Simd128Value* a = Simd128Value::cast(this); |
1517 Simd128Value* b = Simd128Value::cast(other); | 1517 Simd128Value* b = Simd128Value::cast(other); |
1518 return a->map() == b->map() && a->BitwiseEquals(b); | 1518 return a->map() == b->map() && a->BitwiseEquals(b); |
1519 } | 1519 } |
1520 return false; | 1520 return false; |
1521 } | 1521 } |
1522 | 1522 |
1523 | 1523 |
1524 MaybeHandle<Object> Object::ArraySpeciesConstructor( | 1524 MaybeHandle<Object> Object::ArraySpeciesConstructor( |
1525 Isolate* isolate, Handle<Object> original_array) { | 1525 Isolate* isolate, Handle<Object> original_array) { |
1526 Handle<Context> native_context = isolate->native_context(); | |
1527 Handle<Object> default_species = isolate->array_function(); | 1526 Handle<Object> default_species = isolate->array_function(); |
1528 if (!FLAG_harmony_species) { | 1527 if (!FLAG_harmony_species) { |
1529 return default_species; | 1528 return default_species; |
1530 } | 1529 } |
1531 if (original_array->IsJSArray() && | 1530 if (original_array->IsJSArray() && |
1532 Handle<JSReceiver>::cast(original_array)->map()->new_target_is_base() && | 1531 Handle<JSReceiver>::cast(original_array)->map()->new_target_is_base() && |
1533 isolate->IsArraySpeciesLookupChainIntact()) { | 1532 isolate->IsArraySpeciesLookupChainIntact()) { |
1534 return default_species; | 1533 return default_species; |
1535 } | 1534 } |
1536 Handle<Object> constructor = isolate->factory()->undefined_value(); | 1535 Handle<Object> constructor = isolate->factory()->undefined_value(); |
1537 Maybe<bool> is_array = Object::IsArray(original_array); | 1536 Maybe<bool> is_array = Object::IsArray(original_array); |
1538 MAYBE_RETURN_NULL(is_array); | 1537 MAYBE_RETURN_NULL(is_array); |
1539 if (is_array.FromJust()) { | 1538 if (is_array.FromJust()) { |
1540 ASSIGN_RETURN_ON_EXCEPTION( | 1539 ASSIGN_RETURN_ON_EXCEPTION( |
1541 isolate, constructor, | 1540 isolate, constructor, |
1542 Object::GetProperty(original_array, | 1541 Object::GetProperty(original_array, |
1543 isolate->factory()->constructor_string()), | 1542 isolate->factory()->constructor_string()), |
1544 Object); | 1543 Object); |
1545 if (constructor->IsConstructor()) { | 1544 if (constructor->IsConstructor()) { |
1546 Handle<Context> constructor_context; | 1545 Handle<Context> constructor_context; |
1547 ASSIGN_RETURN_ON_EXCEPTION( | 1546 ASSIGN_RETURN_ON_EXCEPTION( |
1548 isolate, constructor_context, | 1547 isolate, constructor_context, |
1549 JSReceiver::GetFunctionRealm(Handle<JSReceiver>::cast(constructor)), | 1548 JSReceiver::GetFunctionRealm(Handle<JSReceiver>::cast(constructor)), |
1550 Object); | 1549 Object); |
1551 if (*constructor_context != *native_context && | 1550 if (*constructor_context != *isolate->native_context() && |
1552 *constructor == constructor_context->array_function()) { | 1551 *constructor == constructor_context->array_function()) { |
1553 constructor = isolate->factory()->undefined_value(); | 1552 constructor = isolate->factory()->undefined_value(); |
1554 } | 1553 } |
1555 } | 1554 } |
1556 if (constructor->IsJSReceiver()) { | 1555 if (constructor->IsJSReceiver()) { |
1557 ASSIGN_RETURN_ON_EXCEPTION( | 1556 ASSIGN_RETURN_ON_EXCEPTION( |
1558 isolate, constructor, | 1557 isolate, constructor, |
1559 JSReceiver::GetProperty(Handle<JSReceiver>::cast(constructor), | 1558 JSReceiver::GetProperty(Handle<JSReceiver>::cast(constructor), |
1560 isolate->factory()->species_symbol()), | 1559 isolate->factory()->species_symbol()), |
1561 Object); | 1560 Object); |
(...skipping 18192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19754 if (cell->value() != *new_value) { | 19753 if (cell->value() != *new_value) { |
19755 cell->set_value(*new_value); | 19754 cell->set_value(*new_value); |
19756 Isolate* isolate = cell->GetIsolate(); | 19755 Isolate* isolate = cell->GetIsolate(); |
19757 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19756 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
19758 isolate, DependentCode::kPropertyCellChangedGroup); | 19757 isolate, DependentCode::kPropertyCellChangedGroup); |
19759 } | 19758 } |
19760 } | 19759 } |
19761 | 19760 |
19762 } // namespace internal | 19761 } // namespace internal |
19763 } // namespace v8 | 19762 } // namespace v8 |
OLD | NEW |