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

Side by Side Diff: src/heap.cc

Issue 7152002: Change the representation of catch contexts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
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 3918 matching lines...) Expand 10 before | Expand all | Expand 10 after
3929 context->set_closure(function); 3929 context->set_closure(function);
3930 context->set_fcontext(context); 3930 context->set_fcontext(context);
3931 context->set_previous(function->context()); 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 String* name,
3940 Object* thrown_object) {
3941 STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == Context::THROWN_OBJECT_INDEX);
3940 Object* result; 3942 Object* result;
3941 { MaybeObject* maybe_result = AllocateFixedArray(Context::MIN_CONTEXT_SLOTS); 3943 { MaybeObject* maybe_result =
3944 AllocateFixedArray(Context::MIN_CONTEXT_SLOTS + 1);
3942 if (!maybe_result->ToObject(&result)) return maybe_result; 3945 if (!maybe_result->ToObject(&result)) return maybe_result;
3943 } 3946 }
3944 Context* context = reinterpret_cast<Context*>(result); 3947 Context* context = reinterpret_cast<Context*>(result);
3945 context->set_map(catch_context_map()); 3948 context->set_map(catch_context_map());
3946 context->set_closure(previous->closure()); 3949 context->set_closure(previous->closure());
3947 context->set_fcontext(previous->fcontext()); 3950 context->set_fcontext(previous->fcontext());
3948 context->set_previous(previous); 3951 context->set_previous(previous);
3949 context->set_extension(extension); 3952 context->set_extension(name);
3950 context->set_global(previous->global()); 3953 context->set_global(previous->global());
3954 context->set(Context::THROWN_OBJECT_INDEX, thrown_object);
3951 return context; 3955 return context;
3952 } 3956 }
3953 3957
3954 3958
3955 MaybeObject* Heap::AllocateWithContext(Context* previous, 3959 MaybeObject* Heap::AllocateWithContext(Context* previous,
3956 JSObject* extension) { 3960 JSObject* extension) {
3957 Object* result; 3961 Object* result;
3958 { MaybeObject* maybe_result = AllocateFixedArray(Context::MIN_CONTEXT_SLOTS); 3962 { MaybeObject* maybe_result = AllocateFixedArray(Context::MIN_CONTEXT_SLOTS);
3959 if (!maybe_result->ToObject(&result)) return maybe_result; 3963 if (!maybe_result->ToObject(&result)) return maybe_result;
3960 } 3964 }
(...skipping 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after
6031 } 6035 }
6032 6036
6033 6037
6034 void ExternalStringTable::TearDown() { 6038 void ExternalStringTable::TearDown() {
6035 new_space_strings_.Free(); 6039 new_space_strings_.Free();
6036 old_space_strings_.Free(); 6040 old_space_strings_.Free();
6037 } 6041 }
6038 6042
6039 6043
6040 } } // namespace v8::internal 6044 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698