OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 4557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4568 Label* if_false = NULL; | 4568 Label* if_false = NULL; |
4569 Label* fall_through = NULL; | 4569 Label* fall_through = NULL; |
4570 context()->PrepareTest(&materialize_true, &materialize_false, | 4570 context()->PrepareTest(&materialize_true, &materialize_false, |
4571 &if_true, &if_false, &fall_through); | 4571 &if_true, &if_false, &fall_through); |
4572 | 4572 |
4573 { AccumulatorValueContext context(this); | 4573 { AccumulatorValueContext context(this); |
4574 VisitForTypeofValue(sub_expr); | 4574 VisitForTypeofValue(sub_expr); |
4575 } | 4575 } |
4576 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 4576 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
4577 | 4577 |
4578 if (check->Equals(isolate()->heap()->number_string())) { | 4578 Factory* factory = isolate()->factory(); |
| 4579 if (String::Equals(check, factory->number_string())) { |
4579 __ JumpIfSmi(v0, if_true); | 4580 __ JumpIfSmi(v0, if_true); |
4580 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); | 4581 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); |
4581 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); | 4582 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
4582 Split(eq, v0, Operand(at), if_true, if_false, fall_through); | 4583 Split(eq, v0, Operand(at), if_true, if_false, fall_through); |
4583 } else if (check->Equals(isolate()->heap()->string_string())) { | 4584 } else if (String::Equals(check, factory->string_string())) { |
4584 __ JumpIfSmi(v0, if_false); | 4585 __ JumpIfSmi(v0, if_false); |
4585 // Check for undetectable objects => false. | 4586 // Check for undetectable objects => false. |
4586 __ GetObjectType(v0, v0, a1); | 4587 __ GetObjectType(v0, v0, a1); |
4587 __ Branch(if_false, ge, a1, Operand(FIRST_NONSTRING_TYPE)); | 4588 __ Branch(if_false, ge, a1, Operand(FIRST_NONSTRING_TYPE)); |
4588 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); | 4589 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); |
4589 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); | 4590 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); |
4590 Split(eq, a1, Operand(zero_reg), | 4591 Split(eq, a1, Operand(zero_reg), |
4591 if_true, if_false, fall_through); | 4592 if_true, if_false, fall_through); |
4592 } else if (check->Equals(isolate()->heap()->symbol_string())) { | 4593 } else if (String::Equals(check, factory->symbol_string())) { |
4593 __ JumpIfSmi(v0, if_false); | 4594 __ JumpIfSmi(v0, if_false); |
4594 __ GetObjectType(v0, v0, a1); | 4595 __ GetObjectType(v0, v0, a1); |
4595 Split(eq, a1, Operand(SYMBOL_TYPE), if_true, if_false, fall_through); | 4596 Split(eq, a1, Operand(SYMBOL_TYPE), if_true, if_false, fall_through); |
4596 } else if (check->Equals(isolate()->heap()->boolean_string())) { | 4597 } else if (String::Equals(check, factory->boolean_string())) { |
4597 __ LoadRoot(at, Heap::kTrueValueRootIndex); | 4598 __ LoadRoot(at, Heap::kTrueValueRootIndex); |
4598 __ Branch(if_true, eq, v0, Operand(at)); | 4599 __ Branch(if_true, eq, v0, Operand(at)); |
4599 __ LoadRoot(at, Heap::kFalseValueRootIndex); | 4600 __ LoadRoot(at, Heap::kFalseValueRootIndex); |
4600 Split(eq, v0, Operand(at), if_true, if_false, fall_through); | 4601 Split(eq, v0, Operand(at), if_true, if_false, fall_through); |
4601 } else if (FLAG_harmony_typeof && | 4602 } else if (FLAG_harmony_typeof && |
4602 check->Equals(isolate()->heap()->null_string())) { | 4603 String::Equals(check, factory->null_string())) { |
4603 __ LoadRoot(at, Heap::kNullValueRootIndex); | 4604 __ LoadRoot(at, Heap::kNullValueRootIndex); |
4604 Split(eq, v0, Operand(at), if_true, if_false, fall_through); | 4605 Split(eq, v0, Operand(at), if_true, if_false, fall_through); |
4605 } else if (check->Equals(isolate()->heap()->undefined_string())) { | 4606 } else if (String::Equals(check, factory->undefined_string())) { |
4606 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 4607 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
4607 __ Branch(if_true, eq, v0, Operand(at)); | 4608 __ Branch(if_true, eq, v0, Operand(at)); |
4608 __ JumpIfSmi(v0, if_false); | 4609 __ JumpIfSmi(v0, if_false); |
4609 // Check for undetectable objects => true. | 4610 // Check for undetectable objects => true. |
4610 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); | 4611 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); |
4611 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); | 4612 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); |
4612 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); | 4613 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); |
4613 Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through); | 4614 Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through); |
4614 } else if (check->Equals(isolate()->heap()->function_string())) { | 4615 } else if (String::Equals(check, factory->function_string())) { |
4615 __ JumpIfSmi(v0, if_false); | 4616 __ JumpIfSmi(v0, if_false); |
4616 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | 4617 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
4617 __ GetObjectType(v0, v0, a1); | 4618 __ GetObjectType(v0, v0, a1); |
4618 __ Branch(if_true, eq, a1, Operand(JS_FUNCTION_TYPE)); | 4619 __ Branch(if_true, eq, a1, Operand(JS_FUNCTION_TYPE)); |
4619 Split(eq, a1, Operand(JS_FUNCTION_PROXY_TYPE), | 4620 Split(eq, a1, Operand(JS_FUNCTION_PROXY_TYPE), |
4620 if_true, if_false, fall_through); | 4621 if_true, if_false, fall_through); |
4621 } else if (check->Equals(isolate()->heap()->object_string())) { | 4622 } else if (String::Equals(check, factory->object_string())) { |
4622 __ JumpIfSmi(v0, if_false); | 4623 __ JumpIfSmi(v0, if_false); |
4623 if (!FLAG_harmony_typeof) { | 4624 if (!FLAG_harmony_typeof) { |
4624 __ LoadRoot(at, Heap::kNullValueRootIndex); | 4625 __ LoadRoot(at, Heap::kNullValueRootIndex); |
4625 __ Branch(if_true, eq, v0, Operand(at)); | 4626 __ Branch(if_true, eq, v0, Operand(at)); |
4626 } | 4627 } |
4627 // Check for JS objects => true. | 4628 // Check for JS objects => true. |
4628 __ GetObjectType(v0, v0, a1); | 4629 __ GetObjectType(v0, v0, a1); |
4629 __ Branch(if_false, lt, a1, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 4630 __ Branch(if_false, lt, a1, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
4630 __ lbu(a1, FieldMemOperand(v0, Map::kInstanceTypeOffset)); | 4631 __ lbu(a1, FieldMemOperand(v0, Map::kInstanceTypeOffset)); |
4631 __ Branch(if_false, gt, a1, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 4632 __ Branch(if_false, gt, a1, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4961 Assembler::target_address_at(pc_immediate_load_address)) == | 4962 Assembler::target_address_at(pc_immediate_load_address)) == |
4962 reinterpret_cast<uint32_t>( | 4963 reinterpret_cast<uint32_t>( |
4963 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4964 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4964 return OSR_AFTER_STACK_CHECK; | 4965 return OSR_AFTER_STACK_CHECK; |
4965 } | 4966 } |
4966 | 4967 |
4967 | 4968 |
4968 } } // namespace v8::internal | 4969 } } // namespace v8::internal |
4969 | 4970 |
4970 #endif // V8_TARGET_ARCH_MIPS | 4971 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |