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 2419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2430 Code::Flags flags, | 2430 Code::Flags flags, |
2431 Handle<Object> self_reference) { | 2431 Handle<Object> self_reference) { |
2432 // Allocate ByteArray before the Code object, so that we do not risk | 2432 // Allocate ByteArray before the Code object, so that we do not risk |
2433 // leaving uninitialized Code object (and breaking the heap). | 2433 // leaving uninitialized Code object (and breaking the heap). |
2434 Object* reloc_info = AllocateByteArray(desc.reloc_size, TENURED); | 2434 Object* reloc_info = AllocateByteArray(desc.reloc_size, TENURED); |
2435 if (reloc_info->IsFailure()) return reloc_info; | 2435 if (reloc_info->IsFailure()) return reloc_info; |
2436 | 2436 |
2437 // Compute size | 2437 // Compute size |
2438 int body_size = RoundUp(desc.instr_size, kObjectAlignment); | 2438 int body_size = RoundUp(desc.instr_size, kObjectAlignment); |
2439 int obj_size = Code::SizeFor(body_size); | 2439 int obj_size = Code::SizeFor(body_size); |
2440 ASSERT(IsAligned(obj_size, Code::kCodeAlignment)); | 2440 ASSERT(IsAligned(static_cast<intptr_t>(obj_size), kCodeAlignment)); |
2441 Object* result; | 2441 Object* result; |
2442 if (obj_size > MaxObjectSizeInPagedSpace()) { | 2442 if (obj_size > MaxObjectSizeInPagedSpace()) { |
2443 result = lo_space_->AllocateRawCode(obj_size); | 2443 result = lo_space_->AllocateRawCode(obj_size); |
2444 } else { | 2444 } else { |
2445 result = code_space_->AllocateRaw(obj_size); | 2445 result = code_space_->AllocateRaw(obj_size); |
2446 } | 2446 } |
2447 | 2447 |
2448 if (result->IsFailure()) return result; | 2448 if (result->IsFailure()) return result; |
2449 | 2449 |
2450 // Initialize the object | 2450 // Initialize the object |
(...skipping 2518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4969 void ExternalStringTable::TearDown() { | 4969 void ExternalStringTable::TearDown() { |
4970 new_space_strings_.Free(); | 4970 new_space_strings_.Free(); |
4971 old_space_strings_.Free(); | 4971 old_space_strings_.Free(); |
4972 } | 4972 } |
4973 | 4973 |
4974 | 4974 |
4975 List<Object*> ExternalStringTable::new_space_strings_; | 4975 List<Object*> ExternalStringTable::new_space_strings_; |
4976 List<Object*> ExternalStringTable::old_space_strings_; | 4976 List<Object*> ExternalStringTable::old_space_strings_; |
4977 | 4977 |
4978 } } // namespace v8::internal | 4978 } } // namespace v8::internal |
OLD | NEW |