OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 5049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5060 // Here we split control flow to the stub call and inlined cases | 5060 // Here we split control flow to the stub call and inlined cases |
5061 // before finally splitting it to the control destination. We use | 5061 // before finally splitting it to the control destination. We use |
5062 // a jump target and branching to duplicate the virtual frame at | 5062 // a jump target and branching to duplicate the virtual frame at |
5063 // the first split. We manually handle the off-frame references | 5063 // the first split. We manually handle the off-frame references |
5064 // by reconstituting them on the non-fall-through path. | 5064 // by reconstituting them on the non-fall-through path. |
5065 JumpTarget is_smi; | 5065 JumpTarget is_smi; |
5066 | 5066 |
5067 Condition left_is_smi = masm_->CheckSmi(left_side.reg()); | 5067 Condition left_is_smi = masm_->CheckSmi(left_side.reg()); |
5068 is_smi.Branch(left_is_smi); | 5068 is_smi.Branch(left_is_smi); |
5069 | 5069 |
5070 bool is_for_loop_compare = (node->AsCompareOperation() != NULL) | 5070 bool is_loop_condition = (node->AsExpression() != NULL) && |
5071 && node->AsCompareOperation()->is_for_loop_condition(); | 5071 node->AsExpression()->is_loop_condition(); |
5072 if (!is_for_loop_compare && right_val->IsSmi()) { | 5072 if (!is_loop_condition && right_val->IsSmi()) { |
5073 // Right side is a constant smi and left side has been checked | 5073 // Right side is a constant smi and left side has been checked |
5074 // not to be a smi. | 5074 // not to be a smi. |
5075 JumpTarget not_number; | 5075 JumpTarget not_number; |
5076 __ Cmp(FieldOperand(left_reg, HeapObject::kMapOffset), | 5076 __ Cmp(FieldOperand(left_reg, HeapObject::kMapOffset), |
5077 Factory::heap_number_map()); | 5077 Factory::heap_number_map()); |
5078 not_number.Branch(not_equal, &left_side); | 5078 not_number.Branch(not_equal, &left_side); |
5079 __ movsd(xmm1, | 5079 __ movsd(xmm1, |
5080 FieldOperand(left_reg, HeapNumber::kValueOffset)); | 5080 FieldOperand(left_reg, HeapNumber::kValueOffset)); |
5081 int value = Smi::cast(*right_val)->value(); | 5081 int value = Smi::cast(*right_val)->value(); |
5082 if (value == 0) { | 5082 if (value == 0) { |
(...skipping 4905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9988 // Call the function from C++. | 9988 // Call the function from C++. |
9989 return FUNCTION_CAST<ModuloFunction>(buffer); | 9989 return FUNCTION_CAST<ModuloFunction>(buffer); |
9990 } | 9990 } |
9991 | 9991 |
9992 #endif | 9992 #endif |
9993 | 9993 |
9994 | 9994 |
9995 #undef __ | 9995 #undef __ |
9996 | 9996 |
9997 } } // namespace v8::internal | 9997 } } // namespace v8::internal |
OLD | NEW |