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/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 __ Push(lit); | 489 __ Push(lit); |
490 } | 490 } |
491 } | 491 } |
492 | 492 |
493 | 493 |
494 void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const { | 494 void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const { |
495 codegen()->PrepareForBailoutBeforeSplit(condition(), | 495 codegen()->PrepareForBailoutBeforeSplit(condition(), |
496 true, | 496 true, |
497 true_label_, | 497 true_label_, |
498 false_label_); | 498 false_label_); |
499 DCHECK(lit->IsNull(isolate()) || lit->IsUndefined(isolate()) || | 499 DCHECK(lit->IsNullOrUndefined(isolate()) || !lit->IsUndetectable()); |
500 !lit->IsUndetectable()); | 500 if (lit->IsNullOrUndefined(isolate()) || lit->IsFalse(isolate())) { |
501 if (lit->IsUndefined(isolate()) || lit->IsNull(isolate()) || | |
502 lit->IsFalse(isolate())) { | |
503 if (false_label_ != fall_through_) __ jmp(false_label_); | 501 if (false_label_ != fall_through_) __ jmp(false_label_); |
504 } else if (lit->IsTrue(isolate()) || lit->IsJSObject()) { | 502 } else if (lit->IsTrue(isolate()) || lit->IsJSObject()) { |
505 if (true_label_ != fall_through_) __ jmp(true_label_); | 503 if (true_label_ != fall_through_) __ jmp(true_label_); |
506 } else if (lit->IsString()) { | 504 } else if (lit->IsString()) { |
507 if (String::cast(*lit)->length() == 0) { | 505 if (String::cast(*lit)->length() == 0) { |
508 if (false_label_ != fall_through_) __ jmp(false_label_); | 506 if (false_label_ != fall_through_) __ jmp(false_label_); |
509 } else { | 507 } else { |
510 if (true_label_ != fall_through_) __ jmp(true_label_); | 508 if (true_label_ != fall_through_) __ jmp(true_label_); |
511 } | 509 } |
512 } else if (lit->IsSmi()) { | 510 } else if (lit->IsSmi()) { |
(...skipping 2174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2687 DCHECK_EQ( | 2685 DCHECK_EQ( |
2688 isolate->builtins()->OnStackReplacement()->entry(), | 2686 isolate->builtins()->OnStackReplacement()->entry(), |
2689 Assembler::target_address_at(call_target_address, unoptimized_code)); | 2687 Assembler::target_address_at(call_target_address, unoptimized_code)); |
2690 return ON_STACK_REPLACEMENT; | 2688 return ON_STACK_REPLACEMENT; |
2691 } | 2689 } |
2692 | 2690 |
2693 } // namespace internal | 2691 } // namespace internal |
2694 } // namespace v8 | 2692 } // namespace v8 |
2695 | 2693 |
2696 #endif // V8_TARGET_ARCH_X64 | 2694 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |