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

Unified Diff: src/interpreter/interpreter-assembler.cc

Issue 2183923003: [stubs,interpreter] Optimise SMI loading for 64-bit targets. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Optimizing SMI loads at code stub assembler level. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: src/interpreter/interpreter-assembler.cc
diff --git a/src/interpreter/interpreter-assembler.cc b/src/interpreter/interpreter-assembler.cc
index 42501a1add63f550b6f2b6362e6a388cbcdeb96c..b195d5860af5d172ee53888be0d443817a52c89d 100644
--- a/src/interpreter/interpreter-assembler.cc
+++ b/src/interpreter/interpreter-assembler.cc
@@ -392,6 +392,26 @@ Node* InterpreterAssembler::LoadConstantPoolEntry(Node* index) {
return Load(MachineType::AnyTagged(), constant_pool, entry_offset);
}
+Node* InterpreterAssembler::LoadAndUntagConstantPoolEntry(Node* index) {
+ Node* constant_pool = LoadObjectField(BytecodeArrayTaggedPointer(),
+ BytecodeArray::kConstantPoolOffset);
+ int offset = FixedArray::kHeaderSize - kHeapObjectTag;
+#if V8_TARGET_LITTLE_ENDIAN
+ if (Is64()) {
+ offset += kPointerSize / 2;
+ }
+#endif
+ Node* entry_offset =
+ IntPtrAdd(IntPtrConstant(offset), WordShl(index, kPointerSizeLog2));
+ if (Is64()) {
+ return ChangeInt32ToInt64(
+ Load(MachineType::Int32(), constant_pool, entry_offset));
+ } else {
+ return SmiUntag(
+ Load(MachineType::AnyTagged(), constant_pool, entry_offset));
+ }
+}
+
Node* InterpreterAssembler::LoadContextSlot(Node* context, int slot_index) {
return Load(MachineType::AnyTagged(), context,
IntPtrConstant(Context::SlotOffset(slot_index)));
@@ -927,7 +947,7 @@ Node* InterpreterAssembler::RegisterCount() {
Node* InterpreterAssembler::ExportRegisterFile(Node* array) {
if (FLAG_debug_code) {
- Node* array_size = SmiUntag(LoadFixedArrayBaseLength(array));
+ Node* array_size = LoadAndUntagFixedArrayBaseLength(array);
AbortIfWordNotEqual(
array_size, RegisterCount(), kInvalidRegisterFileInGenerator);
}
@@ -962,7 +982,7 @@ Node* InterpreterAssembler::ExportRegisterFile(Node* array) {
Node* InterpreterAssembler::ImportRegisterFile(Node* array) {
if (FLAG_debug_code) {
- Node* array_size = SmiUntag(LoadFixedArrayBaseLength(array));
+ Node* array_size = LoadAndUntagFixedArrayBaseLength(array);
AbortIfWordNotEqual(
array_size, RegisterCount(), kInvalidRegisterFileInGenerator);
}
« no previous file with comments | « src/interpreter/interpreter-assembler.h ('k') | test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698