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 3033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3044 // If the object is not a value type, return the object. | 3044 // If the object is not a value type, return the object. |
3045 __ CmpObjectType(rax, JS_VALUE_TYPE, rbx); | 3045 __ CmpObjectType(rax, JS_VALUE_TYPE, rbx); |
3046 __ j(not_equal, &done); | 3046 __ j(not_equal, &done); |
3047 __ movp(rax, FieldOperand(rax, JSValue::kValueOffset)); | 3047 __ movp(rax, FieldOperand(rax, JSValue::kValueOffset)); |
3048 | 3048 |
3049 __ bind(&done); | 3049 __ bind(&done); |
3050 context()->Plug(rax); | 3050 context()->Plug(rax); |
3051 } | 3051 } |
3052 | 3052 |
3053 | 3053 |
3054 void FullCodeGenerator::EmitIsDate(CallRuntime* expr) { | |
3055 ZoneList<Expression*>* args = expr->arguments(); | |
3056 DCHECK_EQ(1, args->length()); | |
3057 | |
3058 VisitForAccumulatorValue(args->at(0)); | |
3059 | |
3060 Label materialize_true, materialize_false; | |
3061 Label* if_true = nullptr; | |
3062 Label* if_false = nullptr; | |
3063 Label* fall_through = nullptr; | |
3064 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | |
3065 &if_false, &fall_through); | |
3066 | |
3067 __ JumpIfSmi(rax, if_false); | |
3068 __ CmpObjectType(rax, JS_DATE_TYPE, rbx); | |
3069 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | |
3070 Split(equal, if_true, if_false, fall_through); | |
3071 | |
3072 context()->Plug(if_true, if_false); | |
3073 } | |
3074 | |
3075 | |
3076 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { | 3054 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { |
3077 ZoneList<Expression*>* args = expr->arguments(); | 3055 ZoneList<Expression*>* args = expr->arguments(); |
3078 DCHECK_EQ(3, args->length()); | 3056 DCHECK_EQ(3, args->length()); |
3079 | 3057 |
3080 Register string = rax; | 3058 Register string = rax; |
3081 Register index = rbx; | 3059 Register index = rbx; |
3082 Register value = rcx; | 3060 Register value = rcx; |
3083 | 3061 |
3084 VisitForStackValue(args->at(0)); // index | 3062 VisitForStackValue(args->at(0)); // index |
3085 VisitForStackValue(args->at(1)); // value | 3063 VisitForStackValue(args->at(1)); // value |
(...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4479 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4457 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4480 Assembler::target_address_at(call_target_address, | 4458 Assembler::target_address_at(call_target_address, |
4481 unoptimized_code)); | 4459 unoptimized_code)); |
4482 return OSR_AFTER_STACK_CHECK; | 4460 return OSR_AFTER_STACK_CHECK; |
4483 } | 4461 } |
4484 | 4462 |
4485 } // namespace internal | 4463 } // namespace internal |
4486 } // namespace v8 | 4464 } // namespace v8 |
4487 | 4465 |
4488 #endif // V8_TARGET_ARCH_X64 | 4466 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |