| 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 3304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3315 | 3315 |
| 3316 __ JumpIfSmi(eax, if_false); | 3316 __ JumpIfSmi(eax, if_false); |
| 3317 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ebx); | 3317 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ebx); |
| 3318 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3318 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3319 Split(above_equal, if_true, if_false, fall_through); | 3319 Split(above_equal, if_true, if_false, fall_through); |
| 3320 | 3320 |
| 3321 context()->Plug(if_true, if_false); | 3321 context()->Plug(if_true, if_false); |
| 3322 } | 3322 } |
| 3323 | 3323 |
| 3324 | 3324 |
| 3325 void FullCodeGenerator::EmitIsSimdObject(CallRuntime* expr) { |
| 3326 ZoneList<Expression*>* args = expr->arguments(); |
| 3327 DCHECK(args->length() == 1); |
| 3328 |
| 3329 VisitForAccumulatorValue(args->at(0)); |
| 3330 |
| 3331 Label materialize_true, materialize_false; |
| 3332 Label* if_true = NULL; |
| 3333 Label* if_false = NULL; |
| 3334 Label* fall_through = NULL; |
| 3335 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
| 3336 &if_false, &fall_through); |
| 3337 |
| 3338 __ JumpIfSmi(eax, if_false); |
| 3339 Register map = ebx; |
| 3340 __ mov(map, FieldOperand(eax, HeapObject::kMapOffset)); |
| 3341 __ CmpInstanceType(map, FIRST_SIMD_VALUE_TYPE); |
| 3342 __ j(less, if_false); |
| 3343 __ CmpInstanceType(map, LAST_SIMD_VALUE_TYPE); |
| 3344 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
| 3345 Split(less_equal, if_true, if_false, fall_through); |
| 3346 |
| 3347 context()->Plug(if_true, if_false); |
| 3348 } |
| 3349 |
| 3350 |
| 3325 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { | 3351 void FullCodeGenerator::EmitIsUndetectableObject(CallRuntime* expr) { |
| 3326 ZoneList<Expression*>* args = expr->arguments(); | 3352 ZoneList<Expression*>* args = expr->arguments(); |
| 3327 DCHECK(args->length() == 1); | 3353 DCHECK(args->length() == 1); |
| 3328 | 3354 |
| 3329 VisitForAccumulatorValue(args->at(0)); | 3355 VisitForAccumulatorValue(args->at(0)); |
| 3330 | 3356 |
| 3331 Label materialize_true, materialize_false; | 3357 Label materialize_true, materialize_false; |
| 3332 Label* if_true = NULL; | 3358 Label* if_true = NULL; |
| 3333 Label* if_false = NULL; | 3359 Label* if_false = NULL; |
| 3334 Label* fall_through = NULL; | 3360 Label* fall_through = NULL; |
| (...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5008 1 << Map::kIsUndetectable); | 5034 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(eax, if_false); | 5037 __ JumpIfSmi(eax, if_false); |
| 5012 __ CmpObjectType(eax, SYMBOL_TYPE, edx); | 5038 __ CmpObjectType(eax, SYMBOL_TYPE, edx); |
| 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(eax, if_false); | 5041 __ JumpIfSmi(eax, if_false); |
| 5016 __ CmpObjectType(eax, FLOAT32X4_TYPE, edx); | 5042 __ CmpObjectType(eax, FLOAT32X4_TYPE, edx); |
| 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(eax, if_false); |
| 5046 __ CmpObjectType(eax, INT32X4_TYPE, edx); |
| 5047 Split(equal, if_true, if_false, fall_through); |
| 5048 } else if (String::Equals(check, factory->bool32x4_string())) { |
| 5049 __ JumpIfSmi(eax, if_false); |
| 5050 __ CmpObjectType(eax, BOOL32X4_TYPE, edx); |
| 5051 Split(equal, if_true, if_false, fall_through); |
| 5052 } else if (String::Equals(check, factory->int16x8_string())) { |
| 5053 __ JumpIfSmi(eax, if_false); |
| 5054 __ CmpObjectType(eax, INT16X8_TYPE, edx); |
| 5055 Split(equal, if_true, if_false, fall_through); |
| 5056 } else if (String::Equals(check, factory->bool16x8_string())) { |
| 5057 __ JumpIfSmi(eax, if_false); |
| 5058 __ CmpObjectType(eax, BOOL16X8_TYPE, edx); |
| 5059 Split(equal, if_true, if_false, fall_through); |
| 5060 } else if (String::Equals(check, factory->int8x16_string())) { |
| 5061 __ JumpIfSmi(eax, if_false); |
| 5062 __ CmpObjectType(eax, INT8X16_TYPE, edx); |
| 5063 Split(equal, if_true, if_false, fall_through); |
| 5064 } else if (String::Equals(check, factory->bool8x16_string())) { |
| 5065 __ JumpIfSmi(eax, if_false); |
| 5066 __ CmpObjectType(eax, BOOL8X16_TYPE, edx); |
| 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 __ cmp(eax, isolate()->factory()->true_value()); | 5069 __ cmp(eax, isolate()->factory()->true_value()); |
| 5020 __ j(equal, if_true); | 5070 __ j(equal, if_true); |
| 5021 __ cmp(eax, isolate()->factory()->false_value()); | 5071 __ cmp(eax, isolate()->factory()->false_value()); |
| 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 __ cmp(eax, isolate()->factory()->undefined_value()); | 5074 __ cmp(eax, isolate()->factory()->undefined_value()); |
| 5025 __ j(equal, if_true); | 5075 __ j(equal, if_true); |
| 5026 __ JumpIfSmi(eax, if_false); | 5076 __ JumpIfSmi(eax, if_false); |
| 5027 // Check for undetectable objects => true. | 5077 // Check for undetectable objects => true. |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5343 Assembler::target_address_at(call_target_address, | 5393 Assembler::target_address_at(call_target_address, |
| 5344 unoptimized_code)); | 5394 unoptimized_code)); |
| 5345 return OSR_AFTER_STACK_CHECK; | 5395 return OSR_AFTER_STACK_CHECK; |
| 5346 } | 5396 } |
| 5347 | 5397 |
| 5348 | 5398 |
| 5349 } // namespace internal | 5399 } // namespace internal |
| 5350 } // namespace v8 | 5400 } // namespace v8 |
| 5351 | 5401 |
| 5352 #endif // V8_TARGET_ARCH_IA32 | 5402 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |