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

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

Issue 14367018: Add monomorphic CompareNilICs and Crankshaft support (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback 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/x64/code-stubs-x64.cc ('k') | no next file » | 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 4417 matching lines...) Expand 10 before | Expand all | Expand 10 after
4428 NilValue nil) { 4428 NilValue nil) {
4429 Label materialize_true, materialize_false; 4429 Label materialize_true, materialize_false;
4430 Label* if_true = NULL; 4430 Label* if_true = NULL;
4431 Label* if_false = NULL; 4431 Label* if_false = NULL;
4432 Label* fall_through = NULL; 4432 Label* fall_through = NULL;
4433 context()->PrepareTest(&materialize_true, &materialize_false, 4433 context()->PrepareTest(&materialize_true, &materialize_false,
4434 &if_true, &if_false, &fall_through); 4434 &if_true, &if_false, &fall_through);
4435 4435
4436 VisitForAccumulatorValue(sub_expr); 4436 VisitForAccumulatorValue(sub_expr);
4437 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 4437 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
4438 Heap::RootListIndex nil_value = nil == kNullValue ? 4438 EqualityKind kind = expr->op() == Token::EQ_STRICT
4439 Heap::kNullValueRootIndex : 4439 ? kStrictEquality : kNonStrictEquality;
4440 Heap::kUndefinedValueRootIndex; 4440 if (kind == kStrictEquality) {
4441 __ CompareRoot(rax, nil_value); 4441 Heap::RootListIndex nil_value = nil == kNullValue ?
4442 if (expr->op() == Token::EQ_STRICT) { 4442 Heap::kNullValueRootIndex :
4443 Heap::kUndefinedValueRootIndex;
4444 __ CompareRoot(rax, nil_value);
4443 Split(equal, if_true, if_false, fall_through); 4445 Split(equal, if_true, if_false, fall_through);
4444 } else { 4446 } else {
4445 Heap::RootListIndex other_nil_value = nil == kNullValue ? 4447 Handle<Code> ic = CompareNilICStub::GetUninitialized(isolate(),
4446 Heap::kUndefinedValueRootIndex : 4448 kNonStrictEquality,
4447 Heap::kNullValueRootIndex; 4449 nil);
4448 __ j(equal, if_true); 4450 CallIC(ic, RelocInfo::CODE_TARGET, expr->CompareOperationFeedbackId());
4449 __ CompareRoot(rax, other_nil_value); 4451 __ testq(rax, rax);
4450 __ j(equal, if_true);
4451 __ JumpIfSmi(rax, if_false);
4452 // It can be an undetectable object.
4453 __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset));
4454 __ testb(FieldOperand(rdx, Map::kBitFieldOffset),
4455 Immediate(1 << Map::kIsUndetectable));
4456 Split(not_zero, if_true, if_false, fall_through); 4452 Split(not_zero, if_true, if_false, fall_through);
4457 } 4453 }
4458 context()->Plug(if_true, if_false); 4454 context()->Plug(if_true, if_false);
4459 } 4455 }
4460 4456
4461 4457
4462 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) { 4458 void FullCodeGenerator::VisitThisFunction(ThisFunction* expr) {
4463 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); 4459 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
4464 context()->Plug(rax); 4460 context()->Plug(rax);
4465 } 4461 }
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
4601 *context_length = 0; 4597 *context_length = 0;
4602 return previous_; 4598 return previous_;
4603 } 4599 }
4604 4600
4605 4601
4606 #undef __ 4602 #undef __
4607 4603
4608 } } // namespace v8::internal 4604 } } // namespace v8::internal
4609 4605
4610 #endif // V8_TARGET_ARCH_X64 4606 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698