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

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.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/mips/full-codegen-mips.cc ('k') | src/full-codegen/x64/full-codegen-x64.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 // 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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 __ li(result_register(), Operand(lit)); 520 __ li(result_register(), Operand(lit));
521 __ push(result_register()); 521 __ push(result_register());
522 } 522 }
523 523
524 524
525 void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const { 525 void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const {
526 codegen()->PrepareForBailoutBeforeSplit(condition(), 526 codegen()->PrepareForBailoutBeforeSplit(condition(),
527 true, 527 true,
528 true_label_, 528 true_label_,
529 false_label_); 529 false_label_);
530 DCHECK(!lit->IsUndetectableObject()); // There are no undetectable literals. 530 DCHECK(lit->IsNull() || lit->IsUndefined() || !lit->IsUndetectableObject());
531 if (lit->IsUndefined() || lit->IsNull() || lit->IsFalse()) { 531 if (lit->IsUndefined() || lit->IsNull() || lit->IsFalse()) {
532 if (false_label_ != fall_through_) __ Branch(false_label_); 532 if (false_label_ != fall_through_) __ Branch(false_label_);
533 } else if (lit->IsTrue() || lit->IsJSObject()) { 533 } else if (lit->IsTrue() || lit->IsJSObject()) {
534 if (true_label_ != fall_through_) __ Branch(true_label_); 534 if (true_label_ != fall_through_) __ Branch(true_label_);
535 } else if (lit->IsString()) { 535 } else if (lit->IsString()) {
536 if (String::cast(*lit)->length() == 0) { 536 if (String::cast(*lit)->length() == 0) {
537 if (false_label_ != fall_through_) __ Branch(false_label_); 537 if (false_label_ != fall_through_) __ Branch(false_label_);
538 } else { 538 } else {
539 if (true_label_ != fall_through_) __ Branch(true_label_); 539 if (true_label_ != fall_through_) __ Branch(true_label_);
540 } 540 }
(...skipping 3764 matching lines...) Expand 10 before | Expand all | Expand 10 after
4305 } else if (String::Equals(check, factory->symbol_string())) { 4305 } else if (String::Equals(check, factory->symbol_string())) {
4306 __ JumpIfSmi(v0, if_false); 4306 __ JumpIfSmi(v0, if_false);
4307 __ GetObjectType(v0, v0, a1); 4307 __ GetObjectType(v0, v0, a1);
4308 Split(eq, a1, Operand(SYMBOL_TYPE), if_true, if_false, fall_through); 4308 Split(eq, a1, Operand(SYMBOL_TYPE), if_true, if_false, fall_through);
4309 } else if (String::Equals(check, factory->boolean_string())) { 4309 } else if (String::Equals(check, factory->boolean_string())) {
4310 __ LoadRoot(at, Heap::kTrueValueRootIndex); 4310 __ LoadRoot(at, Heap::kTrueValueRootIndex);
4311 __ Branch(if_true, eq, v0, Operand(at)); 4311 __ Branch(if_true, eq, v0, Operand(at));
4312 __ LoadRoot(at, Heap::kFalseValueRootIndex); 4312 __ LoadRoot(at, Heap::kFalseValueRootIndex);
4313 Split(eq, v0, Operand(at), if_true, if_false, fall_through); 4313 Split(eq, v0, Operand(at), if_true, if_false, fall_through);
4314 } else if (String::Equals(check, factory->undefined_string())) { 4314 } else if (String::Equals(check, factory->undefined_string())) {
4315 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); 4315 __ LoadRoot(at, Heap::kNullValueRootIndex);
4316 __ Branch(if_true, eq, v0, Operand(at)); 4316 __ Branch(if_false, eq, v0, Operand(at));
4317 __ JumpIfSmi(v0, if_false); 4317 __ JumpIfSmi(v0, if_false);
4318 // Check for undetectable objects => true. 4318 // Check for undetectable objects => true.
4319 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); 4319 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset));
4320 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); 4320 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
4321 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); 4321 __ And(a1, a1, Operand(1 << Map::kIsUndetectable));
4322 Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through); 4322 Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through);
4323 } else if (String::Equals(check, factory->function_string())) { 4323 } else if (String::Equals(check, factory->function_string())) {
4324 __ JumpIfSmi(v0, if_false); 4324 __ JumpIfSmi(v0, if_false);
4325 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); 4325 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset));
4326 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); 4326 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
4657 reinterpret_cast<uint64_t>( 4657 reinterpret_cast<uint64_t>(
4658 isolate->builtins()->OsrAfterStackCheck()->entry())); 4658 isolate->builtins()->OsrAfterStackCheck()->entry()));
4659 return OSR_AFTER_STACK_CHECK; 4659 return OSR_AFTER_STACK_CHECK;
4660 } 4660 }
4661 4661
4662 4662
4663 } // namespace internal 4663 } // namespace internal
4664 } // namespace v8 4664 } // namespace v8
4665 4665
4666 #endif // V8_TARGET_ARCH_MIPS64 4666 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698