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 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1842 if (!maybe_obj->ToObject(&obj)) return false; | 1842 if (!maybe_obj->ToObject(&obj)) return false; |
1843 } | 1843 } |
1844 set_external_unsigned_int_array_map(Map::cast(obj)); | 1844 set_external_unsigned_int_array_map(Map::cast(obj)); |
1845 | 1845 |
1846 { MaybeObject* maybe_obj = AllocateMap(EXTERNAL_FLOAT_ARRAY_TYPE, | 1846 { MaybeObject* maybe_obj = AllocateMap(EXTERNAL_FLOAT_ARRAY_TYPE, |
1847 ExternalArray::kAlignedSize); | 1847 ExternalArray::kAlignedSize); |
1848 if (!maybe_obj->ToObject(&obj)) return false; | 1848 if (!maybe_obj->ToObject(&obj)) return false; |
1849 } | 1849 } |
1850 set_external_float_array_map(Map::cast(obj)); | 1850 set_external_float_array_map(Map::cast(obj)); |
1851 | 1851 |
| 1852 { MaybeObject* maybe_obj = |
| 1853 AllocateMap(FIXED_ARRAY_TYPE, kVariableSizeSentinel); |
| 1854 if (!maybe_obj->ToObject(&obj)) return false; |
| 1855 } |
| 1856 set_non_strict_arguments_elements_map(Map::cast(obj)); |
| 1857 |
1852 { MaybeObject* maybe_obj = AllocateMap(EXTERNAL_DOUBLE_ARRAY_TYPE, | 1858 { MaybeObject* maybe_obj = AllocateMap(EXTERNAL_DOUBLE_ARRAY_TYPE, |
1853 ExternalArray::kAlignedSize); | 1859 ExternalArray::kAlignedSize); |
1854 if (!maybe_obj->ToObject(&obj)) return false; | 1860 if (!maybe_obj->ToObject(&obj)) return false; |
1855 } | 1861 } |
1856 set_external_double_array_map(Map::cast(obj)); | 1862 set_external_double_array_map(Map::cast(obj)); |
1857 | 1863 |
1858 { MaybeObject* maybe_obj = AllocateMap(CODE_TYPE, kVariableSizeSentinel); | 1864 { MaybeObject* maybe_obj = AllocateMap(CODE_TYPE, kVariableSizeSentinel); |
1859 if (!maybe_obj->ToObject(&obj)) return false; | 1865 if (!maybe_obj->ToObject(&obj)) return false; |
1860 } | 1866 } |
1861 set_code_map(Map::cast(obj)); | 1867 set_code_map(Map::cast(obj)); |
(...skipping 2067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3929 context->set_closure(function); | 3935 context->set_closure(function); |
3930 context->set_fcontext(context); | 3936 context->set_fcontext(context); |
3931 context->set_previous(function->context()); | 3937 context->set_previous(function->context()); |
3932 context->set_extension(NULL); | 3938 context->set_extension(NULL); |
3933 context->set_global(function->context()->global()); | 3939 context->set_global(function->context()->global()); |
3934 return context; | 3940 return context; |
3935 } | 3941 } |
3936 | 3942 |
3937 | 3943 |
3938 MaybeObject* Heap::AllocateCatchContext(Context* previous, | 3944 MaybeObject* Heap::AllocateCatchContext(Context* previous, |
3939 String* name, | 3945 JSObject* extension) { |
3940 Object* thrown_object) { | |
3941 STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == Context::THROWN_OBJECT_INDEX); | |
3942 Object* result; | 3946 Object* result; |
3943 { MaybeObject* maybe_result = | 3947 { MaybeObject* maybe_result = AllocateFixedArray(Context::MIN_CONTEXT_SLOTS); |
3944 AllocateFixedArray(Context::MIN_CONTEXT_SLOTS + 1); | |
3945 if (!maybe_result->ToObject(&result)) return maybe_result; | 3948 if (!maybe_result->ToObject(&result)) return maybe_result; |
3946 } | 3949 } |
3947 Context* context = reinterpret_cast<Context*>(result); | 3950 Context* context = reinterpret_cast<Context*>(result); |
3948 context->set_map(catch_context_map()); | 3951 context->set_map(catch_context_map()); |
3949 context->set_closure(previous->closure()); | 3952 context->set_closure(previous->closure()); |
3950 context->set_fcontext(previous->fcontext()); | 3953 context->set_fcontext(previous->fcontext()); |
3951 context->set_previous(previous); | 3954 context->set_previous(previous); |
3952 context->set_extension(name); | 3955 context->set_extension(extension); |
3953 context->set_global(previous->global()); | 3956 context->set_global(previous->global()); |
3954 context->set(Context::THROWN_OBJECT_INDEX, thrown_object); | |
3955 return context; | 3957 return context; |
3956 } | 3958 } |
3957 | 3959 |
3958 | 3960 |
3959 MaybeObject* Heap::AllocateWithContext(Context* previous, | 3961 MaybeObject* Heap::AllocateWithContext(Context* previous, |
3960 JSObject* extension) { | 3962 JSObject* extension) { |
3961 Object* result; | 3963 Object* result; |
3962 { MaybeObject* maybe_result = AllocateFixedArray(Context::MIN_CONTEXT_SLOTS); | 3964 { MaybeObject* maybe_result = AllocateFixedArray(Context::MIN_CONTEXT_SLOTS); |
3963 if (!maybe_result->ToObject(&result)) return maybe_result; | 3965 if (!maybe_result->ToObject(&result)) return maybe_result; |
3964 } | 3966 } |
(...skipping 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6035 } | 6037 } |
6036 | 6038 |
6037 | 6039 |
6038 void ExternalStringTable::TearDown() { | 6040 void ExternalStringTable::TearDown() { |
6039 new_space_strings_.Free(); | 6041 new_space_strings_.Free(); |
6040 old_space_strings_.Free(); | 6042 old_space_strings_.Free(); |
6041 } | 6043 } |
6042 | 6044 |
6043 | 6045 |
6044 } } // namespace v8::internal | 6046 } } // namespace v8::internal |
OLD | NEW |