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

Side by Side Diff: src/ia32/full-codegen-ia32.cc

Issue 1191283003: [date] Use explicit control flow to replace %_ThrowIfNotADate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/hydrogen.cc ('k') | src/macros.py » ('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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 3780 matching lines...) Expand 10 before | Expand all | Expand 10 after
3791 // If the object is not a value type, return the object. 3791 // If the object is not a value type, return the object.
3792 __ CmpObjectType(eax, JS_VALUE_TYPE, ebx); 3792 __ CmpObjectType(eax, JS_VALUE_TYPE, ebx);
3793 __ j(not_equal, &done, Label::kNear); 3793 __ j(not_equal, &done, Label::kNear);
3794 __ mov(eax, FieldOperand(eax, JSValue::kValueOffset)); 3794 __ mov(eax, FieldOperand(eax, JSValue::kValueOffset));
3795 3795
3796 __ bind(&done); 3796 __ bind(&done);
3797 context()->Plug(eax); 3797 context()->Plug(eax);
3798 } 3798 }
3799 3799
3800 3800
3801 void FullCodeGenerator::EmitThrowIfNotADate(CallRuntime* expr) { 3801 void FullCodeGenerator::EmitIsDate(CallRuntime* expr) {
3802 ZoneList<Expression*>* args = expr->arguments(); 3802 ZoneList<Expression*>* args = expr->arguments();
3803 DCHECK_EQ(1, args->length()); 3803 DCHECK_EQ(1, args->length());
3804 3804
3805 VisitForAccumulatorValue(args->at(0)); // Load the object. 3805 VisitForAccumulatorValue(args->at(0));
3806 3806
3807 Label done, not_date_object; 3807 Label materialize_true, materialize_false;
3808 Register object = eax; 3808 Label* if_true = nullptr;
3809 Register result = eax; 3809 Label* if_false = nullptr;
3810 Register scratch = ecx; 3810 Label* fall_through = nullptr;
3811 context()->PrepareTest(&materialize_true, &materialize_false, &if_true,
3812 &if_false, &fall_through);
3811 3813
3812 __ JumpIfSmi(object, &not_date_object, Label::kNear); 3814 __ JumpIfSmi(eax, if_false);
3813 __ CmpObjectType(object, JS_DATE_TYPE, scratch); 3815 __ CmpObjectType(eax, JS_DATE_TYPE, ebx);
3814 __ j(equal, &done, Label::kNear); 3816 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
3815 __ bind(&not_date_object); 3817 Split(equal, if_true, if_false, fall_through);
3816 __ CallRuntime(Runtime::kThrowNotDateError, 0);
3817 3818
3818 __ bind(&done); 3819 context()->Plug(if_true, if_false);
3819 context()->Plug(result);
3820 } 3820 }
3821 3821
3822 3822
3823 void FullCodeGenerator::EmitDateField(CallRuntime* expr) { 3823 void FullCodeGenerator::EmitDateField(CallRuntime* expr) {
3824 ZoneList<Expression*>* args = expr->arguments(); 3824 ZoneList<Expression*>* args = expr->arguments();
3825 DCHECK(args->length() == 2); 3825 DCHECK(args->length() == 2);
3826 DCHECK_NOT_NULL(args->at(1)->AsLiteral()); 3826 DCHECK_NOT_NULL(args->at(1)->AsLiteral());
3827 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value())); 3827 Smi* index = Smi::cast(*(args->at(1)->AsLiteral()->value()));
3828 3828
3829 VisitForAccumulatorValue(args->at(0)); // Load the object. 3829 VisitForAccumulatorValue(args->at(0)); // Load the object.
(...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after
5475 Assembler::target_address_at(call_target_address, 5475 Assembler::target_address_at(call_target_address,
5476 unoptimized_code)); 5476 unoptimized_code));
5477 return OSR_AFTER_STACK_CHECK; 5477 return OSR_AFTER_STACK_CHECK;
5478 } 5478 }
5479 5479
5480 5480
5481 } // namespace internal 5481 } // namespace internal
5482 } // namespace v8 5482 } // namespace v8
5483 5483
5484 #endif // V8_TARGET_ARCH_IA32 5484 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698