OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 27 matching lines...) Expand all Loading... |
38 | 38 |
39 | 39 |
40 Result::Result(Register reg) { | 40 Result::Result(Register reg) { |
41 ASSERT(reg.is_valid() && !RegisterAllocator::IsReserved(reg)); | 41 ASSERT(reg.is_valid() && !RegisterAllocator::IsReserved(reg)); |
42 CodeGeneratorScope::Current()->allocator()->Use(reg); | 42 CodeGeneratorScope::Current()->allocator()->Use(reg); |
43 value_ = TypeField::encode(REGISTER) | DataField::encode(reg.code_); | 43 value_ = TypeField::encode(REGISTER) | DataField::encode(reg.code_); |
44 } | 44 } |
45 | 45 |
46 | 46 |
47 Result::ZoneObjectList* Result::ConstantList() { | 47 Result::ZoneObjectList* Result::ConstantList() { |
48 static ZoneObjectList list(10); | 48 return v8_context()->code_generator_data_.result_constants_list(); |
49 return &list; | |
50 } | 49 } |
51 | 50 |
52 | 51 |
53 // ------------------------------------------------------------------------- | 52 // ------------------------------------------------------------------------- |
54 // RegisterAllocator implementation. | 53 // RegisterAllocator implementation. |
55 | 54 |
56 | 55 |
57 Result RegisterAllocator::AllocateWithoutSpilling() { | 56 Result RegisterAllocator::AllocateWithoutSpilling() { |
58 // Return the first free register, if any. | 57 // Return the first free register, if any. |
59 int num = registers_.ScanForFreeRegister(); | 58 int num = registers_.ScanForFreeRegister(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 cgen_->frame()->Spill(target); | 90 cgen_->frame()->Spill(target); |
92 ASSERT(!is_used(target)); | 91 ASSERT(!is_used(target)); |
93 return Result(target); | 92 return Result(target); |
94 } | 93 } |
95 // Otherwise (if it's referenced outside the frame) we cannot allocate it. | 94 // Otherwise (if it's referenced outside the frame) we cannot allocate it. |
96 return Result(); | 95 return Result(); |
97 } | 96 } |
98 | 97 |
99 | 98 |
100 } } // namespace v8::internal | 99 } } // namespace v8::internal |
OLD | NEW |