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

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: Remove name table size hack. 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
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 1627
1628 #define FIELD_ADDR_CONST(p, offset) \ 1628 #define FIELD_ADDR_CONST(p, offset) \
1629 (reinterpret_cast<const byte*>(p) + offset - kHeapObjectTag) 1629 (reinterpret_cast<const byte*>(p) + offset - kHeapObjectTag)
1630 1630
1631 #define READ_INT32_FIELD(p, offset) \ 1631 #define READ_INT32_FIELD(p, offset) \
1632 (*reinterpret_cast<const int32_t*>(FIELD_ADDR_CONST(p, offset))) 1632 (*reinterpret_cast<const int32_t*>(FIELD_ADDR_CONST(p, offset)))
1633 1633
1634 #define READ_INT64_FIELD(p, offset) \ 1634 #define READ_INT64_FIELD(p, offset) \
1635 (*reinterpret_cast<const int64_t*>(FIELD_ADDR_CONST(p, offset))) 1635 (*reinterpret_cast<const int64_t*>(FIELD_ADDR_CONST(p, offset)))
1636 1636
1637 #define READ_BYTE_FIELD(p, offset) \
1638 (*reinterpret_cast<const byte*>(FIELD_ADDR_CONST(p, offset)))
1639
1637 1640
1638 bool Simd128Value::BitwiseEquals(const Simd128Value* other) const { 1641 bool Simd128Value::BitwiseEquals(const Simd128Value* other) const {
1639 return READ_INT64_FIELD(this, kValueOffset) == 1642 return READ_INT64_FIELD(this, kValueOffset) ==
1640 READ_INT64_FIELD(other, kValueOffset) && 1643 READ_INT64_FIELD(other, kValueOffset) &&
1641 READ_INT64_FIELD(this, kValueOffset + kInt64Size) == 1644 READ_INT64_FIELD(this, kValueOffset + kInt64Size) ==
1642 READ_INT64_FIELD(other, kValueOffset + kInt64Size); 1645 READ_INT64_FIELD(other, kValueOffset + kInt64Size);
1643 } 1646 }
1644 1647
1645 1648
1646 uint32_t Simd128Value::Hash() const { 1649 uint32_t Simd128Value::Hash() const {
1647 uint32_t seed = v8::internal::kZeroHashSeed; 1650 uint32_t seed = v8::internal::kZeroHashSeed;
1648 uint32_t hash; 1651 uint32_t hash;
1649 hash = ComputeIntegerHash(READ_INT32_FIELD(this, kValueOffset), seed); 1652 hash = ComputeIntegerHash(READ_INT32_FIELD(this, kValueOffset), seed);
1650 hash = ComputeIntegerHash( 1653 hash = ComputeIntegerHash(
1651 READ_INT32_FIELD(this, kValueOffset + 1 * kInt32Size), hash * 31); 1654 READ_INT32_FIELD(this, kValueOffset + 1 * kInt32Size), hash * 31);
1652 hash = ComputeIntegerHash( 1655 hash = ComputeIntegerHash(
1653 READ_INT32_FIELD(this, kValueOffset + 2 * kInt32Size), hash * 31); 1656 READ_INT32_FIELD(this, kValueOffset + 2 * kInt32Size), hash * 31);
1654 hash = ComputeIntegerHash( 1657 hash = ComputeIntegerHash(
1655 READ_INT32_FIELD(this, kValueOffset + 3 * kInt32Size), hash * 31); 1658 READ_INT32_FIELD(this, kValueOffset + 3 * kInt32Size), hash * 31);
1656 return hash; 1659 return hash;
1657 } 1660 }
1658 1661
1659 1662
1663 void Simd128Value::CopyBits(void* destination) const {
1664 memcpy(destination, &READ_BYTE_FIELD(this, kValueOffset), kSimd128Size);
1665 }
1666
1667
1660 String* JSReceiver::class_name() { 1668 String* JSReceiver::class_name() {
1661 if (IsJSFunction() || IsJSFunctionProxy()) { 1669 if (IsJSFunction() || IsJSFunctionProxy()) {
1662 return GetHeap()->Function_string(); 1670 return GetHeap()->Function_string();
1663 } 1671 }
1664 Object* maybe_constructor = map()->GetConstructor(); 1672 Object* maybe_constructor = map()->GetConstructor();
1665 if (maybe_constructor->IsJSFunction()) { 1673 if (maybe_constructor->IsJSFunction()) {
1666 JSFunction* constructor = JSFunction::cast(maybe_constructor); 1674 JSFunction* constructor = JSFunction::cast(maybe_constructor);
1667 return String::cast(constructor->shared()->instance_class_name()); 1675 return String::cast(constructor->shared()->instance_class_name());
1668 } 1676 }
1669 // If the constructor is not present, return "Object". 1677 // If the constructor is not present, return "Object".
(...skipping 14192 matching lines...) Expand 10 before | Expand all | Expand 10 after
15862 if (cell->value() != *new_value) { 15870 if (cell->value() != *new_value) {
15863 cell->set_value(*new_value); 15871 cell->set_value(*new_value);
15864 Isolate* isolate = cell->GetIsolate(); 15872 Isolate* isolate = cell->GetIsolate();
15865 cell->dependent_code()->DeoptimizeDependentCodeGroup( 15873 cell->dependent_code()->DeoptimizeDependentCodeGroup(
15866 isolate, DependentCode::kPropertyCellChangedGroup); 15874 isolate, DependentCode::kPropertyCellChangedGroup);
15867 } 15875 }
15868 } 15876 }
15869 15877
15870 } // namespace internal 15878 } // namespace internal
15871 } // namespace v8 15879 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698