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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 94136734f16ae23b8191de63adc32efa9f11e7bf..a5f512d8bddb00b49f86621d58e15f870a1f82cc 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -3936,9 +3936,12 @@ MaybeObject* Heap::AllocateFunctionContext(int length, JSFunction* function) {
MaybeObject* Heap::AllocateCatchContext(Context* previous,
- JSObject* extension) {
+ String* name,
+ Object* thrown_object) {
+ STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == Context::THROWN_OBJECT_INDEX);
Object* result;
- { MaybeObject* maybe_result = AllocateFixedArray(Context::MIN_CONTEXT_SLOTS);
+ { MaybeObject* maybe_result =
+ AllocateFixedArray(Context::MIN_CONTEXT_SLOTS + 1);
if (!maybe_result->ToObject(&result)) return maybe_result;
}
Context* context = reinterpret_cast<Context*>(result);
@@ -3946,8 +3949,9 @@ MaybeObject* Heap::AllocateCatchContext(Context* previous,
context->set_closure(previous->closure());
context->set_fcontext(previous->fcontext());
context->set_previous(previous);
- context->set_extension(extension);
+ context->set_extension(name);
context->set_global(previous->global());
+ context->set(Context::THROWN_OBJECT_INDEX, thrown_object);
return context;
}

Powered by Google App Engine
This is Rietveld 408576698