| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 4016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4027 context->set_global(previous->global()); | 4027 context->set_global(previous->global()); |
| 4028 return context; | 4028 return context; |
| 4029 } | 4029 } |
| 4030 | 4030 |
| 4031 | 4031 |
| 4032 MaybeObject* Heap::AllocateBlockContext(JSFunction* function, | 4032 MaybeObject* Heap::AllocateBlockContext(JSFunction* function, |
| 4033 Context* previous, | 4033 Context* previous, |
| 4034 SerializedScopeInfo* scope_info) { | 4034 SerializedScopeInfo* scope_info) { |
| 4035 Object* result; | 4035 Object* result; |
| 4036 { MaybeObject* maybe_result = | 4036 { MaybeObject* maybe_result = |
| 4037 AllocateFixedArray(scope_info->NumberOfContextSlots()); | 4037 AllocateFixedArrayWithHoles(scope_info->NumberOfContextSlots()); |
| 4038 if (!maybe_result->ToObject(&result)) return maybe_result; | 4038 if (!maybe_result->ToObject(&result)) return maybe_result; |
| 4039 } | 4039 } |
| 4040 // TODO(keuchel): properly initialize context slots. | |
| 4041 Context* context = reinterpret_cast<Context*>(result); | 4040 Context* context = reinterpret_cast<Context*>(result); |
| 4042 context->set_map(block_context_map()); | 4041 context->set_map(block_context_map()); |
| 4043 context->set_closure(function); | 4042 context->set_closure(function); |
| 4044 context->set_previous(previous); | 4043 context->set_previous(previous); |
| 4045 context->set_extension(scope_info); | 4044 context->set_extension(scope_info); |
| 4046 context->set_global(previous->global()); | 4045 context->set_global(previous->global()); |
| 4047 return context; | 4046 return context; |
| 4048 } | 4047 } |
| 4049 | 4048 |
| 4050 | 4049 |
| (...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6096 } | 6095 } |
| 6097 | 6096 |
| 6098 | 6097 |
| 6099 void ExternalStringTable::TearDown() { | 6098 void ExternalStringTable::TearDown() { |
| 6100 new_space_strings_.Free(); | 6099 new_space_strings_.Free(); |
| 6101 old_space_strings_.Free(); | 6100 old_space_strings_.Free(); |
| 6102 } | 6101 } |
| 6103 | 6102 |
| 6104 | 6103 |
| 6105 } } // namespace v8::internal | 6104 } } // namespace v8::internal |
| OLD | NEW |