Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: src/objects.cc

Issue 1230343003: V8: Add SIMD functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after
1629 1629
1630 #define FIELD_ADDR_CONST(p, offset) \ 1630 #define FIELD_ADDR_CONST(p, offset) \
1631 (reinterpret_cast<const byte*>(p) + offset - kHeapObjectTag) 1631 (reinterpret_cast<const byte*>(p) + offset - kHeapObjectTag)
1632 1632
1633 #define READ_INT32_FIELD(p, offset) \ 1633 #define READ_INT32_FIELD(p, offset) \
1634 (*reinterpret_cast<const int32_t*>(FIELD_ADDR_CONST(p, offset))) 1634 (*reinterpret_cast<const int32_t*>(FIELD_ADDR_CONST(p, offset)))
1635 1635
1636 #define READ_INT64_FIELD(p, offset) \ 1636 #define READ_INT64_FIELD(p, offset) \
1637 (*reinterpret_cast<const int64_t*>(FIELD_ADDR_CONST(p, offset))) 1637 (*reinterpret_cast<const int64_t*>(FIELD_ADDR_CONST(p, offset)))
1638 1638
1639 #define READ_BYTE_FIELD(p, offset) \
1640 (*reinterpret_cast<const byte*>(FIELD_ADDR_CONST(p, offset)))
1641
1639 1642
1640 bool Simd128Value::BitwiseEquals(const Simd128Value* other) const { 1643 bool Simd128Value::BitwiseEquals(const Simd128Value* other) const {
1641 return READ_INT64_FIELD(this, kValueOffset) == 1644 return READ_INT64_FIELD(this, kValueOffset) ==
1642 READ_INT64_FIELD(other, kValueOffset) && 1645 READ_INT64_FIELD(other, kValueOffset) &&
1643 READ_INT64_FIELD(this, kValueOffset + kInt64Size) == 1646 READ_INT64_FIELD(this, kValueOffset + kInt64Size) ==
1644 READ_INT64_FIELD(other, kValueOffset + kInt64Size); 1647 READ_INT64_FIELD(other, kValueOffset + kInt64Size);
1645 } 1648 }
1646 1649
1647 1650
1648 uint32_t Simd128Value::Hash() const { 1651 uint32_t Simd128Value::Hash() const {
1649 uint32_t seed = v8::internal::kZeroHashSeed; 1652 uint32_t seed = v8::internal::kZeroHashSeed;
1650 uint32_t hash; 1653 uint32_t hash;
1651 hash = ComputeIntegerHash(READ_INT32_FIELD(this, kValueOffset), seed); 1654 hash = ComputeIntegerHash(READ_INT32_FIELD(this, kValueOffset), seed);
1652 hash = ComputeIntegerHash( 1655 hash = ComputeIntegerHash(
1653 READ_INT32_FIELD(this, kValueOffset + 1 * kInt32Size), hash * 31); 1656 READ_INT32_FIELD(this, kValueOffset + 1 * kInt32Size), hash * 31);
1654 hash = ComputeIntegerHash( 1657 hash = ComputeIntegerHash(
1655 READ_INT32_FIELD(this, kValueOffset + 2 * kInt32Size), hash * 31); 1658 READ_INT32_FIELD(this, kValueOffset + 2 * kInt32Size), hash * 31);
1656 hash = ComputeIntegerHash( 1659 hash = ComputeIntegerHash(
1657 READ_INT32_FIELD(this, kValueOffset + 3 * kInt32Size), hash * 31); 1660 READ_INT32_FIELD(this, kValueOffset + 3 * kInt32Size), hash * 31);
1658 return hash; 1661 return hash;
1659 } 1662 }
1660 1663
1661 1664
1665 void Simd128Value::CopyBits(void* destination) const {
1666 memcpy(destination, &READ_BYTE_FIELD(this, kValueOffset), kSimd128Size);
1667 }
1668
1669
1662 String* JSReceiver::class_name() { 1670 String* JSReceiver::class_name() {
1663 if (IsJSFunction() || IsJSFunctionProxy()) { 1671 if (IsJSFunction() || IsJSFunctionProxy()) {
1664 return GetHeap()->Function_string(); 1672 return GetHeap()->Function_string();
1665 } 1673 }
1666 Object* maybe_constructor = map()->GetConstructor(); 1674 Object* maybe_constructor = map()->GetConstructor();
1667 if (maybe_constructor->IsJSFunction()) { 1675 if (maybe_constructor->IsJSFunction()) {
1668 JSFunction* constructor = JSFunction::cast(maybe_constructor); 1676 JSFunction* constructor = JSFunction::cast(maybe_constructor);
1669 return String::cast(constructor->shared()->instance_class_name()); 1677 return String::cast(constructor->shared()->instance_class_name());
1670 } 1678 }
1671 // If the constructor is not present, return "Object". 1679 // If the constructor is not present, return "Object".
(...skipping 14223 matching lines...) Expand 10 before | Expand all | Expand 10 after
15895 if (cell->value() != *new_value) { 15903 if (cell->value() != *new_value) {
15896 cell->set_value(*new_value); 15904 cell->set_value(*new_value);
15897 Isolate* isolate = cell->GetIsolate(); 15905 Isolate* isolate = cell->GetIsolate();
15898 cell->dependent_code()->DeoptimizeDependentCodeGroup( 15906 cell->dependent_code()->DeoptimizeDependentCodeGroup(
15899 isolate, DependentCode::kPropertyCellChangedGroup); 15907 isolate, DependentCode::kPropertyCellChangedGroup);
15900 } 15908 }
15901 } 15909 }
15902 15910
15903 } // namespace internal 15911 } // namespace internal
15904 } // namespace v8 15912 } // namespace v8
OLDNEW
« src/heap/heap.cc ('K') | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698