Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: src/ia32/full-codegen-ia32.cc

Issue 13728002: Add an IC for CompareNil operations (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix SunSpider regression Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4366 matching lines...) Expand 10 before | Expand all | Expand 10 after
4377 NilValue nil) { 4377 NilValue nil) {
4378 Label materialize_true, materialize_false; 4378 Label materialize_true, materialize_false;
4379 Label* if_true = NULL; 4379 Label* if_true = NULL;
4380 Label* if_false = NULL; 4380 Label* if_false = NULL;
4381 Label* fall_through = NULL; 4381 Label* fall_through = NULL;
4382 context()->PrepareTest(&materialize_true, &materialize_false, 4382 context()->PrepareTest(&materialize_true, &materialize_false,
4383 &if_true, &if_false, &fall_through); 4383 &if_true, &if_false, &fall_through);
4384 4384
4385 VisitForAccumulatorValue(sub_expr); 4385 VisitForAccumulatorValue(sub_expr);
4386 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 4386 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
4387 Handle<Object> nil_value = nil == kNullValue ? 4387
4388 isolate()->factory()->null_value() : 4388 EqualityKind kind = expr->op() == Token::EQ_STRICT
4389 isolate()->factory()->undefined_value(); 4389 ? kStrictEquality : kNonStrictEquality;
4390 __ cmp(eax, nil_value); 4390 if (kind == kStrictEquality) {
4391 if (expr->op() == Token::EQ_STRICT) { 4391 Handle<Object> nil_value = nil == kNullValue
4392 ? isolate()->factory()->null_value()
4393 : isolate()->factory()->undefined_value();
4394 __ cmp(eax, nil_value);
4392 Split(equal, if_true, if_false, fall_through); 4395 Split(equal, if_true, if_false, fall_through);
4393 } else { 4396 } else {
4394 Handle<Object> other_nil_value = nil == kNullValue ? 4397 __ mov(ecx, Immediate(Smi::FromInt(kind)));
4395 isolate()->factory()->undefined_value() : 4398 __ mov(ebx, Immediate(Smi::FromInt(nil)));
4396 isolate()->factory()->null_value(); 4399 Handle<Code> ic = CompareNilIC::GetUninitialized();
4397 __ j(equal, if_true); 4400 CallIC(ic, RelocInfo::CODE_TARGET, expr->CompareOperationFeedbackId());
4398 __ cmp(eax, other_nil_value); 4401 __ test(eax, eax);
4399 __ j(equal, if_true);
4400 __ JumpIfSmi(eax, if_false);
4401 // It can be an undetectable object.
4402 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset));
4403 __ movzx_b(edx, FieldOperand(edx, Map::kBitFieldOffset));
4404 __ test(edx, Immediate(1 << Map::kIsUndetectable));
4405 Split(not_zero, if_true, if_false, fall_through); 4402 Split(not_zero, if_true, if_false, fall_through);
4406 } 4403 }
4407 context()->Plug(if_true, if_false); 4404 context()->Plug(if_true, if_false);
4408 } 4405 }
4409 4406
4410 4407
4411 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { 4408 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) {
4412 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); 4409 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
4413 context()->Plug(eax); 4410 context()->Plug(eax);
4414 } 4411 }
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
4546 *stack_depth = 0; 4543 *stack_depth = 0;
4547 *context_length = 0; 4544 *context_length = 0;
4548 return previous_; 4545 return previous_;
4549 } 4546 }
4550 4547
4551 #undef __ 4548 #undef __
4552 4549
4553 } } // namespace v8::internal 4550 } } // namespace v8::internal
4554 4551
4555 #endif // V8_TARGET_ARCH_IA32 4552 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698