| 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_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 3305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3316 VisitForAccumulatorValue(args->at(0)); | 3316 VisitForAccumulatorValue(args->at(0)); |
| 3317 | 3317 |
| 3318 Label materialize_true, materialize_false; | 3318 Label materialize_true, materialize_false; |
| 3319 Label* if_true = NULL; | 3319 Label* if_true = NULL; |
| 3320 Label* if_false = NULL; | 3320 Label* if_false = NULL; |
| 3321 Label* fall_through = NULL; | 3321 Label* fall_through = NULL; |
| 3322 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | 3322 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 3323 &if_false, &fall_through); | 3323 &if_false, &fall_through); |
| 3324 | 3324 |
| 3325 __ JumpIfSmi(eax, if_false); | 3325 __ JumpIfSmi(eax, if_false); |
| 3326 Register map = ebx; | 3326 __ CmpObjectType(eax, SIMD128_VALUE_TYPE, ebx); |
| 3327 __ mov(map, FieldOperand(eax, HeapObject::kMapOffset)); | |
| 3328 __ CmpInstanceType(map, FIRST_SIMD_VALUE_TYPE); | |
| 3329 __ j(less, if_false); | |
| 3330 __ CmpInstanceType(map, LAST_SIMD_VALUE_TYPE); | |
| 3331 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3327 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3332 Split(less_equal, if_true, if_false, fall_through); | 3328 Split(equal, if_true, if_false, fall_through); |
| 3333 | 3329 |
| 3334 context()->Plug(if_true, if_false); | 3330 context()->Plug(if_true, if_false); |
| 3335 } | 3331 } |
| 3336 | 3332 |
| 3337 | 3333 |
| 3338 void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( | 3334 void FullCodeGenerator::EmitIsStringWrapperSafeForDefaultValueOf( |
| 3339 CallRuntime* expr) { | 3335 CallRuntime* expr) { |
| 3340 ZoneList<Expression*>* args = expr->arguments(); | 3336 ZoneList<Expression*>* args = expr->arguments(); |
| 3341 DCHECK(args->length() == 1); | 3337 DCHECK(args->length() == 1); |
| 3342 | 3338 |
| (...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4944 __ CmpObjectType(eax, FIRST_NONSTRING_TYPE, edx); | 4940 __ CmpObjectType(eax, FIRST_NONSTRING_TYPE, edx); |
| 4945 __ j(above_equal, if_false); | 4941 __ j(above_equal, if_false); |
| 4946 // Check for undetectable objects => false. | 4942 // Check for undetectable objects => false. |
| 4947 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), | 4943 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), |
| 4948 1 << Map::kIsUndetectable); | 4944 1 << Map::kIsUndetectable); |
| 4949 Split(zero, if_true, if_false, fall_through); | 4945 Split(zero, if_true, if_false, fall_through); |
| 4950 } else if (String::Equals(check, factory->symbol_string())) { | 4946 } else if (String::Equals(check, factory->symbol_string())) { |
| 4951 __ JumpIfSmi(eax, if_false); | 4947 __ JumpIfSmi(eax, if_false); |
| 4952 __ CmpObjectType(eax, SYMBOL_TYPE, edx); | 4948 __ CmpObjectType(eax, SYMBOL_TYPE, edx); |
| 4953 Split(equal, if_true, if_false, fall_through); | 4949 Split(equal, if_true, if_false, fall_through); |
| 4954 } else if (String::Equals(check, factory->float32x4_string())) { | |
| 4955 __ JumpIfSmi(eax, if_false); | |
| 4956 __ CmpObjectType(eax, FLOAT32X4_TYPE, edx); | |
| 4957 Split(equal, if_true, if_false, fall_through); | |
| 4958 } else if (String::Equals(check, factory->int32x4_string())) { | |
| 4959 __ JumpIfSmi(eax, if_false); | |
| 4960 __ CmpObjectType(eax, INT32X4_TYPE, edx); | |
| 4961 Split(equal, if_true, if_false, fall_through); | |
| 4962 } else if (String::Equals(check, factory->bool32x4_string())) { | |
| 4963 __ JumpIfSmi(eax, if_false); | |
| 4964 __ CmpObjectType(eax, BOOL32X4_TYPE, edx); | |
| 4965 Split(equal, if_true, if_false, fall_through); | |
| 4966 } else if (String::Equals(check, factory->int16x8_string())) { | |
| 4967 __ JumpIfSmi(eax, if_false); | |
| 4968 __ CmpObjectType(eax, INT16X8_TYPE, edx); | |
| 4969 Split(equal, if_true, if_false, fall_through); | |
| 4970 } else if (String::Equals(check, factory->bool16x8_string())) { | |
| 4971 __ JumpIfSmi(eax, if_false); | |
| 4972 __ CmpObjectType(eax, BOOL16X8_TYPE, edx); | |
| 4973 Split(equal, if_true, if_false, fall_through); | |
| 4974 } else if (String::Equals(check, factory->int8x16_string())) { | |
| 4975 __ JumpIfSmi(eax, if_false); | |
| 4976 __ CmpObjectType(eax, INT8X16_TYPE, edx); | |
| 4977 Split(equal, if_true, if_false, fall_through); | |
| 4978 } else if (String::Equals(check, factory->bool8x16_string())) { | |
| 4979 __ JumpIfSmi(eax, if_false); | |
| 4980 __ CmpObjectType(eax, BOOL8X16_TYPE, edx); | |
| 4981 Split(equal, if_true, if_false, fall_through); | |
| 4982 } else if (String::Equals(check, factory->boolean_string())) { | 4950 } else if (String::Equals(check, factory->boolean_string())) { |
| 4983 __ cmp(eax, isolate()->factory()->true_value()); | 4951 __ cmp(eax, isolate()->factory()->true_value()); |
| 4984 __ j(equal, if_true); | 4952 __ j(equal, if_true); |
| 4985 __ cmp(eax, isolate()->factory()->false_value()); | 4953 __ cmp(eax, isolate()->factory()->false_value()); |
| 4986 Split(equal, if_true, if_false, fall_through); | 4954 Split(equal, if_true, if_false, fall_through); |
| 4987 } else if (String::Equals(check, factory->undefined_string())) { | 4955 } else if (String::Equals(check, factory->undefined_string())) { |
| 4988 __ cmp(eax, isolate()->factory()->undefined_value()); | 4956 __ cmp(eax, isolate()->factory()->undefined_value()); |
| 4989 __ j(equal, if_true); | 4957 __ j(equal, if_true); |
| 4990 __ JumpIfSmi(eax, if_false); | 4958 __ JumpIfSmi(eax, if_false); |
| 4991 // Check for undetectable objects => true. | 4959 // Check for undetectable objects => true. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 5005 __ cmp(eax, isolate()->factory()->null_value()); | 4973 __ cmp(eax, isolate()->factory()->null_value()); |
| 5006 __ j(equal, if_true); | 4974 __ j(equal, if_true); |
| 5007 __ CmpObjectType(eax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, edx); | 4975 __ CmpObjectType(eax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, edx); |
| 5008 __ j(below, if_false); | 4976 __ j(below, if_false); |
| 5009 __ CmpInstanceType(edx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 4977 __ CmpInstanceType(edx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
| 5010 __ j(above, if_false); | 4978 __ j(above, if_false); |
| 5011 // Check for undetectable objects => false. | 4979 // Check for undetectable objects => false. |
| 5012 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), | 4980 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), |
| 5013 1 << Map::kIsUndetectable); | 4981 1 << Map::kIsUndetectable); |
| 5014 Split(zero, if_true, if_false, fall_through); | 4982 Split(zero, if_true, if_false, fall_through); |
| 4983 // clang-format off |
| 4984 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
| 4985 } else if (String::Equals(check, factory->type##_string())) { \ |
| 4986 __ JumpIfSmi(eax, if_false); \ |
| 4987 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), \ |
| 4988 isolate()->factory()->type##_map()); \ |
| 4989 Split(equal, if_true, if_false, fall_through); |
| 4990 SIMD128_TYPES(SIMD128_TYPE) |
| 4991 #undef SIMD128_TYPE |
| 4992 // clang-format on |
| 5015 } else { | 4993 } else { |
| 5016 if (if_false != fall_through) __ jmp(if_false); | 4994 if (if_false != fall_through) __ jmp(if_false); |
| 5017 } | 4995 } |
| 5018 context()->Plug(if_true, if_false); | 4996 context()->Plug(if_true, if_false); |
| 5019 } | 4997 } |
| 5020 | 4998 |
| 5021 | 4999 |
| 5022 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { | 5000 void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
| 5023 Comment cmnt(masm_, "[ CompareOperation"); | 5001 Comment cmnt(masm_, "[ CompareOperation"); |
| 5024 SetExpressionPosition(expr); | 5002 SetExpressionPosition(expr); |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5307 Assembler::target_address_at(call_target_address, | 5285 Assembler::target_address_at(call_target_address, |
| 5308 unoptimized_code)); | 5286 unoptimized_code)); |
| 5309 return OSR_AFTER_STACK_CHECK; | 5287 return OSR_AFTER_STACK_CHECK; |
| 5310 } | 5288 } |
| 5311 | 5289 |
| 5312 | 5290 |
| 5313 } // namespace internal | 5291 } // namespace internal |
| 5314 } // namespace v8 | 5292 } // namespace v8 |
| 5315 | 5293 |
| 5316 #endif // V8_TARGET_ARCH_X87 | 5294 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |