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 2898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2909 VisitForAccumulatorValue(args->at(0)); | 2909 VisitForAccumulatorValue(args->at(0)); |
2910 | 2910 |
2911 Label materialize_true, materialize_false; | 2911 Label materialize_true, materialize_false; |
2912 Label* if_true = NULL; | 2912 Label* if_true = NULL; |
2913 Label* if_false = NULL; | 2913 Label* if_false = NULL; |
2914 Label* fall_through = NULL; | 2914 Label* fall_through = NULL; |
2915 context()->PrepareTest(&materialize_true, &materialize_false, | 2915 context()->PrepareTest(&materialize_true, &materialize_false, |
2916 &if_true, &if_false, &fall_through); | 2916 &if_true, &if_false, &fall_through); |
2917 | 2917 |
2918 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 2918 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
2919 __ And(t0, v0, Operand(kSmiTagMask)); | 2919 __ SmiTst(v0, t0); |
2920 Split(eq, t0, Operand(zero_reg), if_true, if_false, fall_through); | 2920 Split(eq, t0, Operand(zero_reg), if_true, if_false, fall_through); |
2921 | 2921 |
2922 context()->Plug(if_true, if_false); | 2922 context()->Plug(if_true, if_false); |
2923 } | 2923 } |
2924 | 2924 |
2925 | 2925 |
2926 void FullCodeGenerator::EmitIsNonNegativeSmi(CallRuntime* expr) { | 2926 void FullCodeGenerator::EmitIsNonNegativeSmi(CallRuntime* expr) { |
2927 ZoneList<Expression*>* args = expr->arguments(); | 2927 ZoneList<Expression*>* args = expr->arguments(); |
2928 ASSERT(args->length() == 1); | 2928 ASSERT(args->length() == 1); |
2929 | 2929 |
2930 VisitForAccumulatorValue(args->at(0)); | 2930 VisitForAccumulatorValue(args->at(0)); |
2931 | 2931 |
2932 Label materialize_true, materialize_false; | 2932 Label materialize_true, materialize_false; |
2933 Label* if_true = NULL; | 2933 Label* if_true = NULL; |
2934 Label* if_false = NULL; | 2934 Label* if_false = NULL; |
2935 Label* fall_through = NULL; | 2935 Label* fall_through = NULL; |
2936 context()->PrepareTest(&materialize_true, &materialize_false, | 2936 context()->PrepareTest(&materialize_true, &materialize_false, |
2937 &if_true, &if_false, &fall_through); | 2937 &if_true, &if_false, &fall_through); |
2938 | 2938 |
2939 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 2939 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
2940 __ And(at, v0, Operand(kSmiTagMask | 0x80000000)); | 2940 __ NonNegativeSmiTst(v0, at); |
2941 Split(eq, at, Operand(zero_reg), if_true, if_false, fall_through); | 2941 Split(eq, at, Operand(zero_reg), if_true, if_false, fall_through); |
2942 | 2942 |
2943 context()->Plug(if_true, if_false); | 2943 context()->Plug(if_true, if_false); |
2944 } | 2944 } |
2945 | 2945 |
2946 | 2946 |
2947 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { | 2947 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { |
2948 ZoneList<Expression*>* args = expr->arguments(); | 2948 ZoneList<Expression*>* args = expr->arguments(); |
2949 ASSERT(args->length() == 1); | 2949 ASSERT(args->length() == 1); |
2950 | 2950 |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3523 Register string = v0; | 3523 Register string = v0; |
3524 Register index = a1; | 3524 Register index = a1; |
3525 Register value = a2; | 3525 Register value = a2; |
3526 | 3526 |
3527 VisitForStackValue(args->at(1)); // index | 3527 VisitForStackValue(args->at(1)); // index |
3528 VisitForStackValue(args->at(2)); // value | 3528 VisitForStackValue(args->at(2)); // value |
3529 VisitForAccumulatorValue(args->at(0)); // string | 3529 VisitForAccumulatorValue(args->at(0)); // string |
3530 __ Pop(index, value); | 3530 __ Pop(index, value); |
3531 | 3531 |
3532 if (FLAG_debug_code) { | 3532 if (FLAG_debug_code) { |
3533 __ And(at, value, Operand(kSmiTagMask)); | 3533 __ SmiTst(value, at); |
3534 __ ThrowIf(ne, kNonSmiValue, at, Operand(zero_reg)); | 3534 __ ThrowIf(ne, kNonSmiValue, at, Operand(zero_reg)); |
3535 __ And(at, index, Operand(kSmiTagMask)); | 3535 __ SmiTst(index, at); |
3536 __ ThrowIf(ne, kNonSmiIndex, at, Operand(zero_reg)); | 3536 __ ThrowIf(ne, kNonSmiIndex, at, Operand(zero_reg)); |
3537 __ SmiUntag(index, index); | 3537 __ SmiUntag(index, index); |
3538 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag; | 3538 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag; |
3539 Register scratch = t5; | 3539 Register scratch = t5; |
3540 __ EmitSeqStringSetCharCheck( | 3540 __ EmitSeqStringSetCharCheck( |
3541 string, index, value, scratch, one_byte_seq_type); | 3541 string, index, value, scratch, one_byte_seq_type); |
3542 __ SmiTag(index, index); | 3542 __ SmiTag(index, index); |
3543 } | 3543 } |
3544 | 3544 |
3545 __ SmiUntag(value, value); | 3545 __ SmiUntag(value, value); |
(...skipping 14 matching lines...) Expand all Loading... |
3560 Register string = v0; | 3560 Register string = v0; |
3561 Register index = a1; | 3561 Register index = a1; |
3562 Register value = a2; | 3562 Register value = a2; |
3563 | 3563 |
3564 VisitForStackValue(args->at(1)); // index | 3564 VisitForStackValue(args->at(1)); // index |
3565 VisitForStackValue(args->at(2)); // value | 3565 VisitForStackValue(args->at(2)); // value |
3566 VisitForAccumulatorValue(args->at(0)); // string | 3566 VisitForAccumulatorValue(args->at(0)); // string |
3567 __ Pop(index, value); | 3567 __ Pop(index, value); |
3568 | 3568 |
3569 if (FLAG_debug_code) { | 3569 if (FLAG_debug_code) { |
3570 __ And(at, value, Operand(kSmiTagMask)); | 3570 __ SmiTst(value, at); |
3571 __ ThrowIf(ne, kNonSmiValue, at, Operand(zero_reg)); | 3571 __ ThrowIf(ne, kNonSmiValue, at, Operand(zero_reg)); |
3572 __ And(at, index, Operand(kSmiTagMask)); | 3572 __ SmiTst(index, at); |
3573 __ ThrowIf(ne, kNonSmiIndex, at, Operand(zero_reg)); | 3573 __ ThrowIf(ne, kNonSmiIndex, at, Operand(zero_reg)); |
3574 __ SmiUntag(index, index); | 3574 __ SmiUntag(index, index); |
3575 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; | 3575 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; |
3576 Register scratch = t5; | 3576 Register scratch = t5; |
3577 __ EmitSeqStringSetCharCheck( | 3577 __ EmitSeqStringSetCharCheck( |
3578 string, index, value, scratch, two_byte_seq_type); | 3578 string, index, value, scratch, two_byte_seq_type); |
3579 __ SmiTag(index, index); | 3579 __ SmiTag(index, index); |
3580 } | 3580 } |
3581 | 3581 |
3582 __ SmiUntag(value, value); | 3582 __ SmiUntag(value, value); |
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5009 Assembler::target_address_at(pc_immediate_load_address)) == | 5009 Assembler::target_address_at(pc_immediate_load_address)) == |
5010 reinterpret_cast<uint32_t>( | 5010 reinterpret_cast<uint32_t>( |
5011 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5011 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5012 return OSR_AFTER_STACK_CHECK; | 5012 return OSR_AFTER_STACK_CHECK; |
5013 } | 5013 } |
5014 | 5014 |
5015 | 5015 |
5016 } } // namespace v8::internal | 5016 } } // namespace v8::internal |
5017 | 5017 |
5018 #endif // V8_TARGET_ARCH_MIPS | 5018 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |