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

Side by Side Diff: src/full-codegen/x87/full-codegen-x87.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/x64/full-codegen-x64.cc ('k') | src/heap/heap.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_X87 5 #if V8_TARGET_ARCH_X87
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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 __ push(Immediate(lit)); 483 __ push(Immediate(lit));
484 } 484 }
485 } 485 }
486 486
487 487
488 void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const { 488 void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const {
489 codegen()->PrepareForBailoutBeforeSplit(condition(), 489 codegen()->PrepareForBailoutBeforeSplit(condition(),
490 true, 490 true,
491 true_label_, 491 true_label_,
492 false_label_); 492 false_label_);
493 DCHECK(!lit->IsUndetectableObject()); // There are no undetectable literals. 493 DCHECK(lit->IsNull() || lit->IsUndefined() || !lit->IsUndetectableObject());
494 if (lit->IsUndefined() || lit->IsNull() || lit->IsFalse()) { 494 if (lit->IsUndefined() || lit->IsNull() || lit->IsFalse()) {
495 if (false_label_ != fall_through_) __ jmp(false_label_); 495 if (false_label_ != fall_through_) __ jmp(false_label_);
496 } else if (lit->IsTrue() || lit->IsJSObject()) { 496 } else if (lit->IsTrue() || lit->IsJSObject()) {
497 if (true_label_ != fall_through_) __ jmp(true_label_); 497 if (true_label_ != fall_through_) __ jmp(true_label_);
498 } else if (lit->IsString()) { 498 } else if (lit->IsString()) {
499 if (String::cast(*lit)->length() == 0) { 499 if (String::cast(*lit)->length() == 0) {
500 if (false_label_ != fall_through_) __ jmp(false_label_); 500 if (false_label_ != fall_through_) __ jmp(false_label_);
501 } else { 501 } else {
502 if (true_label_ != fall_through_) __ jmp(true_label_); 502 if (true_label_ != fall_through_) __ jmp(true_label_);
503 } 503 }
(...skipping 3716 matching lines...) Expand 10 before | Expand all | Expand 10 after
4220 } else if (String::Equals(check, factory->symbol_string())) { 4220 } else if (String::Equals(check, factory->symbol_string())) {
4221 __ JumpIfSmi(eax, if_false); 4221 __ JumpIfSmi(eax, if_false);
4222 __ CmpObjectType(eax, SYMBOL_TYPE, edx); 4222 __ CmpObjectType(eax, SYMBOL_TYPE, edx);
4223 Split(equal, if_true, if_false, fall_through); 4223 Split(equal, if_true, if_false, fall_through);
4224 } else if (String::Equals(check, factory->boolean_string())) { 4224 } else if (String::Equals(check, factory->boolean_string())) {
4225 __ cmp(eax, isolate()->factory()->true_value()); 4225 __ cmp(eax, isolate()->factory()->true_value());
4226 __ j(equal, if_true); 4226 __ j(equal, if_true);
4227 __ cmp(eax, isolate()->factory()->false_value()); 4227 __ cmp(eax, isolate()->factory()->false_value());
4228 Split(equal, if_true, if_false, fall_through); 4228 Split(equal, if_true, if_false, fall_through);
4229 } else if (String::Equals(check, factory->undefined_string())) { 4229 } else if (String::Equals(check, factory->undefined_string())) {
4230 __ cmp(eax, isolate()->factory()->undefined_value()); 4230 __ cmp(eax, isolate()->factory()->null_value());
4231 __ j(equal, if_true); 4231 __ j(equal, if_false);
4232 __ JumpIfSmi(eax, if_false); 4232 __ JumpIfSmi(eax, if_false);
4233 // Check for undetectable objects => true. 4233 // Check for undetectable objects => true.
4234 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); 4234 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset));
4235 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), 4235 __ test_b(FieldOperand(edx, Map::kBitFieldOffset),
4236 1 << Map::kIsUndetectable); 4236 1 << Map::kIsUndetectable);
4237 Split(not_zero, if_true, if_false, fall_through); 4237 Split(not_zero, if_true, if_false, fall_through);
4238 } else if (String::Equals(check, factory->function_string())) { 4238 } else if (String::Equals(check, factory->function_string())) {
4239 __ JumpIfSmi(eax, if_false); 4239 __ JumpIfSmi(eax, if_false);
4240 // Check for callable and not undetectable objects => true. 4240 // Check for callable and not undetectable objects => true.
4241 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); 4241 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset));
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
4564 Assembler::target_address_at(call_target_address, 4564 Assembler::target_address_at(call_target_address,
4565 unoptimized_code)); 4565 unoptimized_code));
4566 return OSR_AFTER_STACK_CHECK; 4566 return OSR_AFTER_STACK_CHECK;
4567 } 4567 }
4568 4568
4569 4569
4570 } // namespace internal 4570 } // namespace internal
4571 } // namespace v8 4571 } // namespace v8
4572 4572
4573 #endif // V8_TARGET_ARCH_X87 4573 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698