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