OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 6930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6941 UNREACHABLE(); | 6941 UNREACHABLE(); |
6942 } | 6942 } |
6943 } | 6943 } |
6944 | 6944 |
6945 | 6945 |
6946 void FloatingPointHelper::AllocateHeapNumber(MacroAssembler* masm, | 6946 void FloatingPointHelper::AllocateHeapNumber(MacroAssembler* masm, |
6947 Label* need_gc, | 6947 Label* need_gc, |
6948 Register scratch1, | 6948 Register scratch1, |
6949 Register scratch2, | 6949 Register scratch2, |
6950 Register result) { | 6950 Register result) { |
6951 ExternalReference allocation_top = | 6951 // Allocate heap number in new space. |
6952 ExternalReference::new_space_allocation_top_address(); | 6952 __ AllocateObjectInNewSpace(HeapNumber::kSize, |
6953 ExternalReference allocation_limit = | 6953 result, |
6954 ExternalReference::new_space_allocation_limit_address(); | 6954 scratch1, |
6955 __ mov(Operand(scratch1), Immediate(allocation_top)); | 6955 scratch2, |
6956 __ mov(result, Operand(scratch1, 0)); | 6956 need_gc, |
6957 __ lea(scratch2, Operand(result, HeapNumber::kSize)); // scratch2: new top | 6957 false); |
6958 __ cmp(scratch2, Operand::StaticVariable(allocation_limit)); | |
6959 __ j(above, need_gc, not_taken); | |
6960 | 6958 |
6961 __ mov(Operand(scratch1, 0), scratch2); // store new top | 6959 // Set the map and tag the result. |
6962 __ mov(Operand(result, HeapObject::kMapOffset), | 6960 __ mov(Operand(result, HeapObject::kMapOffset), |
6963 Immediate(Factory::heap_number_map())); | 6961 Immediate(Factory::heap_number_map())); |
6964 // Tag old top and use as result. | 6962 __ or_(Operand(result), Immediate(kHeapObjectTag)); |
6965 __ add(Operand(result), Immediate(kHeapObjectTag)); | |
6966 } | 6963 } |
6967 | 6964 |
6968 | 6965 |
6969 void FloatingPointHelper::LoadFloatOperand(MacroAssembler* masm, | 6966 void FloatingPointHelper::LoadFloatOperand(MacroAssembler* masm, |
6970 Register number) { | 6967 Register number) { |
6971 Label load_smi, done; | 6968 Label load_smi, done; |
6972 | 6969 |
6973 __ test(number, Immediate(kSmiTagMask)); | 6970 __ test(number, Immediate(kSmiTagMask)); |
6974 __ j(zero, &load_smi, not_taken); | 6971 __ j(zero, &load_smi, not_taken); |
6975 __ fld_d(FieldOperand(number, HeapNumber::kValueOffset)); | 6972 __ fld_d(FieldOperand(number, HeapNumber::kValueOffset)); |
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7873 | 7870 |
7874 int CompareStub::MinorKey() { | 7871 int CompareStub::MinorKey() { |
7875 // Encode the two parameters in a unique 16 bit value. | 7872 // Encode the two parameters in a unique 16 bit value. |
7876 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); | 7873 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); |
7877 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); | 7874 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); |
7878 } | 7875 } |
7879 | 7876 |
7880 #undef __ | 7877 #undef __ |
7881 | 7878 |
7882 } } // namespace v8::internal | 7879 } } // namespace v8::internal |
OLD | NEW |