| 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-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 5335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5346 __ JumpIfSmi(input, false_label, false_distance); | 5346 __ JumpIfSmi(input, false_label, false_distance); |
| 5347 __ CmpObjectType(input, SYMBOL_TYPE, input); | 5347 __ CmpObjectType(input, SYMBOL_TYPE, input); |
| 5348 final_branch_condition = equal; | 5348 final_branch_condition = equal; |
| 5349 | 5349 |
| 5350 } else if (String::Equals(type_name, factory()->boolean_string())) { | 5350 } else if (String::Equals(type_name, factory()->boolean_string())) { |
| 5351 __ cmp(input, factory()->true_value()); | 5351 __ cmp(input, factory()->true_value()); |
| 5352 __ j(equal, true_label, true_distance); | 5352 __ j(equal, true_label, true_distance); |
| 5353 __ cmp(input, factory()->false_value()); | 5353 __ cmp(input, factory()->false_value()); |
| 5354 final_branch_condition = equal; | 5354 final_branch_condition = equal; |
| 5355 | 5355 |
| 5356 } else if (FLAG_harmony_typeof && | |
| 5357 String::Equals(type_name, factory()->null_string())) { | |
| 5358 __ cmp(input, factory()->null_value()); | |
| 5359 final_branch_condition = equal; | |
| 5360 | |
| 5361 } else if (String::Equals(type_name, factory()->undefined_string())) { | 5356 } else if (String::Equals(type_name, factory()->undefined_string())) { |
| 5362 __ cmp(input, factory()->undefined_value()); | 5357 __ cmp(input, factory()->undefined_value()); |
| 5363 __ j(equal, true_label, true_distance); | 5358 __ j(equal, true_label, true_distance); |
| 5364 __ JumpIfSmi(input, false_label, false_distance); | 5359 __ JumpIfSmi(input, false_label, false_distance); |
| 5365 // Check for undetectable objects => true. | 5360 // Check for undetectable objects => true. |
| 5366 __ mov(input, FieldOperand(input, HeapObject::kMapOffset)); | 5361 __ mov(input, FieldOperand(input, HeapObject::kMapOffset)); |
| 5367 __ test_b(FieldOperand(input, Map::kBitFieldOffset), | 5362 __ test_b(FieldOperand(input, Map::kBitFieldOffset), |
| 5368 1 << Map::kIsUndetectable); | 5363 1 << Map::kIsUndetectable); |
| 5369 final_branch_condition = not_zero; | 5364 final_branch_condition = not_zero; |
| 5370 | 5365 |
| 5371 } else if (String::Equals(type_name, factory()->function_string())) { | 5366 } else if (String::Equals(type_name, factory()->function_string())) { |
| 5372 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | 5367 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
| 5373 __ JumpIfSmi(input, false_label, false_distance); | 5368 __ JumpIfSmi(input, false_label, false_distance); |
| 5374 __ CmpObjectType(input, JS_FUNCTION_TYPE, input); | 5369 __ CmpObjectType(input, JS_FUNCTION_TYPE, input); |
| 5375 __ j(equal, true_label, true_distance); | 5370 __ j(equal, true_label, true_distance); |
| 5376 __ CmpInstanceType(input, JS_FUNCTION_PROXY_TYPE); | 5371 __ CmpInstanceType(input, JS_FUNCTION_PROXY_TYPE); |
| 5377 final_branch_condition = equal; | 5372 final_branch_condition = equal; |
| 5378 | 5373 |
| 5379 } else if (String::Equals(type_name, factory()->object_string())) { | 5374 } else if (String::Equals(type_name, factory()->object_string())) { |
| 5380 __ JumpIfSmi(input, false_label, false_distance); | 5375 __ JumpIfSmi(input, false_label, false_distance); |
| 5381 if (!FLAG_harmony_typeof) { | 5376 __ cmp(input, factory()->null_value()); |
| 5382 __ cmp(input, factory()->null_value()); | 5377 __ j(equal, true_label, true_distance); |
| 5383 __ j(equal, true_label, true_distance); | |
| 5384 } | |
| 5385 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); | 5378 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); |
| 5386 __ j(below, false_label, false_distance); | 5379 __ j(below, false_label, false_distance); |
| 5387 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | 5380 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
| 5388 __ j(above, false_label, false_distance); | 5381 __ j(above, false_label, false_distance); |
| 5389 // Check for undetectable objects => false. | 5382 // Check for undetectable objects => false. |
| 5390 __ test_b(FieldOperand(input, Map::kBitFieldOffset), | 5383 __ test_b(FieldOperand(input, Map::kBitFieldOffset), |
| 5391 1 << Map::kIsUndetectable); | 5384 1 << Map::kIsUndetectable); |
| 5392 final_branch_condition = zero; | 5385 final_branch_condition = zero; |
| 5393 | 5386 |
| 5394 } else { | 5387 } else { |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5698 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5691 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5699 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5692 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5700 } | 5693 } |
| 5701 | 5694 |
| 5702 | 5695 |
| 5703 #undef __ | 5696 #undef __ |
| 5704 | 5697 |
| 5705 } } // namespace v8::internal | 5698 } } // namespace v8::internal |
| 5706 | 5699 |
| 5707 #endif // V8_TARGET_ARCH_X87 | 5700 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |