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

Unified Diff: src/compiler/simplified-lowering.cc

Issue 968113002: [turbofan] Skip write barriers when storing smi. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add test case. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/simplified-lowering.h ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index b3050719883c0467bf97f8d0610e494a3142c014..69d1d1ac79a40cbd3f55f836c64742b68a8219b7 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -1135,10 +1135,14 @@ Node* SimplifiedLowering::OffsetMinusTagConstant(int32_t offset) {
}
-static WriteBarrierKind ComputeWriteBarrierKind(BaseTaggedness base_is_tagged,
- MachineType representation,
- Type* type) {
+WriteBarrierKind SimplifiedLowering::ComputeWriteBarrierKind(
+ BaseTaggedness base_is_tagged, MachineType representation, Node* value) {
// TODO(turbofan): skip write barriers for Smis, etc.
+ if (machine()->Is64() && value->opcode() == IrOpcode::kChangeInt32ToTagged) {
+ // TODO(bmeurer): Remove this hack once we have a way to represent "sminess"
+ // of values, either in types or representations.
+ return kNoWriteBarrier;
+ }
if (base_is_tagged == kTaggedBase &&
RepresentationOf(representation) == kRepTagged) {
// Write barriers are only for writes into heap objects (i.e. tagged base).
@@ -1159,7 +1163,7 @@ void SimplifiedLowering::DoLoadField(Node* node) {
void SimplifiedLowering::DoStoreField(Node* node) {
const FieldAccess& access = FieldAccessOf(node->op());
WriteBarrierKind kind = ComputeWriteBarrierKind(
- access.base_is_tagged, access.machine_type, access.type);
+ access.base_is_tagged, access.machine_type, node->InputAt(1));
node->set_op(
machine()->Store(StoreRepresentation(access.machine_type, kind)));
Node* offset = jsgraph()->IntPtrConstant(access.offset - access.tag());
@@ -1267,7 +1271,7 @@ void SimplifiedLowering::DoStoreElement(Node* node) {
node->set_op(machine()->Store(StoreRepresentation(
access.machine_type,
ComputeWriteBarrierKind(access.base_is_tagged, access.machine_type,
- access.type))));
+ node->InputAt(2)))));
node->ReplaceInput(1, ComputeIndex(access, node->InputAt(1)));
}
« no previous file with comments | « src/compiler/simplified-lowering.h ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698