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_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 3315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3326 VisitForAccumulatorValue(args->at(0)); | 3326 VisitForAccumulatorValue(args->at(0)); |
3327 | 3327 |
3328 Label materialize_true, materialize_false; | 3328 Label materialize_true, materialize_false; |
3329 Label* if_true = NULL; | 3329 Label* if_true = NULL; |
3330 Label* if_false = NULL; | 3330 Label* if_false = NULL; |
3331 Label* fall_through = NULL; | 3331 Label* fall_through = NULL; |
3332 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | 3332 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
3333 &if_false, &fall_through); | 3333 &if_false, &fall_through); |
3334 | 3334 |
3335 __ JumpIfSmi(eax, if_false); | 3335 __ JumpIfSmi(eax, if_false); |
3336 Register map = ebx; | 3336 __ CmpObjectType(eax, SIMD128_VALUE_TYPE, ebx); |
3337 __ mov(map, FieldOperand(eax, HeapObject::kMapOffset)); | |
3338 __ CmpInstanceType(map, FIRST_SIMD_VALUE_TYPE); | |
3339 __ j(less, if_false); | |
3340 __ CmpInstanceType(map, LAST_SIMD_VALUE_TYPE); | |
3341 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3337 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3342 Split(less_equal, if_true, if_false, fall_through); | 3338 Split(equal, if_true, if_false, fall_through); |
3343 | 3339 |
3344 context()->Plug(if_true, if_false); | 3340 context()->Plug(if_true, if_false); |
3345 } | 3341 } |
3346 | 3342 |
3347 | 3343 |
3348 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { | 3344 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { |
3349 ZoneList<Expression*>* args = expr->arguments(); | 3345 ZoneList<Expression*>* args = expr->arguments(); |
3350 DCHECK(args->length() == 1); | 3346 DCHECK(args->length() == 1); |
3351 | 3347 |
3352 VisitForAccumulatorValue(args->at(0)); | 3348 VisitForAccumulatorValue(args->at(0)); |
(...skipping 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4978 __ CmpObjectType(eax, FIRST_NONSTRING_TYPE, edx); | 4974 __ CmpObjectType(eax, FIRST_NONSTRING_TYPE, edx); |
4979 __ j(above_equal, if_false); | 4975 __ j(above_equal, if_false); |
4980 // Check for undetectable objects => false. | 4976 // Check for undetectable objects => false. |
4981 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), | 4977 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), |
4982 1 << Map::kIsUndetectable); | 4978 1 << Map::kIsUndetectable); |
4983 Split(zero, if_true, if_false, fall_through); | 4979 Split(zero, if_true, if_false, fall_through); |
4984 } else if (String::Equals(check, factory->symbol_string())) { | 4980 } else if (String::Equals(check, factory->symbol_string())) { |
4985 __ JumpIfSmi(eax, if_false); | 4981 __ JumpIfSmi(eax, if_false); |
4986 __ CmpObjectType(eax, SYMBOL_TYPE, edx); | 4982 __ CmpObjectType(eax, SYMBOL_TYPE, edx); |
4987 Split(equal, if_true, if_false, fall_through); | 4983 Split(equal, if_true, if_false, fall_through); |
4988 } else if (String::Equals(check, factory->float32x4_string())) { | |
4989 __ JumpIfSmi(eax, if_false); | |
4990 __ CmpObjectType(eax, FLOAT32X4_TYPE, edx); | |
4991 Split(equal, if_true, if_false, fall_through); | |
4992 } else if (String::Equals(check, factory->int32x4_string())) { | |
4993 __ JumpIfSmi(eax, if_false); | |
4994 __ CmpObjectType(eax, INT32X4_TYPE, edx); | |
4995 Split(equal, if_true, if_false, fall_through); | |
4996 } else if (String::Equals(check, factory->bool32x4_string())) { | |
4997 __ JumpIfSmi(eax, if_false); | |
4998 __ CmpObjectType(eax, BOOL32X4_TYPE, edx); | |
4999 Split(equal, if_true, if_false, fall_through); | |
5000 } else if (String::Equals(check, factory->int16x8_string())) { | |
5001 __ JumpIfSmi(eax, if_false); | |
5002 __ CmpObjectType(eax, INT16X8_TYPE, edx); | |
5003 Split(equal, if_true, if_false, fall_through); | |
5004 } else if (String::Equals(check, factory->bool16x8_string())) { | |
5005 __ JumpIfSmi(eax, if_false); | |
5006 __ CmpObjectType(eax, BOOL16X8_TYPE, edx); | |
5007 Split(equal, if_true, if_false, fall_through); | |
5008 } else if (String::Equals(check, factory->int8x16_string())) { | |
5009 __ JumpIfSmi(eax, if_false); | |
5010 __ CmpObjectType(eax, INT8X16_TYPE, edx); | |
5011 Split(equal, if_true, if_false, fall_through); | |
5012 } else if (String::Equals(check, factory->bool8x16_string())) { | |
5013 __ JumpIfSmi(eax, if_false); | |
5014 __ CmpObjectType(eax, BOOL8X16_TYPE, edx); | |
5015 Split(equal, if_true, if_false, fall_through); | |
5016 } else if (String::Equals(check, factory->boolean_string())) { | 4984 } else if (String::Equals(check, factory->boolean_string())) { |
5017 __ cmp(eax, isolate()->factory()->true_value()); | 4985 __ cmp(eax, isolate()->factory()->true_value()); |
5018 __ j(equal, if_true); | 4986 __ j(equal, if_true); |
5019 __ cmp(eax, isolate()->factory()->false_value()); | 4987 __ cmp(eax, isolate()->factory()->false_value()); |
5020 Split(equal, if_true, if_false, fall_through); | 4988 Split(equal, if_true, if_false, fall_through); |
5021 } else if (String::Equals(check, factory->undefined_string())) { | 4989 } else if (String::Equals(check, factory->undefined_string())) { |
5022 __ cmp(eax, isolate()->factory()->undefined_value()); | 4990 __ cmp(eax, isolate()->factory()->undefined_value()); |
5023 __ j(equal, if_true); | 4991 __ j(equal, if_true); |
5024 __ JumpIfSmi(eax, if_false); | 4992 __ JumpIfSmi(eax, if_false); |
5025 // Check for undetectable objects => true. | 4993 // Check for undetectable objects => true. |
(...skipping 13 matching lines...) Expand all Loading... |
5039 __ cmp(eax, isolate()->factory()->null_value()); | 5007 __ cmp(eax, isolate()->factory()->null_value()); |
5040 __ j(equal, if_true); | 5008 __ j(equal, if_true); |
5041 __ CmpObjectType(eax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, edx); | 5009 __ CmpObjectType(eax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, edx); |
5042 __ j(below, if_false); | 5010 __ j(below, if_false); |
5043 __ CmpInstanceType(edx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5011 __ CmpInstanceType(edx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
5044 __ j(above, if_false); | 5012 __ j(above, if_false); |
5045 // Check for undetectable objects => false. | 5013 // Check for undetectable objects => false. |
5046 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), | 5014 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), |
5047 1 << Map::kIsUndetectable); | 5015 1 << Map::kIsUndetectable); |
5048 Split(zero, if_true, if_false, fall_through); | 5016 Split(zero, if_true, if_false, fall_through); |
| 5017 // clang-format off |
| 5018 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
| 5019 } else if (String::Equals(check, factory->type##_string())) { \ |
| 5020 __ JumpIfSmi(eax, if_false); \ |
| 5021 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), \ |
| 5022 isolate()->factory()->type##_map()); \ |
| 5023 Split(equal, if_true, if_false, fall_through); |
| 5024 SIMD128_TYPES(SIMD128_TYPE) |
| 5025 #undef SIMD128_TYPE |
| 5026 // clang-format on |
5049 } else { | 5027 } else { |
5050 if (if_false != fall_through) __ jmp(if_false); | 5028 if (if_false != fall_through) __ jmp(if_false); |
5051 } | 5029 } |
5052 context()->Plug(if_true, if_false); | 5030 context()->Plug(if_true, if_false); |
5053 } | 5031 } |
5054 | 5032 |
5055 | 5033 |
5056 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { | 5034 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
5057 Comment cmnt(masm_, "[ CompareOperation"); | 5035 Comment cmnt(masm_, "[ CompareOperation"); |
5058 SetExpressionPosition(expr); | 5036 SetExpressionPosition(expr); |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5341 Assembler::target_address_at(call_target_address, | 5319 Assembler::target_address_at(call_target_address, |
5342 unoptimized_code)); | 5320 unoptimized_code)); |
5343 return OSR_AFTER_STACK_CHECK; | 5321 return OSR_AFTER_STACK_CHECK; |
5344 } | 5322 } |
5345 | 5323 |
5346 | 5324 |
5347 } // namespace internal | 5325 } // namespace internal |
5348 } // namespace v8 | 5326 } // namespace v8 |
5349 | 5327 |
5350 #endif // V8_TARGET_ARCH_IA32 | 5328 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |