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

Side by Side Diff: src/full-codegen/mips/full-codegen-mips.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
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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 3750 matching lines...) Expand 10 before | Expand all | Expand 10 after
4291 } else if (String::Equals(check, factory->symbol_string())) { 4291 } else if (String::Equals(check, factory->symbol_string())) {
4292 __ JumpIfSmi(v0, if_false); 4292 __ JumpIfSmi(v0, if_false);
4293 __ GetObjectType(v0, v0, a1); 4293 __ GetObjectType(v0, v0, a1);
4294 Split(eq, a1, Operand(SYMBOL_TYPE), if_true, if_false, fall_through); 4294 Split(eq, a1, Operand(SYMBOL_TYPE), if_true, if_false, fall_through);
4295 } else if (String::Equals(check, factory->boolean_string())) { 4295 } else if (String::Equals(check, factory->boolean_string())) {
4296 __ LoadRoot(at, Heap::kTrueValueRootIndex); 4296 __ LoadRoot(at, Heap::kTrueValueRootIndex);
4297 __ Branch(if_true, eq, v0, Operand(at)); 4297 __ Branch(if_true, eq, v0, Operand(at));
4298 __ LoadRoot(at, Heap::kFalseValueRootIndex); 4298 __ LoadRoot(at, Heap::kFalseValueRootIndex);
4299 Split(eq, v0, Operand(at), if_true, if_false, fall_through); 4299 Split(eq, v0, Operand(at), if_true, if_false, fall_through);
4300 } else if (String::Equals(check, factory->undefined_string())) { 4300 } else if (String::Equals(check, factory->undefined_string())) {
4301 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); 4301 __ LoadRoot(at, Heap::kNullValueRootIndex);
4302 __ Branch(if_true, eq, v0, Operand(at)); 4302 __ Branch(if_false, eq, v0, Operand(at));
4303 __ JumpIfSmi(v0, if_false); 4303 __ JumpIfSmi(v0, if_false);
4304 // Check for undetectable objects => true. 4304 // Check for undetectable objects => true.
4305 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); 4305 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset));
4306 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); 4306 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
4307 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); 4307 __ And(a1, a1, Operand(1 << Map::kIsUndetectable));
4308 Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through); 4308 Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through);
4309 } else if (String::Equals(check, factory->function_string())) { 4309 } else if (String::Equals(check, factory->function_string())) {
4310 __ JumpIfSmi(v0, if_false); 4310 __ JumpIfSmi(v0, if_false);
4311 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); 4311 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset));
4312 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); 4312 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
4638 reinterpret_cast<uint32_t>( 4638 reinterpret_cast<uint32_t>(
4639 isolate->builtins()->OsrAfterStackCheck()->entry())); 4639 isolate->builtins()->OsrAfterStackCheck()->entry()));
4640 return OSR_AFTER_STACK_CHECK; 4640 return OSR_AFTER_STACK_CHECK;
4641 } 4641 }
4642 4642
4643 4643
4644 } // namespace internal 4644 } // namespace internal
4645 } // namespace v8 4645 } // namespace v8
4646 4646
4647 #endif // V8_TARGET_ARCH_MIPS 4647 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698