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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 __ Push(Smi::FromInt(0)); // Initial index. | 760 __ Push(Smi::FromInt(0)); // Initial index. |
761 | 761 |
762 // Generate code for doing the condition check. | 762 // Generate code for doing the condition check. |
763 __ bind(&loop); | 763 __ bind(&loop); |
764 __ movq(rax, Operand(rsp, 0 * kPointerSize)); // Get the current index. | 764 __ movq(rax, Operand(rsp, 0 * kPointerSize)); // Get the current index. |
765 __ cmpq(rax, Operand(rsp, 1 * kPointerSize)); // Compare to the array length. | 765 __ cmpq(rax, Operand(rsp, 1 * kPointerSize)); // Compare to the array length. |
766 __ j(above_equal, loop_statement.break_target()); | 766 __ j(above_equal, loop_statement.break_target()); |
767 | 767 |
768 // Get the current entry of the array into register rbx. | 768 // Get the current entry of the array into register rbx. |
769 __ movq(rbx, Operand(rsp, 2 * kPointerSize)); | 769 __ movq(rbx, Operand(rsp, 2 * kPointerSize)); |
770 SmiIndex index = __ SmiToIndex(rax, rax, kPointerSizeLog2); | 770 SmiIndex index = masm()->SmiToIndex(rax, rax, kPointerSizeLog2); |
771 __ movq(rbx, FieldOperand(rbx, | 771 __ movq(rbx, FieldOperand(rbx, |
772 index.reg, | 772 index.reg, |
773 index.scale, | 773 index.scale, |
774 FixedArray::kHeaderSize)); | 774 FixedArray::kHeaderSize)); |
775 | 775 |
776 // Get the expected map from the stack or a zero map in the | 776 // Get the expected map from the stack or a zero map in the |
777 // permanent slow case into register rdx. | 777 // permanent slow case into register rdx. |
778 __ movq(rdx, Operand(rsp, 3 * kPointerSize)); | 778 __ movq(rdx, Operand(rsp, 3 * kPointerSize)); |
779 | 779 |
780 // Check if the expected map still matches that of the enumerable. | 780 // Check if the expected map still matches that of the enumerable. |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1400 Expression* right, | 1400 Expression* right, |
1401 ConstantOperand constant) { | 1401 ConstantOperand constant) { |
1402 ASSERT(constant == kNoConstants); // Only handled case. | 1402 ASSERT(constant == kNoConstants); // Only handled case. |
1403 | 1403 |
1404 // Do combined smi check of the operands. Left operand is on the | 1404 // Do combined smi check of the operands. Left operand is on the |
1405 // stack (popped into rdx). Right operand is in rax but moved into | 1405 // stack (popped into rdx). Right operand is in rax but moved into |
1406 // rcx to make the shifts easier. | 1406 // rcx to make the shifts easier. |
1407 Label done, stub_call, smi_case; | 1407 Label done, stub_call, smi_case; |
1408 __ pop(rdx); | 1408 __ pop(rdx); |
1409 __ movq(rcx, rax); | 1409 __ movq(rcx, rax); |
1410 Condition smi = __ CheckBothSmi(rdx, rax); | 1410 Condition smi = masm()->CheckBothSmi(rdx, rax); |
1411 __ j(smi, &smi_case); | 1411 __ j(smi, &smi_case); |
1412 | 1412 |
1413 __ bind(&stub_call); | 1413 __ bind(&stub_call); |
1414 GenericBinaryOpStub stub(op, mode, NO_SMI_CODE_IN_STUB, TypeInfo::Unknown()); | 1414 GenericBinaryOpStub stub(op, mode, NO_SMI_CODE_IN_STUB, TypeInfo::Unknown()); |
1415 if (stub.ArgsInRegistersSupported()) { | 1415 if (stub.ArgsInRegistersSupported()) { |
1416 stub.GenerateCall(masm_, rdx, rcx); | 1416 stub.GenerateCall(masm_, rdx, rcx); |
1417 } else { | 1417 } else { |
1418 __ push(rdx); | 1418 __ push(rdx); |
1419 __ push(rcx); | 1419 __ push(rcx); |
1420 __ CallStub(&stub); | 1420 __ CallStub(&stub); |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1958 | 1958 |
1959 VisitForAccumulatorValue(args->at(0)); | 1959 VisitForAccumulatorValue(args->at(0)); |
1960 | 1960 |
1961 Label materialize_true, materialize_false; | 1961 Label materialize_true, materialize_false; |
1962 Label* if_true = NULL; | 1962 Label* if_true = NULL; |
1963 Label* if_false = NULL; | 1963 Label* if_false = NULL; |
1964 Label* fall_through = NULL; | 1964 Label* fall_through = NULL; |
1965 context()->PrepareTest(&materialize_true, &materialize_false, | 1965 context()->PrepareTest(&materialize_true, &materialize_false, |
1966 &if_true, &if_false, &fall_through); | 1966 &if_true, &if_false, &fall_through); |
1967 | 1967 |
1968 Condition positive_smi = __ CheckPositiveSmi(rax); | 1968 Condition non_negative_smi = masm()->CheckNonNegativeSmi(rax); |
1969 Split(positive_smi, if_true, if_false, fall_through); | 1969 Split(non_negative_smi, if_true, if_false, fall_through); |
1970 | 1970 |
1971 context()->Plug(if_true, if_false); | 1971 context()->Plug(if_true, if_false); |
1972 } | 1972 } |
1973 | 1973 |
1974 | 1974 |
1975 void FullCodeGenerator::EmitIsObject(ZoneList<Expression*>* args) { | 1975 void FullCodeGenerator::EmitIsObject(ZoneList<Expression*>* args) { |
1976 ASSERT(args->length() == 1); | 1976 ASSERT(args->length() == 1); |
1977 | 1977 |
1978 VisitForAccumulatorValue(args->at(0)); | 1978 VisitForAccumulatorValue(args->at(0)); |
1979 | 1979 |
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3419 __ ret(0); | 3419 __ ret(0); |
3420 } | 3420 } |
3421 | 3421 |
3422 | 3422 |
3423 #undef __ | 3423 #undef __ |
3424 | 3424 |
3425 | 3425 |
3426 } } // namespace v8::internal | 3426 } } // namespace v8::internal |
3427 | 3427 |
3428 #endif // V8_TARGET_ARCH_X64 | 3428 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |