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

Unified Diff: src/compiler/access-builder.cc

Issue 1409763004: [types] Use the TypeCache consistently for common types. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/access-builder.h ('k') | src/compiler/js-intrinsic-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/access-builder.cc
diff --git a/src/compiler/access-builder.cc b/src/compiler/access-builder.cc
index d52ca94d3ef704cbb063ec4a44c0aa0083124c27..791453c3dfc005cf2212f564614473097c082885 100644
--- a/src/compiler/access-builder.cc
+++ b/src/compiler/access-builder.cc
@@ -3,6 +3,11 @@
// found in the LICENSE file.
#include "src/compiler/access-builder.h"
+
+#include "src/contexts.h"
+#include "src/frames.h"
+#include "src/heap/heap.h"
+#include "src/type-cache.h"
#include "src/types-inl.h"
namespace v8 {
@@ -20,7 +25,7 @@ FieldAccess AccessBuilder::ForMap() {
// static
FieldAccess AccessBuilder::ForJSObjectProperties() {
FieldAccess access = {kTaggedBase, JSObject::kPropertiesOffset,
- MaybeHandle<Name>(), Type::Any(), kMachAnyTagged};
+ MaybeHandle<Name>(), Type::Internal(), kMachAnyTagged};
return access;
}
@@ -67,12 +72,10 @@ FieldAccess AccessBuilder::ForJSDateField(JSDate::FieldIndex index) {
// static
-FieldAccess AccessBuilder::ForFixedArrayLength(Zone* zone) {
- FieldAccess access = {
- kTaggedBase, FixedArray::kLengthOffset, MaybeHandle<Name>(),
- Type::Intersect(Type::Range(0, FixedArray::kMaxLength, zone),
- Type::TaggedSigned(), zone),
- kMachAnyTagged};
+FieldAccess AccessBuilder::ForFixedArrayLength() {
+ FieldAccess access = {kTaggedBase, FixedArray::kLengthOffset,
+ MaybeHandle<Name>(),
+ TypeCache::Get().kFixedArrayLengthType, kMachAnyTagged};
return access;
}
@@ -95,11 +98,9 @@ FieldAccess AccessBuilder::ForDescriptorArrayEnumCacheBridgeCache() {
// static
-FieldAccess AccessBuilder::ForMapBitField3(Zone* zone) {
- FieldAccess access = {
- kTaggedBase, Map::kBitField3Offset, Handle<Name>(),
- Type::Intersect(Type::Signed32(), Type::UntaggedSigned32(), zone),
- kMachInt32};
+FieldAccess AccessBuilder::ForMapBitField3() {
+ FieldAccess access = {kTaggedBase, Map::kBitField3Offset, Handle<Name>(),
+ TypeCache::Get().kInt32, kMachInt32};
return access;
}
@@ -115,18 +116,15 @@ FieldAccess AccessBuilder::ForMapDescriptors() {
// static
FieldAccess AccessBuilder::ForMapInstanceType() {
FieldAccess access = {kTaggedBase, Map::kInstanceTypeOffset, Handle<Name>(),
- Type::UntaggedUnsigned8(), kMachUint8};
+ TypeCache::Get().kUint8, kMachUint8};
return access;
}
// static
-FieldAccess AccessBuilder::ForStringLength(Zone* zone) {
- FieldAccess access = {
- kTaggedBase, String::kLengthOffset, Handle<Name>(),
- Type::Intersect(Type::Range(0, String::kMaxLength, zone),
- Type::TaggedSigned(), zone),
- kMachAnyTagged};
+FieldAccess AccessBuilder::ForStringLength() {
+ FieldAccess access = {kTaggedBase, String::kLengthOffset, Handle<Name>(),
+ TypeCache::Get().kStringLengthType, kMachAnyTagged};
return access;
}
@@ -301,8 +299,8 @@ ElementAccess AccessBuilder::ForSeqStringChar(String::Encoding encoding) {
// static
FieldAccess AccessBuilder::ForStatsCounter() {
- FieldAccess access = {kUntaggedBase, 0, MaybeHandle<Name>(), Type::Signed32(),
- kMachInt32};
+ FieldAccess access = {kUntaggedBase, 0, MaybeHandle<Name>(),
+ TypeCache::Get().kInt32, kMachInt32};
return access;
}
« no previous file with comments | « src/compiler/access-builder.h ('k') | src/compiler/js-intrinsic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698