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

Unified Diff: src/compiler/code-generator.cc

Issue 2258073002: [Turbofan]: Use new MachineTypes in access-builder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: A bit of refactoring. 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
« no previous file with comments | « src/compiler/arm64/instruction-selector-arm64.cc ('k') | src/compiler/ia32/instruction-selector-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-generator.cc
diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc
index 4513c248fc8f886cbe22f2bac4700cc297f5d0ad..9053ac8d3d63d52e783446a0c6502bb5558c4473 100644
--- a/src/compiler/code-generator.cc
+++ b/src/compiler/code-generator.cc
@@ -820,7 +820,7 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation,
} else if (type == MachineType::Uint8() || type == MachineType::Uint16() ||
type == MachineType::Uint32()) {
translation->StoreUint32StackSlot(LocationOperand::cast(op)->index());
- } else if (type.representation() == MachineRepresentation::kTagged) {
+ } else if (IsAnyTagged(type.representation())) {
translation->StoreStackSlot(LocationOperand::cast(op)->index());
} else {
CHECK(false);
@@ -842,7 +842,7 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation,
} else if (type == MachineType::Uint8() || type == MachineType::Uint16() ||
type == MachineType::Uint32()) {
translation->StoreUint32Register(converter.ToRegister(op));
- } else if (type.representation() == MachineRepresentation::kTagged) {
+ } else if (IsAnyTagged(type.representation())) {
translation->StoreRegister(converter.ToRegister(op));
} else {
CHECK(false);
@@ -861,7 +861,8 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation,
Handle<Object> constant_object;
switch (constant.type()) {
case Constant::kInt32:
- if (type.representation() == MachineRepresentation::kTagged) {
+ if (type.representation() == MachineRepresentation::kTagged ||
+ type.representation() == MachineRepresentation::kTaggedSigned) {
// When pointers are 4 bytes, we can use int32 constants to represent
// Smis.
DCHECK_EQ(4, kPointerSize);
@@ -883,7 +884,8 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation,
case Constant::kInt64:
// When pointers are 8 bytes, we can use int64 constants to represent
// Smis.
- DCHECK_EQ(type.representation(), MachineRepresentation::kTagged);
+ DCHECK(type.representation() == MachineRepresentation::kTagged ||
+ type.representation() == MachineRepresentation::kTaggedSigned);
DCHECK_EQ(8, kPointerSize);
constant_object =
handle(reinterpret_cast<Smi*>(constant.ToInt64()), isolate());
@@ -891,16 +893,16 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation,
break;
case Constant::kFloat32:
DCHECK(type.representation() == MachineRepresentation::kFloat32 ||
- type.representation() == MachineRepresentation::kTagged);
+ CanBeTaggedPointer(type.representation()));
constant_object = isolate()->factory()->NewNumber(constant.ToFloat32());
break;
case Constant::kFloat64:
DCHECK(type.representation() == MachineRepresentation::kFloat64 ||
- type.representation() == MachineRepresentation::kTagged);
+ CanBeTaggedPointer(type.representation()));
constant_object = isolate()->factory()->NewNumber(constant.ToFloat64());
break;
case Constant::kHeapObject:
- DCHECK(type.representation() == MachineRepresentation::kTagged);
+ DCHECK(CanBeTaggedPointer(type.representation()));
constant_object = constant.ToHeapObject();
break;
default:
« no previous file with comments | « src/compiler/arm64/instruction-selector-arm64.cc ('k') | src/compiler/ia32/instruction-selector-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698