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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
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 3292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3303 | 3303 |
3304 __ JumpIfSmi(rax, if_false); | 3304 __ JumpIfSmi(rax, if_false); |
3305 __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rbx); | 3305 __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rbx); |
3306 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3306 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3307 Split(above_equal, if_true, if_false, fall_through); | 3307 Split(above_equal, if_true, if_false, fall_through); |
3308 | 3308 |
3309 context()->Plug(if_true, if_false); | 3309 context()->Plug(if_true, if_false); |
3310 } | 3310 } |
3311 | 3311 |
3312 | 3312 |
| 3313 void FullCodeGenerator::EmitIsSimdObject(CallRuntime* expr) { |
| 3314 ZoneList<Expression*>* args = expr->arguments(); |
| 3315 DCHECK(args->length() == 1); |
| 3316 |
| 3317 VisitForAccumulatorValue(args->at(0)); |
| 3318 |
| 3319 Label materialize_true, materialize_false; |
| 3320 Label* if_true = NULL; |
| 3321 Label* if_false = NULL; |
| 3322 Label* fall_through = NULL; |
| 3323 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 3324 &if_false, &fall_through); |
| 3325 |
| 3326 __ JumpIfSmi(rax, if_false); |
| 3327 Register map = rbx; |
| 3328 __ movp(map, FieldOperand(rax, HeapObject::kMapOffset)); |
| 3329 __ CmpInstanceType(map, FIRST_SIMD_VALUE_TYPE); |
| 3330 __ j(less, if_false); |
| 3331 __ CmpInstanceType(map, LAST_SIMD_VALUE_TYPE); |
| 3332 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3333 Split(less_equal, if_true, if_false, fall_through); |
| 3334 |
| 3335 context()->Plug(if_true, if_false); |
| 3336 } |
| 3337 |
| 3338 |
3313 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { | 3339 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { |
3314 ZoneList<Expression*>* args = expr->arguments(); | 3340 ZoneList<Expression*>* args = expr->arguments(); |
3315 DCHECK(args->length() == 1); | 3341 DCHECK(args->length() == 1); |
3316 | 3342 |
3317 VisitForAccumulatorValue(args->at(0)); | 3343 VisitForAccumulatorValue(args->at(0)); |
3318 | 3344 |
3319 Label materialize_true, materialize_false; | 3345 Label materialize_true, materialize_false; |
3320 Label* if_true = NULL; | 3346 Label* if_true = NULL; |
3321 Label* if_false = NULL; | 3347 Label* if_false = NULL; |
3322 Label* fall_through = NULL; | 3348 Label* fall_through = NULL; |
(...skipping 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5008 Immediate(1 << Map::kIsUndetectable)); | 5034 Immediate(1 << Map::kIsUndetectable)); |
5009 Split(zero, if_true, if_false, fall_through); | 5035 Split(zero, if_true, if_false, fall_through); |
5010 } else if (String::Equals(check, factory->symbol_string())) { | 5036 } else if (String::Equals(check, factory->symbol_string())) { |
5011 __ JumpIfSmi(rax, if_false); | 5037 __ JumpIfSmi(rax, if_false); |
5012 __ CmpObjectType(rax, SYMBOL_TYPE, rdx); | 5038 __ CmpObjectType(rax, SYMBOL_TYPE, rdx); |
5013 Split(equal, if_true, if_false, fall_through); | 5039 Split(equal, if_true, if_false, fall_through); |
5014 } else if (String::Equals(check, factory->float32x4_string())) { | 5040 } else if (String::Equals(check, factory->float32x4_string())) { |
5015 __ JumpIfSmi(rax, if_false); | 5041 __ JumpIfSmi(rax, if_false); |
5016 __ CmpObjectType(rax, FLOAT32X4_TYPE, rdx); | 5042 __ CmpObjectType(rax, FLOAT32X4_TYPE, rdx); |
5017 Split(equal, if_true, if_false, fall_through); | 5043 Split(equal, if_true, if_false, fall_through); |
| 5044 } else if (String::Equals(check, factory->int32x4_string())) { |
| 5045 __ JumpIfSmi(rax, if_false); |
| 5046 __ CmpObjectType(rax, INT32X4_TYPE, rdx); |
| 5047 Split(equal, if_true, if_false, fall_through); |
| 5048 } else if (String::Equals(check, factory->bool32x4_string())) { |
| 5049 __ JumpIfSmi(rax, if_false); |
| 5050 __ CmpObjectType(rax, BOOL32X4_TYPE, rdx); |
| 5051 Split(equal, if_true, if_false, fall_through); |
| 5052 } else if (String::Equals(check, factory->int16x8_string())) { |
| 5053 __ JumpIfSmi(rax, if_false); |
| 5054 __ CmpObjectType(rax, INT16X8_TYPE, rdx); |
| 5055 Split(equal, if_true, if_false, fall_through); |
| 5056 } else if (String::Equals(check, factory->bool16x8_string())) { |
| 5057 __ JumpIfSmi(rax, if_false); |
| 5058 __ CmpObjectType(rax, BOOL16X8_TYPE, rdx); |
| 5059 Split(equal, if_true, if_false, fall_through); |
| 5060 } else if (String::Equals(check, factory->int8x16_string())) { |
| 5061 __ JumpIfSmi(rax, if_false); |
| 5062 __ CmpObjectType(rax, INT8X16_TYPE, rdx); |
| 5063 Split(equal, if_true, if_false, fall_through); |
| 5064 } else if (String::Equals(check, factory->bool8x16_string())) { |
| 5065 __ JumpIfSmi(rax, if_false); |
| 5066 __ CmpObjectType(rax, BOOL8X16_TYPE, rdx); |
| 5067 Split(equal, if_true, if_false, fall_through); |
5018 } else if (String::Equals(check, factory->boolean_string())) { | 5068 } else if (String::Equals(check, factory->boolean_string())) { |
5019 __ CompareRoot(rax, Heap::kTrueValueRootIndex); | 5069 __ CompareRoot(rax, Heap::kTrueValueRootIndex); |
5020 __ j(equal, if_true); | 5070 __ j(equal, if_true); |
5021 __ CompareRoot(rax, Heap::kFalseValueRootIndex); | 5071 __ CompareRoot(rax, Heap::kFalseValueRootIndex); |
5022 Split(equal, if_true, if_false, fall_through); | 5072 Split(equal, if_true, if_false, fall_through); |
5023 } else if (String::Equals(check, factory->undefined_string())) { | 5073 } else if (String::Equals(check, factory->undefined_string())) { |
5024 __ CompareRoot(rax, Heap::kUndefinedValueRootIndex); | 5074 __ CompareRoot(rax, Heap::kUndefinedValueRootIndex); |
5025 __ j(equal, if_true); | 5075 __ j(equal, if_true); |
5026 __ JumpIfSmi(rax, if_false); | 5076 __ JumpIfSmi(rax, if_false); |
5027 // Check for undetectable objects => true. | 5077 // Check for undetectable objects => true. |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5344 Assembler::target_address_at(call_target_address, | 5394 Assembler::target_address_at(call_target_address, |
5345 unoptimized_code)); | 5395 unoptimized_code)); |
5346 return OSR_AFTER_STACK_CHECK; | 5396 return OSR_AFTER_STACK_CHECK; |
5347 } | 5397 } |
5348 | 5398 |
5349 | 5399 |
5350 } // namespace internal | 5400 } // namespace internal |
5351 } // namespace v8 | 5401 } // namespace v8 |
5352 | 5402 |
5353 #endif // V8_TARGET_ARCH_X64 | 5403 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |