Revision: 3510
Author: [email protected]
Date: Mon Dec 21 07:20:30 2009
Log: Merge r3505 and r3509 to trunk.
Review URL: http://codereview.chromium.org/505062
http://code.google.com/p/v8/source/detail?r=3510
Modified:
/trunk/src/contexts.cc
/trunk/src/execution.cc
/trunk/src/ia32/codegen-ia32.cc
/trunk/src/ia32/macro-assembler-ia32.cc
/trunk/src/version.cc
=======================================
--- /trunk/src/contexts.cc Tue Jun 23 00:57:28 2009
+++ /trunk/src/contexts.cc Mon Dec 21 07:20:30 2009
@@ -52,11 +52,14 @@
if (global()->IsGlobalObject()) {
return global()->global_context();
}
+
// During bootstrapping, the global object might not be set and we
// have to search the context chain to find the global context.
+ ASSERT(Bootstrapper::IsActive());
Context* current = this;
while (!current->IsGlobalContext()) {
- current =
Context::cast(JSFunction::cast(current->closure())->context());
+ JSFunction* closure = JSFunction::cast(current->closure());
+ current = Context::cast(closure->context());
}
return current;
}
=======================================
--- /trunk/src/execution.cc Wed Dec 16 07:36:05 2009
+++ /trunk/src/execution.cc Mon Dec 21 07:20:30 2009
@@ -78,6 +78,10 @@
Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver);
receiver = Handle<JSObject>(global->global_receiver());
}
+
+ // Make sure that the global object of the context we're about to
+ // make the current one is indeed a global object.
+ ASSERT(func->context()->global()->IsGlobalObject());
{
// Save and restore context around invocation and block the
=======================================
--- /trunk/src/ia32/codegen-ia32.cc Fri Dec 18 00:56:33 2009
+++ /trunk/src/ia32/codegen-ia32.cc Mon Dec 21 07:20:30 2009
@@ -174,7 +174,7 @@
function_return_is_shadowed_ = false;
// Allocate the local context if needed.
- int heap_slots = scope_->num_heap_slots();
+ int heap_slots = scope_->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
if (heap_slots > 0) {
Comment cmnt(masm_, "[ allocate local context");
// Allocate local context.
@@ -6741,8 +6741,11 @@
__ mov(Operand(eax, Context::SlotOffset(Context::PREVIOUS_INDEX)), ebx);
__ mov(Operand(eax, Context::SlotOffset(Context::EXTENSION_INDEX)), ebx);
- // Copy the global object from the surrounding context.
- __ mov(ebx, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX)));
+ // Copy the global object from the surrounding context. We go through the
+ // context in the function (ecx) to match the allocation behavior we have
+ // in the runtime system (see Heap::AllocateFunctionContext).
+ __ mov(ebx, FieldOperand(ecx, JSFunction::kContextOffset));
+ __ mov(ebx, Operand(ebx, Context::SlotOffset(Context::GLOBAL_INDEX)));
__ mov(Operand(eax, Context::SlotOffset(Context::GLOBAL_INDEX)), ebx);
// Initialize the rest of the slots to undefined.
=======================================
--- /trunk/src/ia32/macro-assembler-ia32.cc Sun Dec 20 10:15:52 2009
+++ /trunk/src/ia32/macro-assembler-ia32.cc Mon Dec 21 07:20:30 2009
@@ -1369,7 +1369,6 @@
JSBuiltinsObject::kJSBuiltinsOffset + (id * kPointerSize);
mov(edi, FieldOperand(edx, builtins_offset));
-
return Builtins::GetCode(id, resolved);
}
=======================================
--- /trunk/src/version.cc Sun Dec 20 10:15:52 2009
+++ /trunk/src/version.cc Mon Dec 21 07:20:30 2009
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 2
#define MINOR_VERSION 0
#define BUILD_NUMBER 5
-#define PATCH_LEVEL 1
+#define PATCH_LEVEL 2
#define CANDIDATE_VERSION false
// Define SONAME to have the SCons build the put a specific SONAME into the
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev