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

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

Issue 439223004: Add support for untagged LoadField, StoreField, LoadElement, and StoreElement simplfied operators. … (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments. Created 6 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 | « no previous file | src/compiler/simplified-operator.h » ('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 44eed8fddfd64d417c749b94e50f58ea82dd50cd..508e7c5dae7a93af5ac7de2a2bad3555ba98e34f 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -193,9 +193,11 @@ void SimplifiedLowering::DoChangeBitToBool(Node* node, Node* effect,
static WriteBarrierKind ComputeWriteBarrierKind(
- MachineRepresentation representation, Type* type) {
+ BaseTaggedness base_is_tagged, MachineRepresentation representation,
+ Type* type) {
// TODO(turbofan): skip write barriers for Smis, etc.
- if (representation == kMachineTagged) {
+ if (base_is_tagged == kTaggedBase && representation == kMachineTagged) {
+ // Write barriers are only for writes into heap objects (i.e. tagged base).
return kFullWriteBarrier;
}
return kNoWriteBarrier;
@@ -205,19 +207,17 @@ static WriteBarrierKind ComputeWriteBarrierKind(
void SimplifiedLowering::DoLoadField(Node* node, Node* effect, Node* control) {
const FieldAccess& access = FieldAccessOf(node->op());
node->set_op(machine_.Load(access.representation));
- Node* offset =
- graph()->NewNode(common()->Int32Constant(access.offset - kHeapObjectTag));
+ Node* offset = jsgraph()->Int32Constant(access.offset - access.tag());
node->InsertInput(zone(), 1, offset);
}
void SimplifiedLowering::DoStoreField(Node* node, Node* effect, Node* control) {
const FieldAccess& access = FieldAccessOf(node->op());
- WriteBarrierKind kind =
- ComputeWriteBarrierKind(access.representation, access.type);
+ WriteBarrierKind kind = ComputeWriteBarrierKind(
+ access.base_is_tagged, access.representation, access.type);
node->set_op(machine_.Store(access.representation, kind));
- Node* offset =
- graph()->NewNode(common()->Int32Constant(access.offset - kHeapObjectTag));
+ Node* offset = jsgraph()->Int32Constant(access.offset - access.tag());
node->InsertInput(zone(), 1, offset);
}
@@ -247,15 +247,13 @@ Node* SimplifiedLowering::ComputeIndex(const ElementAccess& access,
break;
}
if (element_size != 1) {
- index = graph()->NewNode(
- machine()->Int32Mul(),
- graph()->NewNode(common()->Int32Constant(element_size)), index);
+ index = graph()->NewNode(machine()->Int32Mul(),
+ jsgraph()->Int32Constant(element_size), index);
}
- int fixed_offset = access.header_size - kHeapObjectTag;
+ int fixed_offset = access.header_size - access.tag();
if (fixed_offset == 0) return index;
- return graph()->NewNode(
- machine()->Int32Add(),
- graph()->NewNode(common()->Int32Constant(fixed_offset)), index);
+ return graph()->NewNode(machine()->Int32Add(),
+ jsgraph()->Int32Constant(fixed_offset), index);
}
@@ -270,8 +268,8 @@ void SimplifiedLowering::DoLoadElement(Node* node, Node* effect,
void SimplifiedLowering::DoStoreElement(Node* node, Node* effect,
Node* control) {
const ElementAccess& access = ElementAccessOf(node->op());
- WriteBarrierKind kind =
- ComputeWriteBarrierKind(access.representation, access.type);
+ WriteBarrierKind kind = ComputeWriteBarrierKind(
+ access.base_is_tagged, access.representation, access.type);
node->set_op(machine_.Store(access.representation, kind));
node->ReplaceInput(1, ComputeIndex(access, node->InputAt(1)));
}
« no previous file with comments | « no previous file | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698