Commit c17ea79e authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Lower %_DebugIsActive intrinsic.

Add support to lower the %_DebugIsActive intrinsic during
JSIntrinsicLowering instead of always going to the runtime
for this.

This addresses part of the Bluebird regression caused by
sending let and const to TurboFan and Ignition.

R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2550043002
Cr-Commit-Position: refs/heads/master@{#41468}
parent 3b3ede5d
......@@ -22,6 +22,14 @@ FieldAccess AccessBuilder::ForExternalDoubleValue() {
return access;
}
// static
FieldAccess AccessBuilder::ForExternalUint8Value() {
FieldAccess access = {kUntaggedBase, 0,
MaybeHandle<Name>(), TypeCache::Get().kUint8,
MachineType::Uint8(), kNoWriteBarrier};
return access;
}
// static
FieldAccess AccessBuilder::ForMap() {
FieldAccess access = {
......
......@@ -26,6 +26,9 @@ class V8_EXPORT_PRIVATE AccessBuilder final
// Provides access to a double field identified by an external reference.
static FieldAccess ForExternalDoubleValue();
// Provides access to an uint8 field identified by an external reference.
static FieldAccess ForExternalUint8Value();
// ===========================================================================
// Access to heap object fields and elements (based on tagged pointer).
......
......@@ -32,6 +32,8 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
switch (f->function_id) {
case Runtime::kInlineCreateIterResultObject:
return ReduceCreateIterResultObject(node);
case Runtime::kInlineDebugIsActive:
return ReduceDebugIsActive(node);
case Runtime::kInlineDeoptimizeNow:
return ReduceDeoptimizeNow(node);
case Runtime::kInlineGeneratorClose:
......@@ -90,6 +92,15 @@ Reduction JSIntrinsicLowering::ReduceCreateIterResultObject(Node* node) {
context, effect);
}
Reduction JSIntrinsicLowering::ReduceDebugIsActive(Node* node) {
Node* const value = jsgraph()->ExternalConstant(
ExternalReference::debug_is_active_address(isolate()));
Node* const effect = NodeProperties::GetEffectInput(node);
Node* const control = NodeProperties::GetControlInput(node);
Operator const* const op =
simplified()->LoadField(AccessBuilder::ForExternalUint8Value());
return Change(node, op, value, effect, control);
}
Reduction JSIntrinsicLowering::ReduceDeoptimizeNow(Node* node) {
if (mode() != kDeoptimizationEnabled) return NoChange();
......
......@@ -40,6 +40,7 @@ class V8_EXPORT_PRIVATE JSIntrinsicLowering final
private:
Reduction ReduceCreateIterResultObject(Node* node);
Reduction ReduceDebugIsActive(Node* node);
Reduction ReduceDeoptimizeNow(Node* node);
Reduction ReduceGeneratorClose(Node* node);
Reduction ReduceGeneratorGetInputOrDebugPos(Node* node);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment