| 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 3910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3921 MaybeObject* Heap::AllocateFunctionContext(int length, JSFunction* function) { | 3921 MaybeObject* Heap::AllocateFunctionContext(int length, JSFunction* function) { |
| 3922 ASSERT(length >= Context::MIN_CONTEXT_SLOTS); | 3922 ASSERT(length >= Context::MIN_CONTEXT_SLOTS); |
| 3923 Object* result; | 3923 Object* result; |
| 3924 { MaybeObject* maybe_result = AllocateFixedArray(length); | 3924 { MaybeObject* maybe_result = AllocateFixedArray(length); |
| 3925 if (!maybe_result->ToObject(&result)) return maybe_result; | 3925 if (!maybe_result->ToObject(&result)) return maybe_result; |
| 3926 } | 3926 } |
| 3927 Context* context = reinterpret_cast<Context*>(result); | 3927 Context* context = reinterpret_cast<Context*>(result); |
| 3928 context->set_map(function_context_map()); | 3928 context->set_map(function_context_map()); |
| 3929 context->set_closure(function); | 3929 context->set_closure(function); |
| 3930 context->set_fcontext(context); | 3930 context->set_fcontext(context); |
| 3931 context->set_previous(NULL); | 3931 context->set_previous(function->context()); |
| 3932 context->set_extension(NULL); | 3932 context->set_extension(NULL); |
| 3933 context->set_global(function->context()->global()); | 3933 context->set_global(function->context()->global()); |
| 3934 return context; | 3934 return context; |
| 3935 } | 3935 } |
| 3936 | 3936 |
| 3937 | 3937 |
| 3938 MaybeObject* Heap::AllocateCatchContext(Context* previous, | 3938 MaybeObject* Heap::AllocateCatchContext(Context* previous, |
| 3939 JSObject* extension) { | 3939 JSObject* extension) { |
| 3940 Object* result; | 3940 Object* result; |
| 3941 { MaybeObject* maybe_result = AllocateFixedArray(Context::MIN_CONTEXT_SLOTS); | 3941 { MaybeObject* maybe_result = AllocateFixedArray(Context::MIN_CONTEXT_SLOTS); |
| (...skipping 2089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6031 } | 6031 } |
| 6032 | 6032 |
| 6033 | 6033 |
| 6034 void ExternalStringTable::TearDown() { | 6034 void ExternalStringTable::TearDown() { |
| 6035 new_space_strings_.Free(); | 6035 new_space_strings_.Free(); |
| 6036 old_space_strings_.Free(); | 6036 old_space_strings_.Free(); |
| 6037 } | 6037 } |
| 6038 | 6038 |
| 6039 | 6039 |
| 6040 } } // namespace v8::internal | 6040 } } // namespace v8::internal |
| OLD | NEW |