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