OLD | NEW |
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_X64 | 5 #if V8_TARGET_ARCH_X64 |
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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 __ Push(lit); | 491 __ Push(lit); |
492 } | 492 } |
493 } | 493 } |
494 | 494 |
495 | 495 |
496 void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const { | 496 void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const { |
497 codegen()->PrepareForBailoutBeforeSplit(condition(), | 497 codegen()->PrepareForBailoutBeforeSplit(condition(), |
498 true, | 498 true, |
499 true_label_, | 499 true_label_, |
500 false_label_); | 500 false_label_); |
501 DCHECK(!lit->IsUndetectableObject()); // There are no undetectable literals. | 501 DCHECK(lit->IsNull() || lit->IsUndefined() || !lit->IsUndetectableObject()); |
502 if (lit->IsUndefined() || lit->IsNull() || lit->IsFalse()) { | 502 if (lit->IsUndefined() || lit->IsNull() || lit->IsFalse()) { |
503 if (false_label_ != fall_through_) __ jmp(false_label_); | 503 if (false_label_ != fall_through_) __ jmp(false_label_); |
504 } else if (lit->IsTrue() || lit->IsJSObject()) { | 504 } else if (lit->IsTrue() || lit->IsJSObject()) { |
505 if (true_label_ != fall_through_) __ jmp(true_label_); | 505 if (true_label_ != fall_through_) __ jmp(true_label_); |
506 } else if (lit->IsString()) { | 506 } else if (lit->IsString()) { |
507 if (String::cast(*lit)->length() == 0) { | 507 if (String::cast(*lit)->length() == 0) { |
508 if (false_label_ != fall_through_) __ jmp(false_label_); | 508 if (false_label_ != fall_through_) __ jmp(false_label_); |
509 } else { | 509 } else { |
510 if (true_label_ != fall_through_) __ jmp(true_label_); | 510 if (true_label_ != fall_through_) __ jmp(true_label_); |
511 } | 511 } |
(...skipping 3709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4221 } else if (String::Equals(check, factory->symbol_string())) { | 4221 } else if (String::Equals(check, factory->symbol_string())) { |
4222 __ JumpIfSmi(rax, if_false); | 4222 __ JumpIfSmi(rax, if_false); |
4223 __ CmpObjectType(rax, SYMBOL_TYPE, rdx); | 4223 __ CmpObjectType(rax, SYMBOL_TYPE, rdx); |
4224 Split(equal, if_true, if_false, fall_through); | 4224 Split(equal, if_true, if_false, fall_through); |
4225 } else if (String::Equals(check, factory->boolean_string())) { | 4225 } else if (String::Equals(check, factory->boolean_string())) { |
4226 __ CompareRoot(rax, Heap::kTrueValueRootIndex); | 4226 __ CompareRoot(rax, Heap::kTrueValueRootIndex); |
4227 __ j(equal, if_true); | 4227 __ j(equal, if_true); |
4228 __ CompareRoot(rax, Heap::kFalseValueRootIndex); | 4228 __ CompareRoot(rax, Heap::kFalseValueRootIndex); |
4229 Split(equal, if_true, if_false, fall_through); | 4229 Split(equal, if_true, if_false, fall_through); |
4230 } else if (String::Equals(check, factory->undefined_string())) { | 4230 } else if (String::Equals(check, factory->undefined_string())) { |
4231 __ CompareRoot(rax, Heap::kUndefinedValueRootIndex); | 4231 __ CompareRoot(rax, Heap::kNullValueRootIndex); |
4232 __ j(equal, if_true); | 4232 __ j(equal, if_false); |
4233 __ JumpIfSmi(rax, if_false); | 4233 __ JumpIfSmi(rax, if_false); |
4234 // Check for undetectable objects => true. | 4234 // Check for undetectable objects => true. |
4235 __ movp(rdx, FieldOperand(rax, HeapObject::kMapOffset)); | 4235 __ movp(rdx, FieldOperand(rax, HeapObject::kMapOffset)); |
4236 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), | 4236 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), |
4237 Immediate(1 << Map::kIsUndetectable)); | 4237 Immediate(1 << Map::kIsUndetectable)); |
4238 Split(not_zero, if_true, if_false, fall_through); | 4238 Split(not_zero, if_true, if_false, fall_through); |
4239 } else if (String::Equals(check, factory->function_string())) { | 4239 } else if (String::Equals(check, factory->function_string())) { |
4240 __ JumpIfSmi(rax, if_false); | 4240 __ JumpIfSmi(rax, if_false); |
4241 // Check for callable and not undetectable objects => true. | 4241 // Check for callable and not undetectable objects => true. |
4242 __ movp(rdx, FieldOperand(rax, HeapObject::kMapOffset)); | 4242 __ movp(rdx, FieldOperand(rax, HeapObject::kMapOffset)); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4565 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4565 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4566 Assembler::target_address_at(call_target_address, | 4566 Assembler::target_address_at(call_target_address, |
4567 unoptimized_code)); | 4567 unoptimized_code)); |
4568 return OSR_AFTER_STACK_CHECK; | 4568 return OSR_AFTER_STACK_CHECK; |
4569 } | 4569 } |
4570 | 4570 |
4571 } // namespace internal | 4571 } // namespace internal |
4572 } // namespace v8 | 4572 } // namespace v8 |
4573 | 4573 |
4574 #endif // V8_TARGET_ARCH_X64 | 4574 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |