| 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 3914 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3925 | 3925 | 
| 3926 MaybeObject* Heap::AllocateFunctionContext(int length, JSFunction* function) { | 3926 MaybeObject* Heap::AllocateFunctionContext(int length, JSFunction* function) { | 
| 3927   ASSERT(length >= Context::MIN_CONTEXT_SLOTS); | 3927   ASSERT(length >= Context::MIN_CONTEXT_SLOTS); | 
| 3928   Object* result; | 3928   Object* result; | 
| 3929   { MaybeObject* maybe_result = AllocateFixedArray(length); | 3929   { MaybeObject* maybe_result = AllocateFixedArray(length); | 
| 3930     if (!maybe_result->ToObject(&result)) return maybe_result; | 3930     if (!maybe_result->ToObject(&result)) return maybe_result; | 
| 3931   } | 3931   } | 
| 3932   Context* context = reinterpret_cast<Context*>(result); | 3932   Context* context = reinterpret_cast<Context*>(result); | 
| 3933   context->set_map(function_context_map()); | 3933   context->set_map(function_context_map()); | 
| 3934   context->set_closure(function); | 3934   context->set_closure(function); | 
| 3935   context->set_fcontext(context); |  | 
| 3936   context->set_previous(function->context()); | 3935   context->set_previous(function->context()); | 
| 3937   context->set_extension(NULL); | 3936   context->set_extension(NULL); | 
| 3938   context->set_global(function->context()->global()); | 3937   context->set_global(function->context()->global()); | 
| 3939   return context; | 3938   return context; | 
| 3940 } | 3939 } | 
| 3941 | 3940 | 
| 3942 | 3941 | 
| 3943 MaybeObject* Heap::AllocateCatchContext(Context* previous, | 3942 MaybeObject* Heap::AllocateCatchContext(Context* previous, | 
| 3944                                         String* name, | 3943                                         String* name, | 
| 3945                                         Object* thrown_object) { | 3944                                         Object* thrown_object) { | 
| 3946   STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == Context::THROWN_OBJECT_INDEX); | 3945   STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == Context::THROWN_OBJECT_INDEX); | 
| 3947   Object* result; | 3946   Object* result; | 
| 3948   { MaybeObject* maybe_result = | 3947   { MaybeObject* maybe_result = | 
| 3949         AllocateFixedArray(Context::MIN_CONTEXT_SLOTS + 1); | 3948         AllocateFixedArray(Context::MIN_CONTEXT_SLOTS + 1); | 
| 3950     if (!maybe_result->ToObject(&result)) return maybe_result; | 3949     if (!maybe_result->ToObject(&result)) return maybe_result; | 
| 3951   } | 3950   } | 
| 3952   Context* context = reinterpret_cast<Context*>(result); | 3951   Context* context = reinterpret_cast<Context*>(result); | 
| 3953   context->set_map(catch_context_map()); | 3952   context->set_map(catch_context_map()); | 
| 3954   context->set_closure(previous->closure()); | 3953   context->set_closure(previous->closure()); | 
| 3955   context->set_fcontext(previous->fcontext()); |  | 
| 3956   context->set_previous(previous); | 3954   context->set_previous(previous); | 
| 3957   context->set_extension(name); | 3955   context->set_extension(name); | 
| 3958   context->set_global(previous->global()); | 3956   context->set_global(previous->global()); | 
| 3959   context->set(Context::THROWN_OBJECT_INDEX, thrown_object); | 3957   context->set(Context::THROWN_OBJECT_INDEX, thrown_object); | 
| 3960   return context; | 3958   return context; | 
| 3961 } | 3959 } | 
| 3962 | 3960 | 
| 3963 | 3961 | 
| 3964 MaybeObject* Heap::AllocateWithContext(Context* previous, | 3962 MaybeObject* Heap::AllocateWithContext(Context* previous, | 
| 3965                                        JSObject* extension) { | 3963                                        JSObject* extension) { | 
| 3966   Object* result; | 3964   Object* result; | 
| 3967   { MaybeObject* maybe_result = AllocateFixedArray(Context::MIN_CONTEXT_SLOTS); | 3965   { MaybeObject* maybe_result = AllocateFixedArray(Context::MIN_CONTEXT_SLOTS); | 
| 3968     if (!maybe_result->ToObject(&result)) return maybe_result; | 3966     if (!maybe_result->ToObject(&result)) return maybe_result; | 
| 3969   } | 3967   } | 
| 3970   Context* context = reinterpret_cast<Context*>(result); | 3968   Context* context = reinterpret_cast<Context*>(result); | 
| 3971   context->set_map(with_context_map()); | 3969   context->set_map(with_context_map()); | 
| 3972   context->set_closure(previous->closure()); | 3970   context->set_closure(previous->closure()); | 
| 3973   context->set_fcontext(previous->fcontext()); |  | 
| 3974   context->set_previous(previous); | 3971   context->set_previous(previous); | 
| 3975   context->set_extension(extension); | 3972   context->set_extension(extension); | 
| 3976   context->set_global(previous->global()); | 3973   context->set_global(previous->global()); | 
| 3977   return context; | 3974   return context; | 
| 3978 } | 3975 } | 
| 3979 | 3976 | 
| 3980 | 3977 | 
| 3981 MaybeObject* Heap::AllocateStruct(InstanceType type) { | 3978 MaybeObject* Heap::AllocateStruct(InstanceType type) { | 
| 3982   Map* map; | 3979   Map* map; | 
| 3983   switch (type) { | 3980   switch (type) { | 
| (...skipping 2051 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 6035 } | 6032 } | 
| 6036 | 6033 | 
| 6037 | 6034 | 
| 6038 void ExternalStringTable::TearDown() { | 6035 void ExternalStringTable::TearDown() { | 
| 6039   new_space_strings_.Free(); | 6036   new_space_strings_.Free(); | 
| 6040   old_space_strings_.Free(); | 6037   old_space_strings_.Free(); | 
| 6041 } | 6038 } | 
| 6042 | 6039 | 
| 6043 | 6040 | 
| 6044 } }  // namespace v8::internal | 6041 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|