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

Side by Side Diff: src/code-stub-assembler.h

Issue 2680973002: [stubs] Implement binary-search descriptor lookup in CSA (Closed)
Patch Set: rebased Created 3 years, 10 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 | « no previous file | src/code-stub-assembler.cc » ('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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 #ifndef V8_CODE_STUB_ASSEMBLER_H_ 5 #ifndef V8_CODE_STUB_ASSEMBLER_H_
6 #define V8_CODE_STUB_ASSEMBLER_H_ 6 #define V8_CODE_STUB_ASSEMBLER_H_
7 7
8 #include <functional> 8 #include <functional>
9 9
10 #include "src/compiler/code-assembler.h" 10 #include "src/compiler/code-assembler.h"
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 Node* StringToNumber(Node* context, Node* input); 745 Node* StringToNumber(Node* context, Node* input);
746 Node* NumberToString(Node* context, Node* input); 746 Node* NumberToString(Node* context, Node* input);
747 // Convert an object to a name. 747 // Convert an object to a name.
748 Node* ToName(Node* context, Node* input); 748 Node* ToName(Node* context, Node* input);
749 // Convert a Non-Number object to a Number. 749 // Convert a Non-Number object to a Number.
750 Node* NonNumberToNumber(Node* context, Node* input); 750 Node* NonNumberToNumber(Node* context, Node* input);
751 // Convert any object to a Number. 751 // Convert any object to a Number.
752 Node* ToNumber(Node* context, Node* input); 752 Node* ToNumber(Node* context, Node* input);
753 753
754 // Converts |input| to one of 2^32 integer values in the range 0 through 754 // Converts |input| to one of 2^32 integer values in the range 0 through
755 // 2^321, inclusive. 755 // 2^32-1, inclusive.
756 // ES#sec-touint32 756 // ES#sec-touint32
757 compiler::Node* ToUint32(compiler::Node* context, compiler::Node* input); 757 compiler::Node* ToUint32(compiler::Node* context, compiler::Node* input);
758 758
759 // Convert any object to a String. 759 // Convert any object to a String.
760 Node* ToString(Node* context, Node* input); 760 Node* ToString(Node* context, Node* input);
761 761
762 // Convert any object to a Primitive. 762 // Convert any object to a Primitive.
763 Node* JSReceiverToPrimitive(Node* context, Node* input); 763 Node* JSReceiverToPrimitive(Node* context, Node* input);
764 764
765 enum ToIntegerTruncationMode { 765 enum ToIntegerTruncationMode {
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 Node* deferred_promise, 1235 Node* deferred_promise,
1236 Node* deferred_on_resolve, 1236 Node* deferred_on_resolve,
1237 Node* deferred_on_reject, Node* context); 1237 Node* deferred_on_reject, Node* context);
1238 1238
1239 // Support for printf-style debugging 1239 // Support for printf-style debugging
1240 void Print(const char* s); 1240 void Print(const char* s);
1241 void Print(const char* prefix, Node* tagged_value); 1241 void Print(const char* prefix, Node* tagged_value);
1242 inline void Print(Node* tagged_value) { return Print(nullptr, tagged_value); } 1242 inline void Print(Node* tagged_value) { return Print(nullptr, tagged_value); }
1243 1243
1244 protected: 1244 protected:
1245 void DescriptorLookup(Node* unique_name, Node* descriptors, Node* bitfield3,
1246 Label* if_found, Variable* var_name_index,
1247 Label* if_not_found);
1245 void DescriptorLookupLinear(Node* unique_name, Node* descriptors, Node* nof, 1248 void DescriptorLookupLinear(Node* unique_name, Node* descriptors, Node* nof,
1246 Label* if_found, Variable* var_name_index, 1249 Label* if_found, Variable* var_name_index,
1247 Label* if_not_found); 1250 Label* if_not_found);
1251 void DescriptorLookupBinary(Node* unique_name, Node* descriptors, Node* nof,
1252 Label* if_found, Variable* var_name_index,
1253 Label* if_not_found);
1248 1254
1249 Node* CallGetterIfAccessor(Node* value, Node* details, Node* context, 1255 Node* CallGetterIfAccessor(Node* value, Node* details, Node* context,
1250 Node* receiver, Label* if_bailout); 1256 Node* receiver, Label* if_bailout);
1251 1257
1252 Node* TryToIntptr(Node* key, Label* miss); 1258 Node* TryToIntptr(Node* key, Label* miss);
1253 1259
1254 void BranchIfPrototypesHaveNoElements(Node* receiver_map, 1260 void BranchIfPrototypesHaveNoElements(Node* receiver_map,
1255 Label* definitely_no_elements, 1261 Label* definitely_no_elements,
1256 Label* possibly_elements); 1262 Label* possibly_elements);
1257 1263
(...skipping 18 matching lines...) Expand all
1276 // otherwise. Returns either the loaded value or |value|. 1282 // otherwise. Returns either the loaded value or |value|.
1277 Node* EmitKeyedSloppyArguments(Node* receiver, Node* key, Node* value, 1283 Node* EmitKeyedSloppyArguments(Node* receiver, Node* key, Node* value,
1278 Label* bailout); 1284 Label* bailout);
1279 1285
1280 Node* AllocateSlicedString(Heap::RootListIndex map_root_index, Node* length, 1286 Node* AllocateSlicedString(Heap::RootListIndex map_root_index, Node* length,
1281 Node* parent, Node* offset); 1287 Node* parent, Node* offset);
1282 1288
1283 Node* AllocateConsString(Heap::RootListIndex map_root_index, Node* length, 1289 Node* AllocateConsString(Heap::RootListIndex map_root_index, Node* length,
1284 Node* first, Node* second, AllocationFlags flags); 1290 Node* first, Node* second, AllocationFlags flags);
1285 1291
1292 // Implements DescriptorArray::number_of_entries.
1293 // Returns an untagged int32.
1294 Node* DescriptorArrayNumberOfEntries(Node* descriptors);
1295 // Implements DescriptorArray::ToKeyIndex.
1296 // Returns an untagged IntPtr.
1297 Node* DescriptorArrayToKeyIndex(Node* descriptor_number);
1298 // Implements DescriptorArray::GetSortedKeyIndex.
1299 // Returns an untagged int32.
1300 Node* DescriptorArrayGetSortedKeyIndex(Node* descriptors,
1301 Node* descriptor_number);
1302 // Implements DescriptorArray::GetKey.
1303 Node* DescriptorArrayGetKey(Node* descriptors, Node* descriptor_number);
1304
1286 static const int kElementLoopUnrollThreshold = 8; 1305 static const int kElementLoopUnrollThreshold = 8;
1287 }; 1306 };
1288 1307
1289 class CodeStubArguments { 1308 class CodeStubArguments {
1290 public: 1309 public:
1291 typedef compiler::Node Node; 1310 typedef compiler::Node Node;
1292 1311
1293 // |argc| is an uint32 value which specifies the number of arguments passed 1312 // |argc| is an uint32 value which specifies the number of arguments passed
1294 // to the builtin excluding the receiver. 1313 // to the builtin excluding the receiver.
1295 CodeStubArguments(CodeStubAssembler* assembler, Node* argc) 1314 CodeStubArguments(CodeStubAssembler* assembler, Node* argc)
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1368 } 1387 }
1369 #else 1388 #else
1370 #define CSA_SLOW_ASSERT(csa, x) ((void)0) 1389 #define CSA_SLOW_ASSERT(csa, x) ((void)0)
1371 #endif 1390 #endif
1372 1391
1373 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); 1392 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags);
1374 1393
1375 } // namespace internal 1394 } // namespace internal
1376 } // namespace v8 1395 } // namespace v8
1377 #endif // V8_CODE_STUB_ASSEMBLER_H_ 1396 #endif // V8_CODE_STUB_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « no previous file | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698