Commit 2cdddbf8 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

MIPS: port Link function contexts directly to the previous context.

Ported r8238 (7803ed7)

This commit would have also included changes to macro-assembler-mips.cc,
however Kevin M. did those changes in later commit r8248. (thx!)

BUG=
TEST=

Review URL: http://codereview.chromium.org//6995128
Patch from Paul Lind <plind44@gmail.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8249 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 9ecfdb34
...@@ -158,7 +158,7 @@ void FastNewContextStub::Generate(MacroAssembler* masm) { ...@@ -158,7 +158,7 @@ void FastNewContextStub::Generate(MacroAssembler* masm) {
__ lw(a3, MemOperand(sp, 0)); __ lw(a3, MemOperand(sp, 0));
// Setup the object header. // Setup the object header.
__ LoadRoot(a2, Heap::kContextMapRootIndex); __ LoadRoot(a2, Heap::kFunctionContextMapRootIndex);
__ sw(a2, FieldMemOperand(v0, HeapObject::kMapOffset)); __ sw(a2, FieldMemOperand(v0, HeapObject::kMapOffset));
__ li(a2, Operand(Smi::FromInt(length))); __ li(a2, Operand(Smi::FromInt(length)));
__ sw(a2, FieldMemOperand(v0, FixedArray::kLengthOffset)); __ sw(a2, FieldMemOperand(v0, FixedArray::kLengthOffset));
...@@ -187,7 +187,7 @@ void FastNewContextStub::Generate(MacroAssembler* masm) { ...@@ -187,7 +187,7 @@ void FastNewContextStub::Generate(MacroAssembler* masm) {
// Need to collect. Call into runtime system. // Need to collect. Call into runtime system.
__ bind(&gc); __ bind(&gc);
__ TailCallRuntime(Runtime::kNewContext, 1, 1); __ TailCallRuntime(Runtime::kNewFunctionContext, 1, 1);
} }
......
...@@ -189,7 +189,7 @@ void FullCodeGenerator::Generate(CompilationInfo* info) { ...@@ -189,7 +189,7 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
FastNewContextStub stub(heap_slots); FastNewContextStub stub(heap_slots);
__ CallStub(&stub); __ CallStub(&stub);
} else { } else {
__ CallRuntime(Runtime::kNewContext, 1); __ CallRuntime(Runtime::kNewFunctionContext, 1);
} }
function_in_register = false; function_in_register = false;
// Context is returned in both v0 and cp. It replaces the context // Context is returned in both v0 and cp. It replaces the context
......
...@@ -890,7 +890,7 @@ MaybeObject* Object::GetProperty(String* key, PropertyAttributes* attributes) { ...@@ -890,7 +890,7 @@ MaybeObject* Object::GetProperty(String* key, PropertyAttributes* attributes) {
#else // V8_TARGET_ARCH_MIPS #else // V8_TARGET_ARCH_MIPS
// Prevent gcc from using load-double (mips ldc1) on (possibly) // Prevent gcc from using load-double (mips ldc1) on (possibly)
// non-64-bit aligned HeapNumber::value. // non-64-bit aligned HeapNumber::value.
static inline double read_double_field(HeapNumber* p, int offset) { static inline double read_double_field(void* p, int offset) {
union conversion { union conversion {
double d; double d;
uint32_t u[2]; uint32_t u[2];
...@@ -909,7 +909,7 @@ MaybeObject* Object::GetProperty(String* key, PropertyAttributes* attributes) { ...@@ -909,7 +909,7 @@ MaybeObject* Object::GetProperty(String* key, PropertyAttributes* attributes) {
#else // V8_TARGET_ARCH_MIPS #else // V8_TARGET_ARCH_MIPS
// Prevent gcc from using store-double (mips sdc1) on (possibly) // Prevent gcc from using store-double (mips sdc1) on (possibly)
// non-64-bit aligned HeapNumber::value. // non-64-bit aligned HeapNumber::value.
static inline void write_double_field(HeapNumber* p, int offset, static inline void write_double_field(void* p, int offset,
double value) { double value) {
union conversion { union conversion {
double d; double d;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment