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

Side by Side Diff: src/compiler/access-builder.cc

Issue 1573153002: [turbofan] Use inline allocation for closures. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 4 years, 8 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/compiler/access-builder.h ('k') | src/compiler/js-create-lowering.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/access-builder.h" 5 #include "src/compiler/access-builder.h"
6 6
7 #include "src/contexts.h" 7 #include "src/contexts.h"
8 #include "src/frames.h" 8 #include "src/frames.h"
9 #include "src/handles-inl.h" 9 #include "src/handles-inl.h"
10 #include "src/heap/heap.h" 10 #include "src/heap/heap.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 FieldAccess AccessBuilder::ForJSObjectInObjectProperty(Handle<Map> map, 54 FieldAccess AccessBuilder::ForJSObjectInObjectProperty(Handle<Map> map,
55 int index) { 55 int index) {
56 int const offset = map->GetInObjectPropertyOffset(index); 56 int const offset = map->GetInObjectPropertyOffset(index);
57 FieldAccess access = {kTaggedBase, offset, MaybeHandle<Name>(), 57 FieldAccess access = {kTaggedBase, offset, MaybeHandle<Name>(),
58 Type::Tagged(), MachineType::AnyTagged()}; 58 Type::Tagged(), MachineType::AnyTagged()};
59 return access; 59 return access;
60 } 60 }
61 61
62 62
63 // static 63 // static
64 FieldAccess AccessBuilder::ForJSFunctionPrototypeOrInitialMap() {
65 FieldAccess access = {kTaggedBase, JSFunction::kPrototypeOrInitialMapOffset,
66 MaybeHandle<Name>(), Type::Any(),
67 MachineType::AnyTagged()};
68 return access;
69 }
70
71 // static
64 FieldAccess AccessBuilder::ForJSFunctionContext() { 72 FieldAccess AccessBuilder::ForJSFunctionContext() {
65 FieldAccess access = {kTaggedBase, JSFunction::kContextOffset, 73 FieldAccess access = {kTaggedBase, JSFunction::kContextOffset,
66 MaybeHandle<Name>(), Type::Internal(), 74 MaybeHandle<Name>(), Type::Internal(),
67 MachineType::AnyTagged()}; 75 MachineType::AnyTagged()};
68 return access; 76 return access;
69 } 77 }
70 78
71 79
72 // static 80 // static
73 FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() { 81 FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() {
74 FieldAccess access = {kTaggedBase, JSFunction::kSharedFunctionInfoOffset, 82 FieldAccess access = {kTaggedBase, JSFunction::kSharedFunctionInfoOffset,
75 Handle<Name>(), Type::Any(), MachineType::AnyTagged()}; 83 Handle<Name>(), Type::Any(), MachineType::AnyTagged()};
76 return access; 84 return access;
77 } 85 }
78 86
79 87
80 // static 88 // static
89 FieldAccess AccessBuilder::ForJSFunctionLiterals() {
90 FieldAccess access = {kTaggedBase, JSFunction::kLiteralsOffset,
91 Handle<Name>(), Type::Internal(),
92 MachineType::AnyTagged()};
93 return access;
94 }
95
96 // static
97 FieldAccess AccessBuilder::ForJSFunctionCodeEntry() {
98 FieldAccess access = {kTaggedBase, JSFunction::kCodeEntryOffset,
99 Handle<Name>(), Type::UntaggedPointer(),
100 MachineType::Pointer()};
101 return access;
102 }
103
104 // static
105 FieldAccess AccessBuilder::ForJSFunctionNextFunctionLink() {
106 FieldAccess access = {kTaggedBase, JSFunction::kNextFunctionLinkOffset,
107 Handle<Name>(), Type::Any(), MachineType::AnyTagged()};
108 return access;
109 }
110
111 // static
81 FieldAccess AccessBuilder::ForJSArrayLength(ElementsKind elements_kind) { 112 FieldAccess AccessBuilder::ForJSArrayLength(ElementsKind elements_kind) {
82 TypeCache const& type_cache = TypeCache::Get(); 113 TypeCache const& type_cache = TypeCache::Get();
83 FieldAccess access = {kTaggedBase, JSArray::kLengthOffset, Handle<Name>(), 114 FieldAccess access = {kTaggedBase, JSArray::kLengthOffset, Handle<Name>(),
84 type_cache.kJSArrayLengthType, 115 type_cache.kJSArrayLengthType,
85 MachineType::AnyTagged()}; 116 MachineType::AnyTagged()};
86 if (IsFastDoubleElementsKind(elements_kind)) { 117 if (IsFastDoubleElementsKind(elements_kind)) {
87 access.type = type_cache.kFixedDoubleArrayLengthType; 118 access.type = type_cache.kFixedDoubleArrayLengthType;
88 } else if (IsFastElementsKind(elements_kind)) { 119 } else if (IsFastElementsKind(elements_kind)) {
89 access.type = type_cache.kFixedArrayLengthType; 120 access.type = type_cache.kFixedArrayLengthType;
90 } 121 }
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 // static 428 // static
398 FieldAccess AccessBuilder::ForStatsCounter() { 429 FieldAccess AccessBuilder::ForStatsCounter() {
399 FieldAccess access = {kUntaggedBase, 0, MaybeHandle<Name>(), 430 FieldAccess access = {kUntaggedBase, 0, MaybeHandle<Name>(),
400 TypeCache::Get().kInt32, MachineType::Int32()}; 431 TypeCache::Get().kInt32, MachineType::Int32()};
401 return access; 432 return access;
402 } 433 }
403 434
404 } // namespace compiler 435 } // namespace compiler
405 } // namespace internal 436 } // namespace internal
406 } // namespace v8 437 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/access-builder.h ('k') | src/compiler/js-create-lowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698