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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 3047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3058 // If the object is not a value type, return the object. | 3058 // If the object is not a value type, return the object. |
3059 __ CmpObjectType(eax, JS_VALUE_TYPE, ebx); | 3059 __ CmpObjectType(eax, JS_VALUE_TYPE, ebx); |
3060 __ j(not_equal, &done, Label::kNear); | 3060 __ j(not_equal, &done, Label::kNear); |
3061 __ mov(eax, FieldOperand(eax, JSValue::kValueOffset)); | 3061 __ mov(eax, FieldOperand(eax, JSValue::kValueOffset)); |
3062 | 3062 |
3063 __ bind(&done); | 3063 __ bind(&done); |
3064 context()->Plug(eax); | 3064 context()->Plug(eax); |
3065 } | 3065 } |
3066 | 3066 |
3067 | 3067 |
3068 void FullCodeGenerator::EmitIsDate(CallRuntime* expr) { | |
3069 ZoneList<Expression*>* args = expr->arguments(); | |
3070 DCHECK_EQ(1, args->length()); | |
3071 | |
3072 VisitForAccumulatorValue(args->at(0)); | |
3073 | |
3074 Label materialize_true, materialize_false; | |
3075 Label* if_true = nullptr; | |
3076 Label* if_false = nullptr; | |
3077 Label* fall_through = nullptr; | |
3078 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | |
3079 &if_false, &fall_through); | |
3080 | |
3081 __ JumpIfSmi(eax, if_false); | |
3082 __ CmpObjectType(eax, JS_DATE_TYPE, ebx); | |
3083 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | |
3084 Split(equal, if_true, if_false, fall_through); | |
3085 | |
3086 context()->Plug(if_true, if_false); | |
3087 } | |
3088 | |
3089 | |
3090 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { | 3068 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { |
3091 ZoneList<Expression*>* args = expr->arguments(); | 3069 ZoneList<Expression*>* args = expr->arguments(); |
3092 DCHECK_EQ(3, args->length()); | 3070 DCHECK_EQ(3, args->length()); |
3093 | 3071 |
3094 Register string = eax; | 3072 Register string = eax; |
3095 Register index = ebx; | 3073 Register index = ebx; |
3096 Register value = ecx; | 3074 Register value = ecx; |
3097 | 3075 |
3098 VisitForStackValue(args->at(0)); // index | 3076 VisitForStackValue(args->at(0)); // index |
3099 VisitForStackValue(args->at(1)); // value | 3077 VisitForStackValue(args->at(1)); // value |
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4478 Assembler::target_address_at(call_target_address, | 4456 Assembler::target_address_at(call_target_address, |
4479 unoptimized_code)); | 4457 unoptimized_code)); |
4480 return OSR_AFTER_STACK_CHECK; | 4458 return OSR_AFTER_STACK_CHECK; |
4481 } | 4459 } |
4482 | 4460 |
4483 | 4461 |
4484 } // namespace internal | 4462 } // namespace internal |
4485 } // namespace v8 | 4463 } // namespace v8 |
4486 | 4464 |
4487 #endif // V8_TARGET_ARCH_IA32 | 4465 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |