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_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 3290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3301 | 3301 |
3302 __ JumpIfSmi(eax, if_false); | 3302 __ JumpIfSmi(eax, if_false); |
3303 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ebx); | 3303 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ebx); |
3304 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3304 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3305 Split(above_equal, if_true, if_false, fall_through); | 3305 Split(above_equal, if_true, if_false, fall_through); |
3306 | 3306 |
3307 context()->Plug(if_true, if_false); | 3307 context()->Plug(if_true, if_false); |
3308 } | 3308 } |
3309 | 3309 |
3310 | 3310 |
| 3311 void FullCodeGenerator::EmitIsSpecObject(CallRuntime* expr) { |
| 3312 ZoneList<Expression*>* args = expr->arguments(); |
| 3313 DCHECK(args->length() == 1); |
| 3314 |
| 3315 VisitForAccumulatorValue(args->at(0)); |
| 3316 |
| 3317 Label materialize_true, materialize_false; |
| 3318 Label* if_true = NULL; |
| 3319 Label* if_false = NULL; |
| 3320 Label* fall_through = NULL; |
| 3321 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 3322 &if_false, &fall_through); |
| 3323 |
| 3324 __ JumpIfSmi(eax, if_false); |
| 3325 Register map = ebx; |
| 3326 __ mov(map, FieldOperand(eax, HeapObject::kMapOffset)); |
| 3327 __ CmpInstanceType(map, FIRST_SIMD_VALUE_TYPE); |
| 3328 __ j(less, if_false); |
| 3329 __ CmpInstanceType(map, LAST_SIMD_VALUE_TYPE); |
| 3330 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3331 Split(less_equal, if_true, if_false, fall_through); |
| 3332 |
| 3333 context()->Plug(if_true, if_false); |
| 3334 } |
| 3335 |
| 3336 |
3311 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { | 3337 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { |
3312 ZoneList<Expression*>* args = expr->arguments(); | 3338 ZoneList<Expression*>* args = expr->arguments(); |
3313 DCHECK(args->length() == 1); | 3339 DCHECK(args->length() == 1); |
3314 | 3340 |
3315 VisitForAccumulatorValue(args->at(0)); | 3341 VisitForAccumulatorValue(args->at(0)); |
3316 | 3342 |
3317 Label materialize_true, materialize_false; | 3343 Label materialize_true, materialize_false; |
3318 Label* if_true = NULL; | 3344 Label* if_true = NULL; |
3319 Label* if_false = NULL; | 3345 Label* if_false = NULL; |
3320 Label* fall_through = NULL; | 3346 Label* fall_through = NULL; |
(...skipping 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4981 1 << Map::kIsUndetectable); | 5007 1 << Map::kIsUndetectable); |
4982 Split(zero, if_true, if_false, fall_through); | 5008 Split(zero, if_true, if_false, fall_through); |
4983 } else if (String::Equals(check, factory->symbol_string())) { | 5009 } else if (String::Equals(check, factory->symbol_string())) { |
4984 __ JumpIfSmi(eax, if_false); | 5010 __ JumpIfSmi(eax, if_false); |
4985 __ CmpObjectType(eax, SYMBOL_TYPE, edx); | 5011 __ CmpObjectType(eax, SYMBOL_TYPE, edx); |
4986 Split(equal, if_true, if_false, fall_through); | 5012 Split(equal, if_true, if_false, fall_through); |
4987 } else if (String::Equals(check, factory->float32x4_string())) { | 5013 } else if (String::Equals(check, factory->float32x4_string())) { |
4988 __ JumpIfSmi(eax, if_false); | 5014 __ JumpIfSmi(eax, if_false); |
4989 __ CmpObjectType(eax, FLOAT32X4_TYPE, edx); | 5015 __ CmpObjectType(eax, FLOAT32X4_TYPE, edx); |
4990 Split(equal, if_true, if_false, fall_through); | 5016 Split(equal, if_true, if_false, fall_through); |
| 5017 } else if (String::Equals(check, factory->int32x4_string())) { |
| 5018 __ JumpIfSmi(eax, if_false); |
| 5019 __ CmpObjectType(eax, INT32X4_TYPE, edx); |
| 5020 Split(equal, if_true, if_false, fall_through); |
| 5021 } else if (String::Equals(check, factory->bool32x4_string())) { |
| 5022 __ JumpIfSmi(eax, if_false); |
| 5023 __ CmpObjectType(eax, BOOL32X4_TYPE, edx); |
| 5024 Split(equal, if_true, if_false, fall_through); |
| 5025 } else if (String::Equals(check, factory->int16x8_string())) { |
| 5026 __ JumpIfSmi(eax, if_false); |
| 5027 __ CmpObjectType(eax, INT16X8_TYPE, edx); |
| 5028 Split(equal, if_true, if_false, fall_through); |
| 5029 } else if (String::Equals(check, factory->bool16x8_string())) { |
| 5030 __ JumpIfSmi(eax, if_false); |
| 5031 __ CmpObjectType(eax, BOOL16X8_TYPE, edx); |
| 5032 Split(equal, if_true, if_false, fall_through); |
| 5033 } else if (String::Equals(check, factory->int8x16_string())) { |
| 5034 __ JumpIfSmi(eax, if_false); |
| 5035 __ CmpObjectType(eax, INT8X16_TYPE, edx); |
| 5036 Split(equal, if_true, if_false, fall_through); |
| 5037 } else if (String::Equals(check, factory->bool8x16_string())) { |
| 5038 __ JumpIfSmi(eax, if_false); |
| 5039 __ CmpObjectType(eax, BOOL8X16_TYPE, edx); |
| 5040 Split(equal, if_true, if_false, fall_through); |
4991 } else if (String::Equals(check, factory->boolean_string())) { | 5041 } else if (String::Equals(check, factory->boolean_string())) { |
4992 __ cmp(eax, isolate()->factory()->true_value()); | 5042 __ cmp(eax, isolate()->factory()->true_value()); |
4993 __ j(equal, if_true); | 5043 __ j(equal, if_true); |
4994 __ cmp(eax, isolate()->factory()->false_value()); | 5044 __ cmp(eax, isolate()->factory()->false_value()); |
4995 Split(equal, if_true, if_false, fall_through); | 5045 Split(equal, if_true, if_false, fall_through); |
4996 } else if (String::Equals(check, factory->undefined_string())) { | 5046 } else if (String::Equals(check, factory->undefined_string())) { |
4997 __ cmp(eax, isolate()->factory()->undefined_value()); | 5047 __ cmp(eax, isolate()->factory()->undefined_value()); |
4998 __ j(equal, if_true); | 5048 __ j(equal, if_true); |
4999 __ JumpIfSmi(eax, if_false); | 5049 __ JumpIfSmi(eax, if_false); |
5000 // Check for undetectable objects => true. | 5050 // Check for undetectable objects => true. |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5316 Assembler::target_address_at(call_target_address, | 5366 Assembler::target_address_at(call_target_address, |
5317 unoptimized_code)); | 5367 unoptimized_code)); |
5318 return OSR_AFTER_STACK_CHECK; | 5368 return OSR_AFTER_STACK_CHECK; |
5319 } | 5369 } |
5320 | 5370 |
5321 | 5371 |
5322 } // namespace internal | 5372 } // namespace internal |
5323 } // namespace v8 | 5373 } // namespace v8 |
5324 | 5374 |
5325 #endif // V8_TARGET_ARCH_X87 | 5375 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |