Commit 58672706 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[cleanup] Make better use of heap constant accessors.

E.g. use TrueConstant() instead of BooleanConstant(true) and
NullConstant() instead of HeapConstant(factory...null_value()).

R=jkummerow@chromium.org

Bug: 
Change-Id: I0588d71940d8baf289eb8f8e6c8d20aa717d57f6
Reviewed-on: https://chromium-review.googlesource.com/735681
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48911}
parent fe8eb6f0
...@@ -2134,10 +2134,10 @@ TF_BUILTIN(ArrayIsArray, CodeStubAssembler) { ...@@ -2134,10 +2134,10 @@ TF_BUILTIN(ArrayIsArray, CodeStubAssembler) {
&return_false); &return_false);
BIND(&return_true); BIND(&return_true);
Return(BooleanConstant(true)); Return(TrueConstant());
BIND(&return_false); BIND(&return_false);
Return(BooleanConstant(false)); Return(FalseConstant());
BIND(&call_runtime); BIND(&call_runtime);
Return(CallRuntime(Runtime::kArrayIsArray, context, object)); Return(CallRuntime(Runtime::kArrayIsArray, context, object));
...@@ -2359,8 +2359,7 @@ void ArrayIncludesIndexofAssembler::Generate(SearchVariant variant) { ...@@ -2359,8 +2359,7 @@ void ArrayIncludesIndexofAssembler::Generate(SearchVariant variant) {
BIND(&runtime); BIND(&runtime);
TNode<Object> result = CallRuntime(Runtime::kStringEqual, context, TNode<Object> result = CallRuntime(Runtime::kStringEqual, context,
search_element_string, element_k); search_element_string, element_k);
Branch(WordEqual(BooleanConstant(true), result), &return_found, Branch(WordEqual(result, TrueConstant()), &return_found, &continue_loop);
&continue_loop);
BIND(&continue_loop); BIND(&continue_loop);
Increment(&index_var); Increment(&index_var);
......
...@@ -229,10 +229,10 @@ TF_BUILTIN(ToBoolean, CodeStubAssembler) { ...@@ -229,10 +229,10 @@ TF_BUILTIN(ToBoolean, CodeStubAssembler) {
BranchIfToBooleanIsTrue(value, &return_true, &return_false); BranchIfToBooleanIsTrue(value, &return_true, &return_false);
BIND(&return_true); BIND(&return_true);
Return(BooleanConstant(true)); Return(TrueConstant());
BIND(&return_false); BIND(&return_false);
Return(BooleanConstant(false)); Return(FalseConstant());
} }
// ES6 section 7.1.2 ToBoolean ( argument ) // ES6 section 7.1.2 ToBoolean ( argument )
...@@ -245,10 +245,10 @@ TF_BUILTIN(ToBooleanLazyDeoptContinuation, CodeStubAssembler) { ...@@ -245,10 +245,10 @@ TF_BUILTIN(ToBooleanLazyDeoptContinuation, CodeStubAssembler) {
BranchIfToBooleanIsTrue(value, &return_true, &return_false); BranchIfToBooleanIsTrue(value, &return_true, &return_false);
BIND(&return_true); BIND(&return_true);
Return(BooleanConstant(true)); Return(TrueConstant());
BIND(&return_false); BIND(&return_false);
Return(BooleanConstant(false)); Return(FalseConstant());
} }
TF_BUILTIN(ToLength, CodeStubAssembler) { TF_BUILTIN(ToLength, CodeStubAssembler) {
......
...@@ -84,10 +84,10 @@ TF_BUILTIN(NumberIsFinite, CodeStubAssembler) { ...@@ -84,10 +84,10 @@ TF_BUILTIN(NumberIsFinite, CodeStubAssembler) {
&return_true); &return_true);
BIND(&return_true); BIND(&return_true);
Return(BooleanConstant(true)); Return(TrueConstant());
BIND(&return_false); BIND(&return_false);
Return(BooleanConstant(false)); Return(FalseConstant());
} }
TF_BUILTIN(AllocateHeapNumber, CodeStubAssembler) { TF_BUILTIN(AllocateHeapNumber, CodeStubAssembler) {
...@@ -118,10 +118,10 @@ TF_BUILTIN(NumberIsInteger, CodeStubAssembler) { ...@@ -118,10 +118,10 @@ TF_BUILTIN(NumberIsInteger, CodeStubAssembler) {
&return_true, &return_false); &return_true, &return_false);
BIND(&return_true); BIND(&return_true);
Return(BooleanConstant(true)); Return(TrueConstant());
BIND(&return_false); BIND(&return_false);
Return(BooleanConstant(false)); Return(FalseConstant());
} }
// ES6 #sec-number.isnan // ES6 #sec-number.isnan
...@@ -141,10 +141,10 @@ TF_BUILTIN(NumberIsNaN, CodeStubAssembler) { ...@@ -141,10 +141,10 @@ TF_BUILTIN(NumberIsNaN, CodeStubAssembler) {
BranchIfFloat64IsNaN(number_value, &return_true, &return_false); BranchIfFloat64IsNaN(number_value, &return_true, &return_false);
BIND(&return_true); BIND(&return_true);
Return(BooleanConstant(true)); Return(TrueConstant());
BIND(&return_false); BIND(&return_false);
Return(BooleanConstant(false)); Return(FalseConstant());
} }
// ES6 #sec-number.issafeinteger // ES6 #sec-number.issafeinteger
...@@ -176,10 +176,10 @@ TF_BUILTIN(NumberIsSafeInteger, CodeStubAssembler) { ...@@ -176,10 +176,10 @@ TF_BUILTIN(NumberIsSafeInteger, CodeStubAssembler) {
&return_true, &return_false); &return_true, &return_false);
BIND(&return_true); BIND(&return_true);
Return(BooleanConstant(true)); Return(TrueConstant());
BIND(&return_false); BIND(&return_false);
Return(BooleanConstant(false)); Return(FalseConstant());
} }
// ES6 #sec-number.parsefloat // ES6 #sec-number.parsefloat
......
...@@ -157,10 +157,10 @@ TF_BUILTIN(ObjectPrototypeHasOwnProperty, ObjectBuiltinsAssembler) { ...@@ -157,10 +157,10 @@ TF_BUILTIN(ObjectPrototypeHasOwnProperty, ObjectBuiltinsAssembler) {
Branch(IsName(key), &return_false, &call_runtime); Branch(IsName(key), &return_false, &call_runtime);
BIND(&return_true); BIND(&return_true);
Return(BooleanConstant(true)); Return(TrueConstant());
BIND(&return_false); BIND(&return_false);
Return(BooleanConstant(false)); Return(FalseConstant());
BIND(&call_runtime); BIND(&call_runtime);
Return(CallRuntime(Runtime::kObjectHasOwnProperty, context, object, key)); Return(CallRuntime(Runtime::kObjectHasOwnProperty, context, object, key));
......
...@@ -910,7 +910,7 @@ void PromiseBuiltinsAssembler::BranchIfAccessCheckFailed( ...@@ -910,7 +910,7 @@ void PromiseBuiltinsAssembler::BranchIfAccessCheckFailed(
{ {
Branch(WordEqual(CallRuntime(Runtime::kAllowDynamicFunction, context, Branch(WordEqual(CallRuntime(Runtime::kAllowDynamicFunction, context,
promise_constructor), promise_constructor),
BooleanConstant(true)), TrueConstant()),
&has_access, if_noaccess); &has_access, if_noaccess);
} }
......
...@@ -420,12 +420,12 @@ void StringBuiltinsAssembler::GenerateStringRelationalComparison( ...@@ -420,12 +420,12 @@ void StringBuiltinsAssembler::GenerateStringRelationalComparison(
switch (mode) { switch (mode) {
case RelationalComparisonMode::kLessThan: case RelationalComparisonMode::kLessThan:
case RelationalComparisonMode::kLessThanOrEqual: case RelationalComparisonMode::kLessThanOrEqual:
Return(BooleanConstant(true)); Return(TrueConstant());
break; break;
case RelationalComparisonMode::kGreaterThan: case RelationalComparisonMode::kGreaterThan:
case RelationalComparisonMode::kGreaterThanOrEqual: case RelationalComparisonMode::kGreaterThanOrEqual:
Return(BooleanConstant(false)); Return(FalseConstant());
break; break;
} }
...@@ -433,12 +433,12 @@ void StringBuiltinsAssembler::GenerateStringRelationalComparison( ...@@ -433,12 +433,12 @@ void StringBuiltinsAssembler::GenerateStringRelationalComparison(
switch (mode) { switch (mode) {
case RelationalComparisonMode::kLessThan: case RelationalComparisonMode::kLessThan:
case RelationalComparisonMode::kGreaterThan: case RelationalComparisonMode::kGreaterThan:
Return(BooleanConstant(false)); Return(FalseConstant());
break; break;
case RelationalComparisonMode::kLessThanOrEqual: case RelationalComparisonMode::kLessThanOrEqual:
case RelationalComparisonMode::kGreaterThanOrEqual: case RelationalComparisonMode::kGreaterThanOrEqual:
Return(BooleanConstant(true)); Return(TrueConstant());
break; break;
} }
...@@ -446,12 +446,12 @@ void StringBuiltinsAssembler::GenerateStringRelationalComparison( ...@@ -446,12 +446,12 @@ void StringBuiltinsAssembler::GenerateStringRelationalComparison(
switch (mode) { switch (mode) {
case RelationalComparisonMode::kLessThan: case RelationalComparisonMode::kLessThan:
case RelationalComparisonMode::kLessThanOrEqual: case RelationalComparisonMode::kLessThanOrEqual:
Return(BooleanConstant(false)); Return(FalseConstant());
break; break;
case RelationalComparisonMode::kGreaterThan: case RelationalComparisonMode::kGreaterThan:
case RelationalComparisonMode::kGreaterThanOrEqual: case RelationalComparisonMode::kGreaterThanOrEqual:
Return(BooleanConstant(true)); Return(TrueConstant());
break; break;
} }
} }
...@@ -2333,7 +2333,7 @@ TF_BUILTIN(StringIteratorPrototypeNext, StringBuiltinsAssembler) { ...@@ -2333,7 +2333,7 @@ TF_BUILTIN(StringIteratorPrototypeNext, StringBuiltinsAssembler) {
VARIABLE(var_done, MachineRepresentation::kTagged); VARIABLE(var_done, MachineRepresentation::kTagged);
var_value.Bind(UndefinedConstant()); var_value.Bind(UndefinedConstant());
var_done.Bind(BooleanConstant(true)); var_done.Bind(TrueConstant());
Label throw_bad_receiver(this), next_codepoint(this), return_result(this); Label throw_bad_receiver(this), next_codepoint(this), return_result(this);
...@@ -2361,7 +2361,7 @@ TF_BUILTIN(StringIteratorPrototypeNext, StringBuiltinsAssembler) { ...@@ -2361,7 +2361,7 @@ TF_BUILTIN(StringIteratorPrototypeNext, StringBuiltinsAssembler) {
Node* length = LoadStringLength(value); Node* length = LoadStringLength(value);
StoreObjectFieldNoWriteBarrier(iterator, JSStringIterator::kNextIndexOffset, StoreObjectFieldNoWriteBarrier(iterator, JSStringIterator::kNextIndexOffset,
SmiAdd(position, length)); SmiAdd(position, length));
var_done.Bind(BooleanConstant(false)); var_done.Bind(FalseConstant());
Goto(&return_result); Goto(&return_result);
} }
......
...@@ -357,7 +357,7 @@ TF_BUILTIN(TypedArrayConstructByLength, TypedArrayBuiltinsAssembler) { ...@@ -357,7 +357,7 @@ TF_BUILTIN(TypedArrayConstructByLength, TypedArrayBuiltinsAssembler) {
CSA_ASSERT(this, IsJSTypedArray(holder)); CSA_ASSERT(this, IsJSTypedArray(holder));
CSA_ASSERT(this, TaggedIsPositiveSmi(element_size)); CSA_ASSERT(this, TaggedIsPositiveSmi(element_size));
Node* initialize = BooleanConstant(true); Node* initialize = TrueConstant();
Label invalid_length(this); Label invalid_length(this);
...@@ -560,7 +560,7 @@ TF_BUILTIN(TypedArrayConstructByArrayLike, TypedArrayBuiltinsAssembler) { ...@@ -560,7 +560,7 @@ TF_BUILTIN(TypedArrayConstructByArrayLike, TypedArrayBuiltinsAssembler) {
CSA_ASSERT(this, TaggedIsSmi(element_size)); CSA_ASSERT(this, TaggedIsSmi(element_size));
Node* context = Parameter(Descriptor::kContext); Node* context = Parameter(Descriptor::kContext);
Node* initialize = BooleanConstant(false); Node* initialize = FalseConstant();
Label invalid_length(this), fill(this), fast_copy(this); Label invalid_length(this), fill(this), fast_copy(this);
......
...@@ -1046,7 +1046,7 @@ void CodeStubAssembler::BranchIfToBooleanIsTrue(Node* value, Label* if_true, ...@@ -1046,7 +1046,7 @@ void CodeStubAssembler::BranchIfToBooleanIsTrue(Node* value, Label* if_true,
Label if_smi(this), if_notsmi(this), if_heapnumber(this, Label::kDeferred), Label if_smi(this), if_notsmi(this), if_heapnumber(this, Label::kDeferred),
if_bigint(this, Label::kDeferred); if_bigint(this, Label::kDeferred);
// Rule out false {value}. // Rule out false {value}.
GotoIf(WordEqual(value, BooleanConstant(false)), if_false); GotoIf(WordEqual(value, FalseConstant()), if_false);
// Check if {value} is a Smi or a HeapObject. // Check if {value} is a Smi or a HeapObject.
Branch(TaggedIsSmi(value), &if_smi, &if_notsmi); Branch(TaggedIsSmi(value), &if_smi, &if_notsmi);
...@@ -1090,7 +1090,7 @@ void CodeStubAssembler::BranchIfToBooleanIsTrue(Node* value, Label* if_true, ...@@ -1090,7 +1090,7 @@ void CodeStubAssembler::BranchIfToBooleanIsTrue(Node* value, Label* if_true,
Node* result = Node* result =
CallRuntime(Runtime::kBigIntToBoolean, NoContextConstant(), value); CallRuntime(Runtime::kBigIntToBoolean, NoContextConstant(), value);
CSA_ASSERT(this, IsBoolean(result)); CSA_ASSERT(this, IsBoolean(result));
Branch(WordEqual(result, BooleanConstant(true)), if_true, if_false); Branch(WordEqual(result, TrueConstant()), if_true, if_false);
} }
} }
} }
...@@ -8669,13 +8669,13 @@ Node* CodeStubAssembler::RelationalComparison(RelationalComparisonMode mode, ...@@ -8669,13 +8669,13 @@ Node* CodeStubAssembler::RelationalComparison(RelationalComparisonMode mode,
BIND(&return_true); BIND(&return_true);
{ {
result.Bind(BooleanConstant(true)); result.Bind(TrueConstant());
Goto(&end); Goto(&end);
} }
BIND(&return_false); BIND(&return_false);
{ {
result.Bind(BooleanConstant(false)); result.Bind(FalseConstant());
Goto(&end); Goto(&end);
} }
...@@ -9600,13 +9600,13 @@ Node* CodeStubAssembler::HasProperty(Node* object, Node* key, Node* context, ...@@ -9600,13 +9600,13 @@ Node* CodeStubAssembler::HasProperty(Node* object, Node* key, Node* context,
BIND(&return_true); BIND(&return_true);
{ {
result.Bind(BooleanConstant(true)); result.Bind(TrueConstant());
Goto(&end); Goto(&end);
} }
BIND(&return_false); BIND(&return_false);
{ {
result.Bind(BooleanConstant(false)); result.Bind(FalseConstant());
Goto(&end); Goto(&end);
} }
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "src/code-events.h" #include "src/code-events.h"
#include "src/code-factory.h" #include "src/code-factory.h"
#include "src/debug/debug.h" #include "src/debug/debug.h"
#include "src/factory.h"
#include "src/ic/accessor-assembler.h" #include "src/ic/accessor-assembler.h"
#include "src/ic/binary-op-assembler.h" #include "src/ic/binary-op-assembler.h"
#include "src/interpreter/bytecode-flags.h" #include "src/interpreter/bytecode-flags.h"
...@@ -1426,17 +1425,15 @@ IGNITION_HANDLER(ToBooleanLogicalNot, InterpreterAssembler) { ...@@ -1426,17 +1425,15 @@ IGNITION_HANDLER(ToBooleanLogicalNot, InterpreterAssembler) {
Node* value = GetAccumulator(); Node* value = GetAccumulator();
Variable result(this, MachineRepresentation::kTagged); Variable result(this, MachineRepresentation::kTagged);
Label if_true(this), if_false(this), end(this); Label if_true(this), if_false(this), end(this);
Node* true_value = BooleanConstant(true);
Node* false_value = BooleanConstant(false);
BranchIfToBooleanIsTrue(value, &if_true, &if_false); BranchIfToBooleanIsTrue(value, &if_true, &if_false);
BIND(&if_true); BIND(&if_true);
{ {
result.Bind(false_value); result.Bind(FalseConstant());
Goto(&end); Goto(&end);
} }
BIND(&if_false); BIND(&if_false);
{ {
result.Bind(true_value); result.Bind(TrueConstant());
Goto(&end); Goto(&end);
} }
BIND(&end); BIND(&end);
...@@ -1452,8 +1449,8 @@ IGNITION_HANDLER(LogicalNot, InterpreterAssembler) { ...@@ -1452,8 +1449,8 @@ IGNITION_HANDLER(LogicalNot, InterpreterAssembler) {
Node* value = GetAccumulator(); Node* value = GetAccumulator();
Variable result(this, MachineRepresentation::kTagged); Variable result(this, MachineRepresentation::kTagged);
Label if_true(this), if_false(this), end(this); Label if_true(this), if_false(this), end(this);
Node* true_value = BooleanConstant(true); Node* true_value = TrueConstant();
Node* false_value = BooleanConstant(false); Node* false_value = FalseConstant();
Branch(WordEqual(value, true_value), &if_true, &if_false); Branch(WordEqual(value, true_value), &if_true, &if_false);
BIND(&if_true); BIND(&if_true);
{ {
...@@ -1462,10 +1459,7 @@ IGNITION_HANDLER(LogicalNot, InterpreterAssembler) { ...@@ -1462,10 +1459,7 @@ IGNITION_HANDLER(LogicalNot, InterpreterAssembler) {
} }
BIND(&if_false); BIND(&if_false);
{ {
if (FLAG_debug_code) { CSA_ASSERT(this, WordEqual(value, false_value));
AbortIfWordNotEqual(value, false_value,
BailoutReason::kExpectedBooleanValue);
}
result.Bind(true_value); result.Bind(true_value);
Goto(&end); Goto(&end);
} }
...@@ -1951,7 +1945,7 @@ IGNITION_HANDLER(TestUndetectable, InterpreterAssembler) { ...@@ -1951,7 +1945,7 @@ IGNITION_HANDLER(TestUndetectable, InterpreterAssembler) {
Node* object = GetAccumulator(); Node* object = GetAccumulator();
// If the object is an Smi then return false. // If the object is an Smi then return false.
SetAccumulator(BooleanConstant(false)); SetAccumulator(FalseConstant());
GotoIf(TaggedIsSmi(object), &end); GotoIf(TaggedIsSmi(object), &end);
// If it is a HeapObject, load the map and check for undetectable bit. // If it is a HeapObject, load the map and check for undetectable bit.
...@@ -1968,8 +1962,7 @@ IGNITION_HANDLER(TestUndetectable, InterpreterAssembler) { ...@@ -1968,8 +1962,7 @@ IGNITION_HANDLER(TestUndetectable, InterpreterAssembler) {
// Test if the value in accumulator is strictly equal to null. // Test if the value in accumulator is strictly equal to null.
IGNITION_HANDLER(TestNull, InterpreterAssembler) { IGNITION_HANDLER(TestNull, InterpreterAssembler) {
Node* object = GetAccumulator(); Node* object = GetAccumulator();
Node* null_value = HeapConstant(isolate()->factory()->null_value()); Node* result = SelectBooleanConstant(WordEqual(object, NullConstant()));
Node* result = SelectBooleanConstant(WordEqual(object, null_value));
SetAccumulator(result); SetAccumulator(result);
Dispatch(); Dispatch();
} }
...@@ -1979,8 +1972,7 @@ IGNITION_HANDLER(TestNull, InterpreterAssembler) { ...@@ -1979,8 +1972,7 @@ IGNITION_HANDLER(TestNull, InterpreterAssembler) {
// Test if the value in the accumulator is strictly equal to undefined. // Test if the value in the accumulator is strictly equal to undefined.
IGNITION_HANDLER(TestUndefined, InterpreterAssembler) { IGNITION_HANDLER(TestUndefined, InterpreterAssembler) {
Node* object = GetAccumulator(); Node* object = GetAccumulator();
Node* undefined_value = HeapConstant(isolate()->factory()->undefined_value()); Node* result = SelectBooleanConstant(WordEqual(object, UndefinedConstant()));
Node* result = SelectBooleanConstant(WordEqual(object, undefined_value));
SetAccumulator(result); SetAccumulator(result);
Dispatch(); Dispatch();
} }
...@@ -2036,8 +2028,8 @@ IGNITION_HANDLER(TestTypeOf, InterpreterAssembler) { ...@@ -2036,8 +2028,8 @@ IGNITION_HANDLER(TestTypeOf, InterpreterAssembler) {
BIND(&if_boolean); BIND(&if_boolean);
{ {
Comment("IfBoolean"); Comment("IfBoolean");
GotoIf(WordEqual(object, BooleanConstant(true)), &if_true); GotoIf(WordEqual(object, TrueConstant()), &if_true);
Branch(WordEqual(object, BooleanConstant(false)), &if_true, &if_false); Branch(WordEqual(object, FalseConstant()), &if_true, &if_false);
} }
BIND(&if_undefined); BIND(&if_undefined);
{ {
...@@ -2086,12 +2078,12 @@ IGNITION_HANDLER(TestTypeOf, InterpreterAssembler) { ...@@ -2086,12 +2078,12 @@ IGNITION_HANDLER(TestTypeOf, InterpreterAssembler) {
BIND(&if_false); BIND(&if_false);
{ {
SetAccumulator(BooleanConstant(false)); SetAccumulator(FalseConstant());
Goto(&end); Goto(&end);
} }
BIND(&if_true); BIND(&if_true);
{ {
SetAccumulator(BooleanConstant(true)); SetAccumulator(TrueConstant());
Goto(&end); Goto(&end);
} }
BIND(&end); BIND(&end);
...@@ -2124,10 +2116,9 @@ IGNITION_HANDLER(JumpConstant, InterpreterAssembler) { ...@@ -2124,10 +2116,9 @@ IGNITION_HANDLER(JumpConstant, InterpreterAssembler) {
IGNITION_HANDLER(JumpIfTrue, InterpreterAssembler) { IGNITION_HANDLER(JumpIfTrue, InterpreterAssembler) {
Node* accumulator = GetAccumulator(); Node* accumulator = GetAccumulator();
Node* relative_jump = BytecodeOperandUImmWord(0); Node* relative_jump = BytecodeOperandUImmWord(0);
Node* true_value = BooleanConstant(true);
CSA_ASSERT(this, TaggedIsNotSmi(accumulator)); CSA_ASSERT(this, TaggedIsNotSmi(accumulator));
CSA_ASSERT(this, IsBoolean(accumulator)); CSA_ASSERT(this, IsBoolean(accumulator));
JumpIfWordEqual(accumulator, true_value, relative_jump); JumpIfWordEqual(accumulator, TrueConstant(), relative_jump);
} }
// JumpIfTrueConstant <idx> // JumpIfTrueConstant <idx>
...@@ -2139,10 +2130,9 @@ IGNITION_HANDLER(JumpIfTrueConstant, InterpreterAssembler) { ...@@ -2139,10 +2130,9 @@ IGNITION_HANDLER(JumpIfTrueConstant, InterpreterAssembler) {
Node* accumulator = GetAccumulator(); Node* accumulator = GetAccumulator();
Node* index = BytecodeOperandIdx(0); Node* index = BytecodeOperandIdx(0);
Node* relative_jump = LoadAndUntagConstantPoolEntry(index); Node* relative_jump = LoadAndUntagConstantPoolEntry(index);
Node* true_value = BooleanConstant(true);
CSA_ASSERT(this, TaggedIsNotSmi(accumulator)); CSA_ASSERT(this, TaggedIsNotSmi(accumulator));
CSA_ASSERT(this, IsBoolean(accumulator)); CSA_ASSERT(this, IsBoolean(accumulator));
JumpIfWordEqual(accumulator, true_value, relative_jump); JumpIfWordEqual(accumulator, TrueConstant(), relative_jump);
} }
// JumpIfFalse <imm> // JumpIfFalse <imm>
...@@ -2153,10 +2143,9 @@ IGNITION_HANDLER(JumpIfTrueConstant, InterpreterAssembler) { ...@@ -2153,10 +2143,9 @@ IGNITION_HANDLER(JumpIfTrueConstant, InterpreterAssembler) {
IGNITION_HANDLER(JumpIfFalse, InterpreterAssembler) { IGNITION_HANDLER(JumpIfFalse, InterpreterAssembler) {
Node* accumulator = GetAccumulator(); Node* accumulator = GetAccumulator();
Node* relative_jump = BytecodeOperandUImmWord(0); Node* relative_jump = BytecodeOperandUImmWord(0);
Node* false_value = BooleanConstant(false);
CSA_ASSERT(this, TaggedIsNotSmi(accumulator)); CSA_ASSERT(this, TaggedIsNotSmi(accumulator));
CSA_ASSERT(this, IsBoolean(accumulator)); CSA_ASSERT(this, IsBoolean(accumulator));
JumpIfWordEqual(accumulator, false_value, relative_jump); JumpIfWordEqual(accumulator, FalseConstant(), relative_jump);
} }
// JumpIfFalseConstant <idx> // JumpIfFalseConstant <idx>
...@@ -2168,10 +2157,9 @@ IGNITION_HANDLER(JumpIfFalseConstant, InterpreterAssembler) { ...@@ -2168,10 +2157,9 @@ IGNITION_HANDLER(JumpIfFalseConstant, InterpreterAssembler) {
Node* accumulator = GetAccumulator(); Node* accumulator = GetAccumulator();
Node* index = BytecodeOperandIdx(0); Node* index = BytecodeOperandIdx(0);
Node* relative_jump = LoadAndUntagConstantPoolEntry(index); Node* relative_jump = LoadAndUntagConstantPoolEntry(index);
Node* false_value = BooleanConstant(false);
CSA_ASSERT(this, TaggedIsNotSmi(accumulator)); CSA_ASSERT(this, TaggedIsNotSmi(accumulator));
CSA_ASSERT(this, IsBoolean(accumulator)); CSA_ASSERT(this, IsBoolean(accumulator));
JumpIfWordEqual(accumulator, false_value, relative_jump); JumpIfWordEqual(accumulator, FalseConstant(), relative_jump);
} }
// JumpIfToBooleanTrue <imm> // JumpIfToBooleanTrue <imm>
...@@ -2244,9 +2232,8 @@ IGNITION_HANDLER(JumpIfToBooleanFalseConstant, InterpreterAssembler) { ...@@ -2244,9 +2232,8 @@ IGNITION_HANDLER(JumpIfToBooleanFalseConstant, InterpreterAssembler) {
// referenced by the accumulator is the null constant. // referenced by the accumulator is the null constant.
IGNITION_HANDLER(JumpIfNull, InterpreterAssembler) { IGNITION_HANDLER(JumpIfNull, InterpreterAssembler) {
Node* accumulator = GetAccumulator(); Node* accumulator = GetAccumulator();
Node* null_value = HeapConstant(isolate()->factory()->null_value());
Node* relative_jump = BytecodeOperandUImmWord(0); Node* relative_jump = BytecodeOperandUImmWord(0);
JumpIfWordEqual(accumulator, null_value, relative_jump); JumpIfWordEqual(accumulator, NullConstant(), relative_jump);
} }
// JumpIfNullConstant <idx> // JumpIfNullConstant <idx>
...@@ -2255,10 +2242,9 @@ IGNITION_HANDLER(JumpIfNull, InterpreterAssembler) { ...@@ -2255,10 +2242,9 @@ IGNITION_HANDLER(JumpIfNull, InterpreterAssembler) {
// pool if the object referenced by the accumulator is the null constant. // pool if the object referenced by the accumulator is the null constant.
IGNITION_HANDLER(JumpIfNullConstant, InterpreterAssembler) { IGNITION_HANDLER(JumpIfNullConstant, InterpreterAssembler) {
Node* accumulator = GetAccumulator(); Node* accumulator = GetAccumulator();
Node* null_value = HeapConstant(isolate()->factory()->null_value());
Node* index = BytecodeOperandIdx(0); Node* index = BytecodeOperandIdx(0);
Node* relative_jump = LoadAndUntagConstantPoolEntry(index); Node* relative_jump = LoadAndUntagConstantPoolEntry(index);
JumpIfWordEqual(accumulator, null_value, relative_jump); JumpIfWordEqual(accumulator, NullConstant(), relative_jump);
} }
// JumpIfNotNull <imm> // JumpIfNotNull <imm>
...@@ -2267,9 +2253,8 @@ IGNITION_HANDLER(JumpIfNullConstant, InterpreterAssembler) { ...@@ -2267,9 +2253,8 @@ IGNITION_HANDLER(JumpIfNullConstant, InterpreterAssembler) {
// referenced by the accumulator is not the null constant. // referenced by the accumulator is not the null constant.
IGNITION_HANDLER(JumpIfNotNull, InterpreterAssembler) { IGNITION_HANDLER(JumpIfNotNull, InterpreterAssembler) {
Node* accumulator = GetAccumulator(); Node* accumulator = GetAccumulator();
Node* null_value = HeapConstant(isolate()->factory()->null_value());
Node* relative_jump = BytecodeOperandUImmWord(0); Node* relative_jump = BytecodeOperandUImmWord(0);
JumpIfWordNotEqual(accumulator, null_value, relative_jump); JumpIfWordNotEqual(accumulator, NullConstant(), relative_jump);
} }
// JumpIfNotNullConstant <idx> // JumpIfNotNullConstant <idx>
...@@ -2278,10 +2263,9 @@ IGNITION_HANDLER(JumpIfNotNull, InterpreterAssembler) { ...@@ -2278,10 +2263,9 @@ IGNITION_HANDLER(JumpIfNotNull, InterpreterAssembler) {
// pool if the object referenced by the accumulator is not the null constant. // pool if the object referenced by the accumulator is not the null constant.
IGNITION_HANDLER(JumpIfNotNullConstant, InterpreterAssembler) { IGNITION_HANDLER(JumpIfNotNullConstant, InterpreterAssembler) {
Node* accumulator = GetAccumulator(); Node* accumulator = GetAccumulator();
Node* null_value = HeapConstant(isolate()->factory()->null_value());
Node* index = BytecodeOperandIdx(0); Node* index = BytecodeOperandIdx(0);
Node* relative_jump = LoadAndUntagConstantPoolEntry(index); Node* relative_jump = LoadAndUntagConstantPoolEntry(index);
JumpIfWordNotEqual(accumulator, null_value, relative_jump); JumpIfWordNotEqual(accumulator, NullConstant(), relative_jump);
} }
// JumpIfUndefined <imm> // JumpIfUndefined <imm>
...@@ -2290,9 +2274,8 @@ IGNITION_HANDLER(JumpIfNotNullConstant, InterpreterAssembler) { ...@@ -2290,9 +2274,8 @@ IGNITION_HANDLER(JumpIfNotNullConstant, InterpreterAssembler) {
// referenced by the accumulator is the undefined constant. // referenced by the accumulator is the undefined constant.
IGNITION_HANDLER(JumpIfUndefined, InterpreterAssembler) { IGNITION_HANDLER(JumpIfUndefined, InterpreterAssembler) {
Node* accumulator = GetAccumulator(); Node* accumulator = GetAccumulator();
Node* undefined_value = HeapConstant(isolate()->factory()->undefined_value());
Node* relative_jump = BytecodeOperandUImmWord(0); Node* relative_jump = BytecodeOperandUImmWord(0);
JumpIfWordEqual(accumulator, undefined_value, relative_jump); JumpIfWordEqual(accumulator, UndefinedConstant(), relative_jump);
} }
// JumpIfUndefinedConstant <idx> // JumpIfUndefinedConstant <idx>
...@@ -2301,10 +2284,9 @@ IGNITION_HANDLER(JumpIfUndefined, InterpreterAssembler) { ...@@ -2301,10 +2284,9 @@ IGNITION_HANDLER(JumpIfUndefined, InterpreterAssembler) {
// pool if the object referenced by the accumulator is the undefined constant. // pool if the object referenced by the accumulator is the undefined constant.
IGNITION_HANDLER(JumpIfUndefinedConstant, InterpreterAssembler) { IGNITION_HANDLER(JumpIfUndefinedConstant, InterpreterAssembler) {
Node* accumulator = GetAccumulator(); Node* accumulator = GetAccumulator();
Node* undefined_value = HeapConstant(isolate()->factory()->undefined_value());
Node* index = BytecodeOperandIdx(0); Node* index = BytecodeOperandIdx(0);
Node* relative_jump = LoadAndUntagConstantPoolEntry(index); Node* relative_jump = LoadAndUntagConstantPoolEntry(index);
JumpIfWordEqual(accumulator, undefined_value, relative_jump); JumpIfWordEqual(accumulator, UndefinedConstant(), relative_jump);
} }
// JumpIfNotUndefined <imm> // JumpIfNotUndefined <imm>
...@@ -2313,9 +2295,8 @@ IGNITION_HANDLER(JumpIfUndefinedConstant, InterpreterAssembler) { ...@@ -2313,9 +2295,8 @@ IGNITION_HANDLER(JumpIfUndefinedConstant, InterpreterAssembler) {
// referenced by the accumulator is not the undefined constant. // referenced by the accumulator is not the undefined constant.
IGNITION_HANDLER(JumpIfNotUndefined, InterpreterAssembler) { IGNITION_HANDLER(JumpIfNotUndefined, InterpreterAssembler) {
Node* accumulator = GetAccumulator(); Node* accumulator = GetAccumulator();
Node* undefined_value = HeapConstant(isolate()->factory()->undefined_value());
Node* relative_jump = BytecodeOperandUImmWord(0); Node* relative_jump = BytecodeOperandUImmWord(0);
JumpIfWordNotEqual(accumulator, undefined_value, relative_jump); JumpIfWordNotEqual(accumulator, UndefinedConstant(), relative_jump);
} }
// JumpIfNotUndefinedConstant <idx> // JumpIfNotUndefinedConstant <idx>
...@@ -2325,10 +2306,9 @@ IGNITION_HANDLER(JumpIfNotUndefined, InterpreterAssembler) { ...@@ -2325,10 +2306,9 @@ IGNITION_HANDLER(JumpIfNotUndefined, InterpreterAssembler) {
// constant. // constant.
IGNITION_HANDLER(JumpIfNotUndefinedConstant, InterpreterAssembler) { IGNITION_HANDLER(JumpIfNotUndefinedConstant, InterpreterAssembler) {
Node* accumulator = GetAccumulator(); Node* accumulator = GetAccumulator();
Node* undefined_value = HeapConstant(isolate()->factory()->undefined_value());
Node* index = BytecodeOperandIdx(0); Node* index = BytecodeOperandIdx(0);
Node* relative_jump = LoadAndUntagConstantPoolEntry(index); Node* relative_jump = LoadAndUntagConstantPoolEntry(index);
JumpIfWordNotEqual(accumulator, undefined_value, relative_jump); JumpIfWordNotEqual(accumulator, UndefinedConstant(), relative_jump);
} }
// JumpIfJSReceiver <imm> // JumpIfJSReceiver <imm>
...@@ -2835,10 +2815,9 @@ IGNITION_HANDLER(Return, InterpreterAssembler) { ...@@ -2835,10 +2815,9 @@ IGNITION_HANDLER(Return, InterpreterAssembler) {
// Throws an exception if the value in the accumulator is TheHole. // Throws an exception if the value in the accumulator is TheHole.
IGNITION_HANDLER(ThrowReferenceErrorIfHole, InterpreterAssembler) { IGNITION_HANDLER(ThrowReferenceErrorIfHole, InterpreterAssembler) {
Node* value = GetAccumulator(); Node* value = GetAccumulator();
Node* the_hole_value = HeapConstant(isolate()->factory()->the_hole_value());
Label throw_error(this, Label::kDeferred); Label throw_error(this, Label::kDeferred);
GotoIf(WordEqual(value, the_hole_value), &throw_error); GotoIf(WordEqual(value, TheHoleConstant()), &throw_error);
Dispatch(); Dispatch();
BIND(&throw_error); BIND(&throw_error);
...@@ -2855,10 +2834,9 @@ IGNITION_HANDLER(ThrowReferenceErrorIfHole, InterpreterAssembler) { ...@@ -2855,10 +2834,9 @@ IGNITION_HANDLER(ThrowReferenceErrorIfHole, InterpreterAssembler) {
// Throws an exception if the value in the accumulator is TheHole. // Throws an exception if the value in the accumulator is TheHole.
IGNITION_HANDLER(ThrowSuperNotCalledIfHole, InterpreterAssembler) { IGNITION_HANDLER(ThrowSuperNotCalledIfHole, InterpreterAssembler) {
Node* value = GetAccumulator(); Node* value = GetAccumulator();
Node* the_hole_value = HeapConstant(isolate()->factory()->the_hole_value());
Label throw_error(this, Label::kDeferred); Label throw_error(this, Label::kDeferred);
GotoIf(WordEqual(value, the_hole_value), &throw_error); GotoIf(WordEqual(value, TheHoleConstant()), &throw_error);
Dispatch(); Dispatch();
BIND(&throw_error); BIND(&throw_error);
...@@ -2875,10 +2853,9 @@ IGNITION_HANDLER(ThrowSuperNotCalledIfHole, InterpreterAssembler) { ...@@ -2875,10 +2853,9 @@ IGNITION_HANDLER(ThrowSuperNotCalledIfHole, InterpreterAssembler) {
// TheHole. // TheHole.
IGNITION_HANDLER(ThrowSuperAlreadyCalledIfNotHole, InterpreterAssembler) { IGNITION_HANDLER(ThrowSuperAlreadyCalledIfNotHole, InterpreterAssembler) {
Node* value = GetAccumulator(); Node* value = GetAccumulator();
Node* the_hole_value = HeapConstant(isolate()->factory()->the_hole_value());
Label throw_error(this, Label::kDeferred); Label throw_error(this, Label::kDeferred);
GotoIf(WordNotEqual(value, the_hole_value), &throw_error); GotoIf(WordNotEqual(value, TheHoleConstant()), &throw_error);
Dispatch(); Dispatch();
BIND(&throw_error); BIND(&throw_error);
...@@ -3098,12 +3075,12 @@ IGNITION_HANDLER(ForInContinue, InterpreterAssembler) { ...@@ -3098,12 +3075,12 @@ IGNITION_HANDLER(ForInContinue, InterpreterAssembler) {
Branch(WordEqual(index, cache_length), &if_true, &if_false); Branch(WordEqual(index, cache_length), &if_true, &if_false);
BIND(&if_true); BIND(&if_true);
{ {
SetAccumulator(BooleanConstant(false)); SetAccumulator(FalseConstant());
Goto(&end); Goto(&end);
} }
BIND(&if_false); BIND(&if_false);
{ {
SetAccumulator(BooleanConstant(true)); SetAccumulator(TrueConstant());
Goto(&end); Goto(&end);
} }
BIND(&end); BIND(&end);
......
...@@ -142,13 +142,13 @@ Node* IntrinsicsGenerator::IsInstanceType(Node* input, int type) { ...@@ -142,13 +142,13 @@ Node* IntrinsicsGenerator::IsInstanceType(Node* input, int type) {
__ BIND(&return_true); __ BIND(&return_true);
{ {
return_value.Bind(__ BooleanConstant(true)); return_value.Bind(__ TrueConstant());
__ Goto(&end); __ Goto(&end);
} }
__ BIND(&return_false); __ BIND(&return_false);
{ {
return_value.Bind(__ BooleanConstant(false)); return_value.Bind(__ FalseConstant());
__ Goto(&end); __ Goto(&end);
} }
...@@ -175,13 +175,13 @@ Node* IntrinsicsGenerator::IsJSReceiver(Node* input, Node* arg_count, ...@@ -175,13 +175,13 @@ Node* IntrinsicsGenerator::IsJSReceiver(Node* input, Node* arg_count,
__ BIND(&return_true); __ BIND(&return_true);
{ {
return_value.Bind(__ BooleanConstant(true)); return_value.Bind(__ TrueConstant());
__ Goto(&end); __ Goto(&end);
} }
__ BIND(&return_false); __ BIND(&return_false);
{ {
return_value.Bind(__ BooleanConstant(false)); return_value.Bind(__ FalseConstant());
__ Goto(&end); __ Goto(&end);
} }
...@@ -236,13 +236,13 @@ Node* IntrinsicsGenerator::IsSmi(Node* input, Node* arg_count, Node* context) { ...@@ -236,13 +236,13 @@ Node* IntrinsicsGenerator::IsSmi(Node* input, Node* arg_count, Node* context) {
__ Branch(__ TaggedIsSmi(arg), &if_smi, &if_not_smi); __ Branch(__ TaggedIsSmi(arg), &if_smi, &if_not_smi);
__ BIND(&if_smi); __ BIND(&if_smi);
{ {
return_value.Bind(__ BooleanConstant(true)); return_value.Bind(__ TrueConstant());
__ Goto(&end); __ Goto(&end);
} }
__ BIND(&if_not_smi); __ BIND(&if_not_smi);
{ {
return_value.Bind(__ BooleanConstant(false)); return_value.Bind(__ FalseConstant());
__ Goto(&end); __ Goto(&end);
} }
......
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