// static
+FieldAccess AccessBuilder::ForJSDateField(JSDate::FieldIndex index) {
+ return {kTaggedBase, JSDate::kValueOffset + index * kPointerSize,
+ MaybeHandle<Name>(), Type::Number(), kMachAnyTagged};
+}
+
+
+// static
FieldAccess AccessBuilder::ForFixedArrayLength() {
// TODO(turbofan): 2^30 is a valid upper limit for the FixedArray::length
// field, although it's not the best. If we had a Zone we could create an
// Provides access to JSArrayBuffer::backing_store() field.
static FieldAccess ForJSArrayBufferBackingStore();
+ // Provides access to JSDate fields.
+ static FieldAccess ForJSDateField(JSDate::FieldIndex index);
+
// Provides access to FixedArray::length() field.
static FieldAccess ForFixedArrayLength();
switch (f->function_id) {
case Runtime::kInlineConstructDouble:
return ReduceConstructDouble(node);
+ case Runtime::kInlineDateField:
+ return ReduceDateField(node);
case Runtime::kInlineDeoptimizeNow:
return ReduceDeoptimizeNow(node);
case Runtime::kInlineDoubleHi:
}
+Reduction JSIntrinsicLowering::ReduceDateField(Node* node) {
+ Node* const value = NodeProperties::GetValueInput(node, 0);
+ Node* const index = NodeProperties::GetValueInput(node, 1);
+ Node* const effect = NodeProperties::GetEffectInput(node);
+ Node* const control = NodeProperties::GetControlInput(node);
+ NumberMatcher mindex(index);
+ if (mindex.Is(JSDate::kDateValue)) {
+ return Change(
+ node,
+ simplified()->LoadField(AccessBuilder::ForJSDateField(
+ static_cast<JSDate::FieldIndex>(static_cast<int>(mindex.Value())))),
+ value, effect, control);
+ }
+ // TODO(turbofan): Optimize more patterns.
+ return NoChange();
+}
+
+
Reduction JSIntrinsicLowering::ReduceDeoptimizeNow(Node* node) {
if (mode() != kDeoptimizationEnabled) return NoChange();
Node* frame_state = NodeProperties::GetFrameStateInput(node, 0);
private:
Reduction ReduceConstructDouble(Node* node);
+ Reduction ReduceDateField(Node* node);
Reduction ReduceDeoptimizeNow(Node* node);
Reduction ReduceDoubleHi(Node* node);
Reduction ReduceDoubleLo(Node* node);
// are blacklisted here and can be called without a FrameState.
switch (function) {
case Runtime::kAllocateInTargetSpace:
+ case Runtime::kDateField:
case Runtime::kDefineClassMethod: // TODO(jarin): Is it safe?
case Runtime::kDefineGetterPropertyUnchecked: // TODO(jarin): Is it safe?
case Runtime::kDefineSetterPropertyUnchecked: // TODO(jarin): Is it safe?
return false;
case Runtime::kInlineArguments:
case Runtime::kInlineCallFunction:
- case Runtime::kInlineDateField: // TODO(bmeurer): Remove this.
case Runtime::kInlineDeoptimizeNow:
case Runtime::kInlineGetCallerJSFunction:
case Runtime::kInlineGetPrototype:
case Runtime::kInlineDoubleHi:
return Bounds(Type::None(zone()), Type::Signed32());
case Runtime::kInlineConstructDouble:
+ case Runtime::kInlineDateField:
case Runtime::kInlineMathFloor:
case Runtime::kInlineMathSqrt:
case Runtime::kInlineMathAcos: