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 3295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3306 | 3306 |
3307 __ JumpIfSmi(eax, if_false); | 3307 __ JumpIfSmi(eax, if_false); |
3308 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ebx); | 3308 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ebx); |
3309 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3309 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3310 Split(above_equal, if_true, if_false, fall_through); | 3310 Split(above_equal, if_true, if_false, fall_through); |
3311 | 3311 |
3312 context()->Plug(if_true, if_false); | 3312 context()->Plug(if_true, if_false); |
3313 } | 3313 } |
3314 | 3314 |
3315 | 3315 |
| 3316 void FullCodeGenerator::EmitIsSpecObject(CallRuntime* expr) { |
| 3317 ZoneList<Expression*>* args = expr->arguments(); |
| 3318 DCHECK(args->length() == 1); |
| 3319 |
| 3320 VisitForAccumulatorValue(args->at(0)); |
| 3321 |
| 3322 Label materialize_true, materialize_false; |
| 3323 Label* if_true = NULL; |
| 3324 Label* if_false = NULL; |
| 3325 Label* fall_through = NULL; |
| 3326 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 3327 &if_false, &fall_through); |
| 3328 |
| 3329 __ JumpIfSmi(eax, if_false); |
| 3330 Register map = ebx; |
| 3331 __ mov(map, FieldOperand(eax, HeapObject::kMapOffset)); |
| 3332 __ CmpInstanceType(map, FIRST_SIMD_VALUE_TYPE); |
| 3333 __ j(less, if_false); |
| 3334 __ CmpInstanceType(map, LAST_SIMD_VALUE_TYPE); |
| 3335 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3336 Split(less_equal, if_true, if_false, fall_through); |
| 3337 |
| 3338 context()->Plug(if_true, if_false); |
| 3339 } |
| 3340 |
| 3341 |
3316 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { | 3342 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { |
3317 ZoneList<Expression*>* args = expr->arguments(); | 3343 ZoneList<Expression*>* args = expr->arguments(); |
3318 DCHECK(args->length() == 1); | 3344 DCHECK(args->length() == 1); |
3319 | 3345 |
3320 VisitForAccumulatorValue(args->at(0)); | 3346 VisitForAccumulatorValue(args->at(0)); |
3321 | 3347 |
3322 Label materialize_true, materialize_false; | 3348 Label materialize_true, materialize_false; |
3323 Label* if_true = NULL; | 3349 Label* if_true = NULL; |
3324 Label* if_false = NULL; | 3350 Label* if_false = NULL; |
3325 Label* fall_through = NULL; | 3351 Label* fall_through = NULL; |
(...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4999 1 << Map::kIsUndetectable); | 5025 1 << Map::kIsUndetectable); |
5000 Split(zero, if_true, if_false, fall_through); | 5026 Split(zero, if_true, if_false, fall_through); |
5001 } else if (String::Equals(check, factory->symbol_string())) { | 5027 } else if (String::Equals(check, factory->symbol_string())) { |
5002 __ JumpIfSmi(eax, if_false); | 5028 __ JumpIfSmi(eax, if_false); |
5003 __ CmpObjectType(eax, SYMBOL_TYPE, edx); | 5029 __ CmpObjectType(eax, SYMBOL_TYPE, edx); |
5004 Split(equal, if_true, if_false, fall_through); | 5030 Split(equal, if_true, if_false, fall_through); |
5005 } else if (String::Equals(check, factory->float32x4_string())) { | 5031 } else if (String::Equals(check, factory->float32x4_string())) { |
5006 __ JumpIfSmi(eax, if_false); | 5032 __ JumpIfSmi(eax, if_false); |
5007 __ CmpObjectType(eax, FLOAT32X4_TYPE, edx); | 5033 __ CmpObjectType(eax, FLOAT32X4_TYPE, edx); |
5008 Split(equal, if_true, if_false, fall_through); | 5034 Split(equal, if_true, if_false, fall_through); |
| 5035 } else if (String::Equals(check, factory->int32x4_string())) { |
| 5036 __ JumpIfSmi(eax, if_false); |
| 5037 __ CmpObjectType(eax, INT32X4_TYPE, edx); |
| 5038 Split(equal, if_true, if_false, fall_through); |
| 5039 } else if (String::Equals(check, factory->bool32x4_string())) { |
| 5040 __ JumpIfSmi(eax, if_false); |
| 5041 __ CmpObjectType(eax, BOOL32X4_TYPE, edx); |
| 5042 Split(equal, if_true, if_false, fall_through); |
| 5043 } else if (String::Equals(check, factory->int16x8_string())) { |
| 5044 __ JumpIfSmi(eax, if_false); |
| 5045 __ CmpObjectType(eax, INT16X8_TYPE, edx); |
| 5046 Split(equal, if_true, if_false, fall_through); |
| 5047 } else if (String::Equals(check, factory->bool16x8_string())) { |
| 5048 __ JumpIfSmi(eax, if_false); |
| 5049 __ CmpObjectType(eax, BOOL16X8_TYPE, edx); |
| 5050 Split(equal, if_true, if_false, fall_through); |
| 5051 } else if (String::Equals(check, factory->int8x16_string())) { |
| 5052 __ JumpIfSmi(eax, if_false); |
| 5053 __ CmpObjectType(eax, INT8X16_TYPE, edx); |
| 5054 Split(equal, if_true, if_false, fall_through); |
| 5055 } else if (String::Equals(check, factory->bool8x16_string())) { |
| 5056 __ JumpIfSmi(eax, if_false); |
| 5057 __ CmpObjectType(eax, BOOL8X16_TYPE, edx); |
| 5058 Split(equal, if_true, if_false, fall_through); |
5009 } else if (String::Equals(check, factory->boolean_string())) { | 5059 } else if (String::Equals(check, factory->boolean_string())) { |
5010 __ cmp(eax, isolate()->factory()->true_value()); | 5060 __ cmp(eax, isolate()->factory()->true_value()); |
5011 __ j(equal, if_true); | 5061 __ j(equal, if_true); |
5012 __ cmp(eax, isolate()->factory()->false_value()); | 5062 __ cmp(eax, isolate()->factory()->false_value()); |
5013 Split(equal, if_true, if_false, fall_through); | 5063 Split(equal, if_true, if_false, fall_through); |
5014 } else if (String::Equals(check, factory->undefined_string())) { | 5064 } else if (String::Equals(check, factory->undefined_string())) { |
5015 __ cmp(eax, isolate()->factory()->undefined_value()); | 5065 __ cmp(eax, isolate()->factory()->undefined_value()); |
5016 __ j(equal, if_true); | 5066 __ j(equal, if_true); |
5017 __ JumpIfSmi(eax, if_false); | 5067 __ JumpIfSmi(eax, if_false); |
5018 // Check for undetectable objects => true. | 5068 // Check for undetectable objects => true. |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5334 Assembler::target_address_at(call_target_address, | 5384 Assembler::target_address_at(call_target_address, |
5335 unoptimized_code)); | 5385 unoptimized_code)); |
5336 return OSR_AFTER_STACK_CHECK; | 5386 return OSR_AFTER_STACK_CHECK; |
5337 } | 5387 } |
5338 | 5388 |
5339 | 5389 |
5340 } // namespace internal | 5390 } // namespace internal |
5341 } // namespace v8 | 5391 } // namespace v8 |
5342 | 5392 |
5343 #endif // V8_TARGET_ARCH_X87 | 5393 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |