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 <iomanip> | 5 #include <iomanip> |
6 #include <sstream> | 6 #include <sstream> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 if (object->IsJSReceiver()) return Handle<JSReceiver>::cast(object); | 75 if (object->IsJSReceiver()) return Handle<JSReceiver>::cast(object); |
76 Handle<JSFunction> constructor; | 76 Handle<JSFunction> constructor; |
77 if (object->IsNumber()) { | 77 if (object->IsNumber()) { |
78 constructor = handle(native_context->number_function(), isolate); | 78 constructor = handle(native_context->number_function(), isolate); |
79 } else if (object->IsBoolean()) { | 79 } else if (object->IsBoolean()) { |
80 constructor = handle(native_context->boolean_function(), isolate); | 80 constructor = handle(native_context->boolean_function(), isolate); |
81 } else if (object->IsString()) { | 81 } else if (object->IsString()) { |
82 constructor = handle(native_context->string_function(), isolate); | 82 constructor = handle(native_context->string_function(), isolate); |
83 } else if (object->IsSymbol()) { | 83 } else if (object->IsSymbol()) { |
84 constructor = handle(native_context->symbol_function(), isolate); | 84 constructor = handle(native_context->symbol_function(), isolate); |
85 } else if (object->IsFloat32x4()) { | 85 } else if (object->IsSimd128Value()) { |
86 constructor = handle(native_context->float32x4_function(), isolate); | 86 if (object->IsFloat32x4()) { |
| 87 constructor = handle(native_context->float32x4_function(), isolate); |
| 88 } else if (object->IsInt32x4()) { |
| 89 constructor = handle(native_context->int32x4_function(), isolate); |
| 90 } else if (object->IsBool32x4()) { |
| 91 constructor = handle(native_context->bool32x4_function(), isolate); |
| 92 } else if (object->IsInt16x8()) { |
| 93 constructor = handle(native_context->int16x8_function(), isolate); |
| 94 } else if (object->IsBool16x8()) { |
| 95 constructor = handle(native_context->bool16x8_function(), isolate); |
| 96 } else if (object->IsInt8x16()) { |
| 97 constructor = handle(native_context->int8x16_function(), isolate); |
| 98 } else if (object->IsBool8x16()) { |
| 99 constructor = handle(native_context->bool8x16_function(), isolate); |
| 100 } else { |
| 101 UNREACHABLE(); |
| 102 } |
87 } else { | 103 } else { |
88 return MaybeHandle<JSReceiver>(); | 104 return MaybeHandle<JSReceiver>(); |
89 } | 105 } |
90 Handle<JSObject> result = isolate->factory()->NewJSObject(constructor); | 106 Handle<JSObject> result = isolate->factory()->NewJSObject(constructor); |
91 Handle<JSValue>::cast(result)->set_value(*object); | 107 Handle<JSValue>::cast(result)->set_value(*object); |
92 return result; | 108 return result; |
93 } | 109 } |
94 | 110 |
95 | 111 |
96 bool Object::BooleanValue() { | 112 bool Object::BooleanValue() { |
97 if (IsBoolean()) return IsTrue(); | 113 if (IsBoolean()) return IsTrue(); |
98 if (IsSmi()) return Smi::cast(this)->value() != 0; | 114 if (IsSmi()) return Smi::cast(this)->value() != 0; |
99 if (IsUndefined() || IsNull()) return false; | 115 if (IsUndefined() || IsNull()) return false; |
100 if (IsUndetectableObject()) return false; // Undetectable object is false. | 116 if (IsUndetectableObject()) return false; // Undetectable object is false. |
101 if (IsString()) return String::cast(this)->length() != 0; | 117 if (IsString()) return String::cast(this)->length() != 0; |
102 if (IsHeapNumber()) return HeapNumber::cast(this)->HeapNumberBooleanValue(); | 118 if (IsHeapNumber()) return HeapNumber::cast(this)->HeapNumberBooleanValue(); |
103 if (IsFloat32x4()) return true; // Simd value types always evaluate to true. | 119 if (IsSimd128Value()) return true; // Simd value types evaluate to true. |
104 return true; | 120 return true; |
105 } | 121 } |
106 | 122 |
107 | 123 |
108 bool Object::IsCallable() const { | 124 bool Object::IsCallable() const { |
109 const Object* fun = this; | 125 const Object* fun = this; |
110 while (fun->IsJSFunctionProxy()) { | 126 while (fun->IsJSFunctionProxy()) { |
111 fun = JSFunctionProxy::cast(fun)->call_trap(); | 127 fun = JSFunctionProxy::cast(fun)->call_trap(); |
112 } | 128 } |
113 return fun->IsJSFunction() || | 129 return fun->IsJSFunction() || |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 } | 638 } |
623 if (heap_object->IsString()) { | 639 if (heap_object->IsString()) { |
624 return context->string_function()->initial_map(); | 640 return context->string_function()->initial_map(); |
625 } | 641 } |
626 if (heap_object->IsSymbol()) { | 642 if (heap_object->IsSymbol()) { |
627 return context->symbol_function()->initial_map(); | 643 return context->symbol_function()->initial_map(); |
628 } | 644 } |
629 if (heap_object->IsBoolean()) { | 645 if (heap_object->IsBoolean()) { |
630 return context->boolean_function()->initial_map(); | 646 return context->boolean_function()->initial_map(); |
631 } | 647 } |
632 if (heap_object->IsFloat32x4()) { | 648 if (heap_object->IsSimd128Value()) { |
633 return context->float32x4_function()->initial_map(); | 649 if (heap_object->IsFloat32x4()) { |
| 650 return context->float32x4_function()->initial_map(); |
| 651 } else if (heap_object->IsInt32x4()) { |
| 652 return context->int32x4_function()->initial_map(); |
| 653 } else if (heap_object->IsBool32x4()) { |
| 654 return context->bool32x4_function()->initial_map(); |
| 655 } else if (heap_object->IsInt16x8()) { |
| 656 return context->int16x8_function()->initial_map(); |
| 657 } else if (heap_object->IsBool16x8()) { |
| 658 return context->bool16x8_function()->initial_map(); |
| 659 } else if (heap_object->IsInt8x16()) { |
| 660 return context->int8x16_function()->initial_map(); |
| 661 } else if (heap_object->IsBool8x16()) { |
| 662 return context->bool8x16_function()->initial_map(); |
| 663 } else { |
| 664 UNREACHABLE(); |
| 665 } |
634 } | 666 } |
635 return isolate->heap()->null_value()->map(); | 667 return isolate->heap()->null_value()->map(); |
636 } | 668 } |
637 | 669 |
638 | 670 |
639 Object* Object::GetHash() { | 671 Object* Object::GetHash() { |
640 Object* hash = GetSimpleHash(); | 672 Object* hash = GetSimpleHash(); |
641 if (hash->IsSmi()) return hash; | 673 if (hash->IsSmi()) return hash; |
642 | 674 |
643 DCHECK(IsJSReceiver()); | 675 DCHECK(IsJSReceiver()); |
(...skipping 19 matching lines...) Expand all Loading... |
663 return Smi::FromInt(hash & Smi::kMaxValue); | 695 return Smi::FromInt(hash & Smi::kMaxValue); |
664 } | 696 } |
665 if (IsName()) { | 697 if (IsName()) { |
666 uint32_t hash = Name::cast(this)->Hash(); | 698 uint32_t hash = Name::cast(this)->Hash(); |
667 return Smi::FromInt(hash); | 699 return Smi::FromInt(hash); |
668 } | 700 } |
669 if (IsOddball()) { | 701 if (IsOddball()) { |
670 uint32_t hash = Oddball::cast(this)->to_string()->Hash(); | 702 uint32_t hash = Oddball::cast(this)->to_string()->Hash(); |
671 return Smi::FromInt(hash); | 703 return Smi::FromInt(hash); |
672 } | 704 } |
673 if (IsFloat32x4()) { | 705 if (IsSimd128Value()) { |
674 Float32x4* simd = Float32x4::cast(this); | 706 uint32_t hash = Simd128Value::cast(this)->Hash(); |
675 uint32_t seed = v8::internal::kZeroHashSeed; | |
676 uint32_t hash; | |
677 hash = ComputeIntegerHash(bit_cast<uint32_t>(simd->get_lane(0)), seed); | |
678 hash = ComputeIntegerHash(bit_cast<uint32_t>(simd->get_lane(1)), hash * 31); | |
679 hash = ComputeIntegerHash(bit_cast<uint32_t>(simd->get_lane(2)), hash * 31); | |
680 hash = ComputeIntegerHash(bit_cast<uint32_t>(simd->get_lane(3)), hash * 31); | |
681 return Smi::FromInt(hash & Smi::kMaxValue); | 707 return Smi::FromInt(hash & Smi::kMaxValue); |
682 } | 708 } |
683 DCHECK(IsJSReceiver()); | 709 DCHECK(IsJSReceiver()); |
684 JSReceiver* receiver = JSReceiver::cast(this); | 710 JSReceiver* receiver = JSReceiver::cast(this); |
685 return receiver->GetHeap()->undefined_value(); | 711 return receiver->GetHeap()->undefined_value(); |
686 } | 712 } |
687 | 713 |
688 | 714 |
689 Handle<Smi> Object::GetOrCreateHash(Isolate* isolate, Handle<Object> object) { | 715 Handle<Smi> Object::GetOrCreateHash(Isolate* isolate, Handle<Object> object) { |
690 Handle<Object> hash(object->GetSimpleHash(), isolate); | 716 Handle<Object> hash(object->GetSimpleHash(), isolate); |
691 if (hash->IsSmi()) return Handle<Smi>::cast(hash); | 717 if (hash->IsSmi()) return Handle<Smi>::cast(hash); |
692 | 718 |
693 DCHECK(object->IsJSReceiver()); | 719 DCHECK(object->IsJSReceiver()); |
694 return JSReceiver::GetOrCreateIdentityHash(Handle<JSReceiver>::cast(object)); | 720 return JSReceiver::GetOrCreateIdentityHash(Handle<JSReceiver>::cast(object)); |
695 } | 721 } |
696 | 722 |
697 | 723 |
698 bool Object::SameValue(Object* other) { | 724 bool Object::SameValue(Object* other) { |
699 if (other == this) return true; | 725 if (other == this) return true; |
700 | 726 |
701 // The object is either a number, a name, an odd-ball, | 727 // The object is either a number, a name, an odd-ball, |
702 // a real JS object, or a Harmony proxy. | 728 // a real JS object, or a Harmony proxy. |
703 if (IsNumber() && other->IsNumber()) { | 729 if (IsNumber() && other->IsNumber()) { |
704 return v8::internal::SameValue(Number(), other->Number()); | 730 double this_value = Number(); |
| 731 double other_value = other->Number(); |
| 732 // SameValue(NaN, NaN) is true. |
| 733 if (this_value != other_value) { |
| 734 return std::isnan(this_value) && std::isnan(other_value); |
| 735 } |
| 736 // SameValue(0.0, -0.0) is false. |
| 737 return (std::signbit(this_value) == std::signbit(other_value)); |
705 } | 738 } |
706 if (IsString() && other->IsString()) { | 739 if (IsString() && other->IsString()) { |
707 return String::cast(this)->Equals(String::cast(other)); | 740 return String::cast(this)->Equals(String::cast(other)); |
708 } | 741 } |
709 if (IsFloat32x4() && other->IsFloat32x4()) { | 742 if (IsSimd128Value() && other->IsSimd128Value()) { |
710 Float32x4* x = Float32x4::cast(this); | 743 if (IsFloat32x4() && other->IsFloat32x4()) { |
711 Float32x4* y = Float32x4::cast(other); | 744 Float32x4* a = Float32x4::cast(this); |
712 return v8::internal::SameValue(x->get_lane(0), y->get_lane(0)) && | 745 Float32x4* b = Float32x4::cast(other); |
713 v8::internal::SameValue(x->get_lane(1), y->get_lane(1)) && | 746 for (int i = 0; i < 4; i++) { |
714 v8::internal::SameValue(x->get_lane(2), y->get_lane(2)) && | 747 float x = a->get_lane(i); |
715 v8::internal::SameValue(x->get_lane(3), y->get_lane(3)); | 748 float y = b->get_lane(i); |
| 749 // Implements the ES5 SameValue operation for floating point types. |
| 750 // http://www.ecma-international.org/ecma-262/6.0/#sec-samevalue |
| 751 if (x != y && !(std::isnan(x) && std::isnan(y))) return false; |
| 752 if (std::signbit(x) != std::signbit(y)) return false; |
| 753 } |
| 754 return true; |
| 755 } else { |
| 756 Simd128Value* a = Simd128Value::cast(this); |
| 757 Simd128Value* b = Simd128Value::cast(other); |
| 758 return a->map()->instance_type() == b->map()->instance_type() && |
| 759 a->BitwiseEquals(b); |
| 760 } |
716 } | 761 } |
717 return false; | 762 return false; |
718 } | 763 } |
719 | 764 |
720 | 765 |
721 bool Object::SameValueZero(Object* other) { | 766 bool Object::SameValueZero(Object* other) { |
722 if (other == this) return true; | 767 if (other == this) return true; |
723 | 768 |
724 // The object is either a number, a name, an odd-ball, | 769 // The object is either a number, a name, an odd-ball, |
725 // a real JS object, or a Harmony proxy. | 770 // a real JS object, or a Harmony proxy. |
726 if (IsNumber() && other->IsNumber()) { | 771 if (IsNumber() && other->IsNumber()) { |
727 return v8::internal::SameValueZero(Number(), other->Number()); | 772 double this_value = Number(); |
| 773 double other_value = other->Number(); |
| 774 // +0 == -0 is true |
| 775 return this_value == other_value || |
| 776 (std::isnan(this_value) && std::isnan(other_value)); |
728 } | 777 } |
729 if (IsString() && other->IsString()) { | 778 if (IsString() && other->IsString()) { |
730 return String::cast(this)->Equals(String::cast(other)); | 779 return String::cast(this)->Equals(String::cast(other)); |
731 } | 780 } |
732 if (IsFloat32x4() && other->IsFloat32x4()) { | 781 if (IsSimd128Value() && other->IsSimd128Value()) { |
733 Float32x4* x = Float32x4::cast(this); | 782 if (IsFloat32x4() && other->IsFloat32x4()) { |
734 Float32x4* y = Float32x4::cast(other); | 783 Float32x4* a = Float32x4::cast(this); |
735 return v8::internal::SameValueZero(x->get_lane(0), y->get_lane(0)) && | 784 Float32x4* b = Float32x4::cast(other); |
736 v8::internal::SameValueZero(x->get_lane(1), y->get_lane(1)) && | 785 for (int i = 0; i < 4; i++) { |
737 v8::internal::SameValueZero(x->get_lane(2), y->get_lane(2)) && | 786 float x = a->get_lane(i); |
738 v8::internal::SameValueZero(x->get_lane(3), y->get_lane(3)); | 787 float y = b->get_lane(i); |
| 788 // Implements the ES6 SameValueZero operation for floating point types. |
| 789 // http://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero |
| 790 if (x != y && !(std::isnan(x) && std::isnan(y))) return false; |
| 791 // SameValueZero doesn't distinguish between 0 and -0. |
| 792 } |
| 793 return true; |
| 794 } else { |
| 795 Simd128Value* a = Simd128Value::cast(this); |
| 796 Simd128Value* b = Simd128Value::cast(other); |
| 797 return a->map()->instance_type() == b->map()->instance_type() && |
| 798 a->BitwiseEquals(b); |
| 799 } |
739 } | 800 } |
740 return false; | 801 return false; |
741 } | 802 } |
742 | 803 |
743 | 804 |
744 void Object::ShortPrint(FILE* out) { | 805 void Object::ShortPrint(FILE* out) { |
745 OFStream os(out); | 806 OFStream os(out); |
746 os << Brief(this); | 807 os << Brief(this); |
747 } | 808 } |
748 | 809 |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 HeapNumber::cast(this)->HeapNumberPrint(os); | 1401 HeapNumber::cast(this)->HeapNumberPrint(os); |
1341 os << ">"; | 1402 os << ">"; |
1342 break; | 1403 break; |
1343 } | 1404 } |
1344 case MUTABLE_HEAP_NUMBER_TYPE: { | 1405 case MUTABLE_HEAP_NUMBER_TYPE: { |
1345 os << "<MutableNumber: "; | 1406 os << "<MutableNumber: "; |
1346 HeapNumber::cast(this)->HeapNumberPrint(os); | 1407 HeapNumber::cast(this)->HeapNumberPrint(os); |
1347 os << '>'; | 1408 os << '>'; |
1348 break; | 1409 break; |
1349 } | 1410 } |
1350 case FLOAT32X4_TYPE: { | 1411 case FLOAT32X4_TYPE: |
1351 os << "<Float32x4: "; | 1412 os << "<Float32x4>"; |
1352 Float32x4::cast(this)->Float32x4Print(os); | |
1353 os << ">"; | |
1354 break; | 1413 break; |
1355 } | 1414 case INT32X4_TYPE: |
| 1415 os << "<Int32x4>"; |
| 1416 break; |
| 1417 case BOOL32X4_TYPE: |
| 1418 os << "<Bool32x4>"; |
| 1419 break; |
| 1420 case INT16X8_TYPE: |
| 1421 os << "<Int16x8>"; |
| 1422 break; |
| 1423 case BOOL16X8_TYPE: |
| 1424 os << "<Bool16x8>"; |
| 1425 break; |
| 1426 case INT8X16_TYPE: |
| 1427 os << "<Int8x16>"; |
| 1428 break; |
| 1429 case BOOL8X16_TYPE: |
| 1430 os << "<Bool8x16>"; |
| 1431 break; |
1356 case JS_PROXY_TYPE: | 1432 case JS_PROXY_TYPE: |
1357 os << "<JSProxy>"; | 1433 os << "<JSProxy>"; |
1358 break; | 1434 break; |
1359 case JS_FUNCTION_PROXY_TYPE: | 1435 case JS_FUNCTION_PROXY_TYPE: |
1360 os << "<JSFunctionProxy>"; | 1436 os << "<JSFunctionProxy>"; |
1361 break; | 1437 break; |
1362 case FOREIGN_TYPE: | 1438 case FOREIGN_TYPE: |
1363 os << "<Foreign>"; | 1439 os << "<Foreign>"; |
1364 break; | 1440 break; |
1365 case CELL_TYPE: { | 1441 case CELL_TYPE: { |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1490 case WEAK_CELL_TYPE: | 1566 case WEAK_CELL_TYPE: |
1491 WeakCell::BodyDescriptor::IterateBody(this, v); | 1567 WeakCell::BodyDescriptor::IterateBody(this, v); |
1492 break; | 1568 break; |
1493 case SYMBOL_TYPE: | 1569 case SYMBOL_TYPE: |
1494 Symbol::BodyDescriptor::IterateBody(this, v); | 1570 Symbol::BodyDescriptor::IterateBody(this, v); |
1495 break; | 1571 break; |
1496 | 1572 |
1497 case HEAP_NUMBER_TYPE: | 1573 case HEAP_NUMBER_TYPE: |
1498 case MUTABLE_HEAP_NUMBER_TYPE: | 1574 case MUTABLE_HEAP_NUMBER_TYPE: |
1499 case FLOAT32X4_TYPE: | 1575 case FLOAT32X4_TYPE: |
| 1576 case INT32X4_TYPE: |
| 1577 case BOOL32X4_TYPE: |
| 1578 case INT16X8_TYPE: |
| 1579 case BOOL16X8_TYPE: |
| 1580 case INT8X16_TYPE: |
| 1581 case BOOL8X16_TYPE: |
1500 case FILLER_TYPE: | 1582 case FILLER_TYPE: |
1501 case BYTE_ARRAY_TYPE: | 1583 case BYTE_ARRAY_TYPE: |
1502 case BYTECODE_ARRAY_TYPE: | 1584 case BYTECODE_ARRAY_TYPE: |
1503 case FREE_SPACE_TYPE: | 1585 case FREE_SPACE_TYPE: |
1504 break; | 1586 break; |
1505 | 1587 |
1506 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ | 1588 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ |
1507 case FIXED_##TYPE##_ARRAY_TYPE: \ | 1589 case FIXED_##TYPE##_ARRAY_TYPE: \ |
1508 reinterpret_cast<FixedTypedArrayBase*>(this) \ | 1590 reinterpret_cast<FixedTypedArrayBase*>(this) \ |
1509 ->FixedTypedArrayBaseIterateBody(v); \ | 1591 ->FixedTypedArrayBaseIterateBody(v); \ |
(...skipping 28 matching lines...) Expand all Loading... |
1538 bool HeapNumber::HeapNumberBooleanValue() { | 1620 bool HeapNumber::HeapNumberBooleanValue() { |
1539 return DoubleToBoolean(value()); | 1621 return DoubleToBoolean(value()); |
1540 } | 1622 } |
1541 | 1623 |
1542 | 1624 |
1543 void HeapNumber::HeapNumberPrint(std::ostream& os) { // NOLINT | 1625 void HeapNumber::HeapNumberPrint(std::ostream& os) { // NOLINT |
1544 os << value(); | 1626 os << value(); |
1545 } | 1627 } |
1546 | 1628 |
1547 | 1629 |
1548 void Float32x4::Float32x4Print(std::ostream& os) { // NOLINT | 1630 #define FIELD_ADDR_CONST(p, offset) \ |
1549 char arr[100]; | 1631 (reinterpret_cast<const byte*>(p) + offset - kHeapObjectTag) |
1550 Vector<char> buffer(arr, arraysize(arr)); | 1632 |
1551 os << std::string(DoubleToCString(get_lane(0), buffer)) << ", " | 1633 #define READ_INT32_FIELD(p, offset) \ |
1552 << std::string(DoubleToCString(get_lane(1), buffer)) << ", " | 1634 (*reinterpret_cast<const int32_t*>(FIELD_ADDR_CONST(p, offset))) |
1553 << std::string(DoubleToCString(get_lane(2), buffer)) << ", " | 1635 |
1554 << std::string(DoubleToCString(get_lane(3), buffer)); | 1636 #define READ_INT64_FIELD(p, offset) \ |
| 1637 (*reinterpret_cast<const int64_t*>(FIELD_ADDR_CONST(p, offset))) |
| 1638 |
| 1639 |
| 1640 bool Simd128Value::BitwiseEquals(const Simd128Value* other) const { |
| 1641 return READ_INT64_FIELD(this, kValueOffset) == |
| 1642 READ_INT64_FIELD(other, kValueOffset) && |
| 1643 READ_INT64_FIELD(this, kValueOffset + kInt64Size) == |
| 1644 READ_INT64_FIELD(other, kValueOffset + kInt64Size); |
1555 } | 1645 } |
1556 | 1646 |
1557 | 1647 |
| 1648 uint32_t Simd128Value::Hash() const { |
| 1649 uint32_t seed = v8::internal::kZeroHashSeed; |
| 1650 uint32_t hash; |
| 1651 hash = ComputeIntegerHash(READ_INT32_FIELD(this, kValueOffset), seed); |
| 1652 hash = ComputeIntegerHash( |
| 1653 READ_INT32_FIELD(this, kValueOffset + 1 * kInt32Size), hash * 31); |
| 1654 hash = ComputeIntegerHash( |
| 1655 READ_INT32_FIELD(this, kValueOffset + 2 * kInt32Size), hash * 31); |
| 1656 hash = ComputeIntegerHash( |
| 1657 READ_INT32_FIELD(this, kValueOffset + 3 * kInt32Size), hash * 31); |
| 1658 return hash; |
| 1659 } |
| 1660 |
| 1661 |
1558 String* JSReceiver::class_name() { | 1662 String* JSReceiver::class_name() { |
1559 if (IsJSFunction() || IsJSFunctionProxy()) { | 1663 if (IsJSFunction() || IsJSFunctionProxy()) { |
1560 return GetHeap()->Function_string(); | 1664 return GetHeap()->Function_string(); |
1561 } | 1665 } |
1562 Object* maybe_constructor = map()->GetConstructor(); | 1666 Object* maybe_constructor = map()->GetConstructor(); |
1563 if (maybe_constructor->IsJSFunction()) { | 1667 if (maybe_constructor->IsJSFunction()) { |
1564 JSFunction* constructor = JSFunction::cast(maybe_constructor); | 1668 JSFunction* constructor = JSFunction::cast(maybe_constructor); |
1565 return String::cast(constructor->shared()->instance_class_name()); | 1669 return String::cast(constructor->shared()->instance_class_name()); |
1566 } | 1670 } |
1567 // If the constructor is not present, return "Object". | 1671 // If the constructor is not present, return "Object". |
(...skipping 14204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15772 if (cell->value() != *new_value) { | 15876 if (cell->value() != *new_value) { |
15773 cell->set_value(*new_value); | 15877 cell->set_value(*new_value); |
15774 Isolate* isolate = cell->GetIsolate(); | 15878 Isolate* isolate = cell->GetIsolate(); |
15775 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 15879 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
15776 isolate, DependentCode::kPropertyCellChangedGroup); | 15880 isolate, DependentCode::kPropertyCellChangedGroup); |
15777 } | 15881 } |
15778 } | 15882 } |
15779 | 15883 |
15780 } // namespace internal | 15884 } // namespace internal |
15781 } // namespace v8 | 15885 } // namespace v8 |
OLD | NEW |