MIPS: Clean up the global object naming madness.

Port r22117 (e9244d6)

BUG=
R=palfia@homejinni.com

Review URL: https://codereview.chromium.org/364863002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22170 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f353ff66
...@@ -1092,7 +1092,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) { ...@@ -1092,7 +1092,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
// a1: function // a1: function
Label shift_arguments; Label shift_arguments;
__ li(t0, Operand(0, RelocInfo::NONE32)); // Indicate regular JS_FUNCTION. __ li(t0, Operand(0, RelocInfo::NONE32)); // Indicate regular JS_FUNCTION.
{ Label convert_to_object, use_global_receiver, patch_receiver; { Label convert_to_object, use_global_proxy, patch_receiver;
// Change context eagerly in case we need the global receiver. // Change context eagerly in case we need the global receiver.
__ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); __ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset));
...@@ -1118,9 +1118,9 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) { ...@@ -1118,9 +1118,9 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
__ JumpIfSmi(a2, &convert_to_object, t2); __ JumpIfSmi(a2, &convert_to_object, t2);
__ LoadRoot(a3, Heap::kUndefinedValueRootIndex); __ LoadRoot(a3, Heap::kUndefinedValueRootIndex);
__ Branch(&use_global_receiver, eq, a2, Operand(a3)); __ Branch(&use_global_proxy, eq, a2, Operand(a3));
__ LoadRoot(a3, Heap::kNullValueRootIndex); __ LoadRoot(a3, Heap::kNullValueRootIndex);
__ Branch(&use_global_receiver, eq, a2, Operand(a3)); __ Branch(&use_global_proxy, eq, a2, Operand(a3));
STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
__ GetObjectType(a2, a3, a3); __ GetObjectType(a2, a3, a3);
...@@ -1139,16 +1139,17 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) { ...@@ -1139,16 +1139,17 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
__ sra(a0, a0, kSmiTagSize); // Un-tag. __ sra(a0, a0, kSmiTagSize); // Un-tag.
// Leave internal frame. // Leave internal frame.
} }
// Restore the function to a1, and the flag to t0. // Restore the function to a1, and the flag to t0.
__ sll(at, a0, kPointerSizeLog2); __ sll(at, a0, kPointerSizeLog2);
__ addu(at, sp, at); __ addu(at, sp, at);
__ lw(a1, MemOperand(at)); __ lw(a1, MemOperand(at));
__ li(t0, Operand(0, RelocInfo::NONE32)); __ Branch(USE_DELAY_SLOT, &patch_receiver);
__ Branch(&patch_receiver); __ li(t0, Operand(0, RelocInfo::NONE32)); // In delay slot.
__ bind(&use_global_receiver); __ bind(&use_global_proxy);
__ lw(a2, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); __ lw(a2, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
__ lw(a2, FieldMemOperand(a2, GlobalObject::kGlobalReceiverOffset)); __ lw(a2, FieldMemOperand(a2, GlobalObject::kGlobalProxyOffset));
__ bind(&patch_receiver); __ bind(&patch_receiver);
__ sll(at, a0, kPointerSizeLog2); __ sll(at, a0, kPointerSizeLog2);
...@@ -1300,7 +1301,7 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) { ...@@ -1300,7 +1301,7 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
// Compute the receiver. // Compute the receiver.
// Do not transform the receiver for strict mode functions. // Do not transform the receiver for strict mode functions.
Label call_to_object, use_global_receiver; Label call_to_object, use_global_proxy;
__ lw(a2, FieldMemOperand(a2, SharedFunctionInfo::kCompilerHintsOffset)); __ lw(a2, FieldMemOperand(a2, SharedFunctionInfo::kCompilerHintsOffset));
__ And(t3, a2, Operand(1 << (SharedFunctionInfo::kStrictModeFunction + __ And(t3, a2, Operand(1 << (SharedFunctionInfo::kStrictModeFunction +
kSmiTagSize))); kSmiTagSize)));
...@@ -1313,9 +1314,9 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) { ...@@ -1313,9 +1314,9 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
// Compute the receiver in sloppy mode. // Compute the receiver in sloppy mode.
__ JumpIfSmi(a0, &call_to_object); __ JumpIfSmi(a0, &call_to_object);
__ LoadRoot(a1, Heap::kNullValueRootIndex); __ LoadRoot(a1, Heap::kNullValueRootIndex);
__ Branch(&use_global_receiver, eq, a0, Operand(a1)); __ Branch(&use_global_proxy, eq, a0, Operand(a1));
__ LoadRoot(a2, Heap::kUndefinedValueRootIndex); __ LoadRoot(a2, Heap::kUndefinedValueRootIndex);
__ Branch(&use_global_receiver, eq, a0, Operand(a2)); __ Branch(&use_global_proxy, eq, a0, Operand(a2));
// Check if the receiver is already a JavaScript object. // Check if the receiver is already a JavaScript object.
// a0: receiver // a0: receiver
...@@ -1331,9 +1332,9 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) { ...@@ -1331,9 +1332,9 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
__ mov(a0, v0); // Put object in a0 to match other paths to push_receiver. __ mov(a0, v0); // Put object in a0 to match other paths to push_receiver.
__ Branch(&push_receiver); __ Branch(&push_receiver);
__ bind(&use_global_receiver); __ bind(&use_global_proxy);
__ lw(a0, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); __ lw(a0, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
__ lw(a0, FieldMemOperand(a0, GlobalObject::kGlobalReceiverOffset)); __ lw(a0, FieldMemOperand(a0, GlobalObject::kGlobalProxyOffset));
// Push the receiver. // Push the receiver.
// a0: receiver // a0: receiver
......
...@@ -141,7 +141,7 @@ void FullCodeGenerator::Generate() { ...@@ -141,7 +141,7 @@ void FullCodeGenerator::Generate() {
__ Branch(&ok, ne, a2, Operand(at)); __ Branch(&ok, ne, a2, Operand(at));
__ lw(a2, GlobalObjectOperand()); __ lw(a2, GlobalObjectOperand());
__ lw(a2, FieldMemOperand(a2, GlobalObject::kGlobalReceiverOffset)); __ lw(a2, FieldMemOperand(a2, GlobalObject::kGlobalProxyOffset));
__ sw(a2, MemOperand(sp, receiver_offset)); __ sw(a2, MemOperand(sp, receiver_offset));
......
...@@ -152,7 +152,7 @@ bool LCodeGen::GeneratePrologue() { ...@@ -152,7 +152,7 @@ bool LCodeGen::GeneratePrologue() {
__ Branch(&ok, ne, a2, Operand(at)); __ Branch(&ok, ne, a2, Operand(at));
__ lw(a2, GlobalObjectOperand()); __ lw(a2, GlobalObjectOperand());
__ lw(a2, FieldMemOperand(a2, GlobalObject::kGlobalReceiverOffset)); __ lw(a2, FieldMemOperand(a2, GlobalObject::kGlobalProxyOffset));
__ sw(a2, MemOperand(sp, receiver_offset)); __ sw(a2, MemOperand(sp, receiver_offset));
...@@ -3425,7 +3425,7 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) { ...@@ -3425,7 +3425,7 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
__ lw(result, __ lw(result,
ContextOperand(result, Context::GLOBAL_OBJECT_INDEX)); ContextOperand(result, Context::GLOBAL_OBJECT_INDEX));
__ lw(result, __ lw(result,
FieldMemOperand(result, GlobalObject::kGlobalReceiverOffset)); FieldMemOperand(result, GlobalObject::kGlobalProxyOffset));
if (result.is(receiver)) { if (result.is(receiver)) {
__ bind(&result_in_receiver); __ bind(&result_in_receiver);
......
...@@ -1195,8 +1195,7 @@ void StoreStubCompiler::GenerateStoreViaSetter( ...@@ -1195,8 +1195,7 @@ void StoreStubCompiler::GenerateStoreViaSetter(
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver. // Swap in the global receiver.
__ lw(receiver, __ lw(receiver,
FieldMemOperand( FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver, JSGlobalObject::kGlobalReceiverOffset));
} }
__ Push(receiver, value()); __ Push(receiver, value());
ParameterCount actual(1); ParameterCount actual(1);
...@@ -1310,8 +1309,7 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, ...@@ -1310,8 +1309,7 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver. // Swap in the global receiver.
__ lw(receiver, __ lw(receiver,
FieldMemOperand( FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver, JSGlobalObject::kGlobalReceiverOffset));
} }
__ push(receiver); __ push(receiver);
ParameterCount actual(0); ParameterCount actual(0);
......
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