Commit 23691cf0 authored by olivf@chromium.org's avatar olivf@chromium.org

also remove the constant

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15043 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 73b7ab9a
......@@ -4765,9 +4765,7 @@ void FullCodeGenerator::EmitLiteralCompareNil(CompareOperation* expr,
VisitForAccumulatorValue(sub_expr);
PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
EqualityKind kind = expr->op() == Token::EQ_STRICT
? kStrictEquality : kNonStrictEquality;
if (kind == kStrictEquality) {
if (expr->op() == Token::EQ_STRICT) {
Heap::RootListIndex nil_value = nil == kNullValue ?
Heap::kNullValueRootIndex :
Heap::kUndefinedValueRootIndex;
......
......@@ -9918,11 +9918,9 @@ void HOptimizedGraphBuilder::HandleLiteralCompareNil(CompareOperation* expr,
ASSERT(!HasStackOverflow());
ASSERT(current_block() != NULL);
ASSERT(current_block()->HasPredecessor());
EqualityKind kind =
expr->op() == Token::EQ_STRICT ? kStrictEquality : kNonStrictEquality;
HIfContinuation continuation;
CompareNilICStub::Types types;
if (kind == kStrictEquality) {
if (expr->op() == Token::EQ_STRICT) {
IfBuilder if_nil(this);
if_nil.If<HCompareObjectEqAndBranch>(
value, (nil== kNullValue) ? graph()->GetConstantNull()
......@@ -9931,10 +9929,9 @@ void HOptimizedGraphBuilder::HandleLiteralCompareNil(CompareOperation* expr,
if_nil.Else();
if_nil.CaptureContinuation(&continuation);
return ast_context()->ReturnContinuation(&continuation, expr->id());
} else {
types = CompareNilICStub::Types(expr->compare_nil_types());
if (types.IsEmpty()) types = CompareNilICStub::Types::FullCompare();
}
types = CompareNilICStub::Types(expr->compare_nil_types());
if (types.IsEmpty()) types = CompareNilICStub::Types::FullCompare();
Handle<Map> map_handle = expr->map();
BuildCompareNil(value, types, map_handle,
expr->position(), &continuation);
......
......@@ -4768,12 +4768,10 @@ void FullCodeGenerator::EmitLiteralCompareNil(CompareOperation* expr,
VisitForAccumulatorValue(sub_expr);
PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
EqualityKind kind = expr->op() == Token::EQ_STRICT
? kStrictEquality : kNonStrictEquality;
Handle<Object> nil_value = nil == kNullValue
? isolate()->factory()->null_value()
: isolate()->factory()->undefined_value();
if (kind == kStrictEquality) {
if (expr->op() == Token::EQ_STRICT) {
__ cmp(eax, nil_value);
Split(equal, if_true, if_false, fall_through);
} else {
......
......@@ -4805,10 +4805,8 @@ void FullCodeGenerator::EmitLiteralCompareNil(CompareOperation* expr,
VisitForAccumulatorValue(sub_expr);
PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
EqualityKind kind = expr->op() == Token::EQ_STRICT
? kStrictEquality : kNonStrictEquality;
__ mov(a0, result_register());
if (kind == kStrictEquality) {
if (expr->op() == Token::EQ_STRICT) {
Heap::RootListIndex nil_value = nil == kNullValue ?
Heap::kNullValueRootIndex :
Heap::kUndefinedValueRootIndex;
......
......@@ -146,10 +146,6 @@ class V8 : public AllStatic {
enum NilValue { kNullValue, kUndefinedValue };
// JavaScript defines two kinds of equality.
enum EqualityKind { kStrictEquality, kNonStrictEquality };
} } // namespace v8::internal
namespace i = v8::internal;
......
......@@ -4754,9 +4754,7 @@ void FullCodeGenerator::EmitLiteralCompareNil(CompareOperation* expr,
VisitForAccumulatorValue(sub_expr);
PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
EqualityKind kind = expr->op() == Token::EQ_STRICT
? kStrictEquality : kNonStrictEquality;
if (kind == kStrictEquality) {
if (expr->op() == Token::EQ_STRICT) {
Heap::RootListIndex nil_value = nil == kNullValue ?
Heap::kNullValueRootIndex :
Heap::kUndefinedValueRootIndex;
......
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