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

Side by Side Diff: src/arm/full-codegen-arm.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/arm/code-stubs-arm.cc ('k') | src/arm/lithium-arm.h » ('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 4365 matching lines...) Expand 10 before | Expand all | Expand 10 after
4376 NilValue nil) { 4376 NilValue nil) {
4377 Label materialize_true, materialize_false; 4377 Label materialize_true, materialize_false;
4378 Label* if_true = NULL; 4378 Label* if_true = NULL;
4379 Label* if_false = NULL; 4379 Label* if_false = NULL;
4380 Label* fall_through = NULL; 4380 Label* fall_through = NULL;
4381 context()->PrepareTest(&materialize_true, &materialize_false, 4381 context()->PrepareTest(&materialize_true, &materialize_false,
4382 &if_true, &if_false, &fall_through); 4382 &if_true, &if_false, &fall_through);
4383 4383
4384 VisitForAccumulatorValue(sub_expr); 4384 VisitForAccumulatorValue(sub_expr);
4385 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 4385 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
4386 Heap::RootListIndex nil_value = nil == kNullValue ? 4386 EqualityKind kind = expr->op() == Token::EQ_STRICT
4387 Heap::kNullValueRootIndex : 4387 ? kStrictEquality : kNonStrictEquality;
4388 Heap::kUndefinedValueRootIndex; 4388 if (kind == kStrictEquality) {
4389 __ LoadRoot(r1, nil_value); 4389 Heap::RootListIndex nil_value = nil == kNullValue ?
4390 __ cmp(r0, r1); 4390 Heap::kNullValueRootIndex :
4391 if (expr->op() == Token::EQ_STRICT) { 4391 Heap::kUndefinedValueRootIndex;
4392 __ LoadRoot(r1, nil_value);
4393 __ cmp(r0, r1);
4392 Split(eq, if_true, if_false, fall_through); 4394 Split(eq, if_true, if_false, fall_through);
4393 } else { 4395 } else {
4394 Heap::RootListIndex other_nil_value = nil == kNullValue ? 4396 __ mov(r2, Operand(Smi::FromInt(kind)));
4395 Heap::kUndefinedValueRootIndex : 4397 __ mov(r1, Operand(Smi::FromInt(nil)));
4396 Heap::kNullValueRootIndex; 4398 Handle<Code> ic = CompareNilIC::GetUninitialized();
4397 __ b(eq, if_true); 4399 CallIC(ic, RelocInfo::CODE_TARGET, expr->CompareOperationFeedbackId());
4398 __ LoadRoot(r1, other_nil_value); 4400 __ cmp(r0, Operand(0));
4399 __ cmp(r0, r1); 4401 Split(ne, if_true, if_false, fall_through);
4400 __ b(eq, if_true);
4401 __ JumpIfSmi(r0, if_false);
4402 // It can be an undetectable object.
4403 __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset));
4404 __ ldrb(r1, FieldMemOperand(r1, Map::kBitFieldOffset));
4405 __ and_(r1, r1, Operand(1 << Map::kIsUndetectable));
4406 __ cmp(r1, Operand(1 << Map::kIsUndetectable));
4407 Split(eq, if_true, if_false, fall_through);
4408 } 4402 }
4409 context()->Plug(if_true, if_false); 4403 context()->Plug(if_true, if_false);
4410 } 4404 }
4411 4405
4412 4406
4413 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { 4407 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) {
4414 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 4408 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
4415 context()->Plug(r0); 4409 context()->Plug(r0);
4416 } 4410 }
4417 4411
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
4556 *context_length = 0; 4550 *context_length = 0;
4557 return previous_; 4551 return previous_;
4558 } 4552 }
4559 4553
4560 4554
4561 #undef __ 4555 #undef __
4562 4556
4563 } } // namespace v8::internal 4557 } } // namespace v8::internal
4564 4558
4565 #endif // V8_TARGET_ARCH_ARM 4559 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/lithium-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698