Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: src/heap.cc

Issue 7134042: Link function contexts directly to the previous context. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Avoid calling previous on the global context. Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/contexts.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/contexts.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698