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

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

Issue 1683643002: Mark null and undefined as undetectable, and use it to handle abstract equality comparison in the g… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « src/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/ia32/full-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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 __ Mov(result_register(), Operand(lit)); 524 __ Mov(result_register(), Operand(lit));
525 __ Push(result_register()); 525 __ Push(result_register());
526 } 526 }
527 527
528 528
529 void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const { 529 void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const {
530 codegen()->PrepareForBailoutBeforeSplit(condition(), 530 codegen()->PrepareForBailoutBeforeSplit(condition(),
531 true, 531 true,
532 true_label_, 532 true_label_,
533 false_label_); 533 false_label_);
534 DCHECK(!lit->IsUndetectableObject()); // There are no undetectable literals. 534 DCHECK(lit->IsNull() || lit->IsUndefined() || !lit->IsUndetectableObject());
535 if (lit->IsUndefined() || lit->IsNull() || lit->IsFalse()) { 535 if (lit->IsUndefined() || lit->IsNull() || lit->IsFalse()) {
536 if (false_label_ != fall_through_) __ B(false_label_); 536 if (false_label_ != fall_through_) __ B(false_label_);
537 } else if (lit->IsTrue() || lit->IsJSObject()) { 537 } else if (lit->IsTrue() || lit->IsJSObject()) {
538 if (true_label_ != fall_through_) __ B(true_label_); 538 if (true_label_ != fall_through_) __ B(true_label_);
539 } else if (lit->IsString()) { 539 } else if (lit->IsString()) {
540 if (String::cast(*lit)->length() == 0) { 540 if (String::cast(*lit)->length() == 0) {
541 if (false_label_ != fall_through_) __ B(false_label_); 541 if (false_label_ != fall_through_) __ B(false_label_);
542 } else { 542 } else {
543 if (true_label_ != fall_through_) __ B(true_label_); 543 if (true_label_ != fall_through_) __ B(true_label_);
544 } 544 }
(...skipping 3555 matching lines...) Expand 10 before | Expand all | Expand 10 after
4100 __ CompareObjectType(x0, x0, x1, SYMBOL_TYPE); 4100 __ CompareObjectType(x0, x0, x1, SYMBOL_TYPE);
4101 Split(eq, if_true, if_false, fall_through); 4101 Split(eq, if_true, if_false, fall_through);
4102 } else if (String::Equals(check, factory->boolean_string())) { 4102 } else if (String::Equals(check, factory->boolean_string())) {
4103 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof boolean_string"); 4103 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof boolean_string");
4104 __ JumpIfRoot(x0, Heap::kTrueValueRootIndex, if_true); 4104 __ JumpIfRoot(x0, Heap::kTrueValueRootIndex, if_true);
4105 __ CompareRoot(x0, Heap::kFalseValueRootIndex); 4105 __ CompareRoot(x0, Heap::kFalseValueRootIndex);
4106 Split(eq, if_true, if_false, fall_through); 4106 Split(eq, if_true, if_false, fall_through);
4107 } else if (String::Equals(check, factory->undefined_string())) { 4107 } else if (String::Equals(check, factory->undefined_string())) {
4108 ASM_LOCATION( 4108 ASM_LOCATION(
4109 "FullCodeGenerator::EmitLiteralCompareTypeof undefined_string"); 4109 "FullCodeGenerator::EmitLiteralCompareTypeof undefined_string");
4110 __ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex, if_true); 4110 __ JumpIfRoot(x0, Heap::kNullValueRootIndex, if_false);
4111 __ JumpIfSmi(x0, if_false); 4111 __ JumpIfSmi(x0, if_false);
4112 // Check for undetectable objects => true. 4112 // Check for undetectable objects => true.
4113 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset)); 4113 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset));
4114 __ Ldrb(x1, FieldMemOperand(x0, Map::kBitFieldOffset)); 4114 __ Ldrb(x1, FieldMemOperand(x0, Map::kBitFieldOffset));
4115 __ TestAndSplit(x1, 1 << Map::kIsUndetectable, if_false, if_true, 4115 __ TestAndSplit(x1, 1 << Map::kIsUndetectable, if_false, if_true,
4116 fall_through); 4116 fall_through);
4117 } else if (String::Equals(check, factory->function_string())) { 4117 } else if (String::Equals(check, factory->function_string())) {
4118 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof function_string"); 4118 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof function_string");
4119 __ JumpIfSmi(x0, if_false); 4119 __ JumpIfSmi(x0, if_false);
4120 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset)); 4120 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset));
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
4682 } 4682 }
4683 4683
4684 return INTERRUPT; 4684 return INTERRUPT;
4685 } 4685 }
4686 4686
4687 4687
4688 } // namespace internal 4688 } // namespace internal
4689 } // namespace v8 4689 } // namespace v8
4690 4690
4691 #endif // V8_TARGET_ARCH_ARM64 4691 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698