X87: Clean up the global object naming madness.

port r22117

original message:

  Clean up the global object naming madness.

BUG=
R=weiliang.lin@intel.com

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

Patch from Chunyang Dai <chunyang.dai@intel.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22140 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8fc4a8e1
......@@ -765,7 +765,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
// 3a. Patch the first argument if necessary when calling a function.
Label shift_arguments;
__ Move(edx, Immediate(0)); // 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.
__ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
......@@ -787,9 +787,9 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
// global object if it is null or undefined.
__ JumpIfSmi(ebx, &convert_to_object);
__ cmp(ebx, factory->null_value());
__ j(equal, &use_global_receiver);
__ j(equal, &use_global_proxy);
__ cmp(ebx, factory->undefined_value());
__ j(equal, &use_global_receiver);
__ j(equal, &use_global_proxy);
STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
__ CmpObjectType(ebx, FIRST_SPEC_OBJECT_TYPE, ecx);
__ j(above_equal, &shift_arguments);
......@@ -814,10 +814,10 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
__ mov(edi, Operand(esp, eax, times_4, 1 * kPointerSize));
__ jmp(&patch_receiver);
__ bind(&use_global_receiver);
__ bind(&use_global_proxy);
__ mov(ebx,
Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
__ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalReceiverOffset));
__ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalProxyOffset));
__ bind(&patch_receiver);
__ mov(Operand(esp, eax, times_4, 0), ebx);
......@@ -943,7 +943,7 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
__ mov(ebx, Operand(ebp, kReceiverOffset));
// Check that the function is a JS function (otherwise it must be a proxy).
Label push_receiver, use_global_receiver;
Label push_receiver, use_global_proxy;
__ mov(edi, Operand(ebp, kFunctionOffset));
__ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx);
__ j(not_equal, &push_receiver);
......@@ -971,9 +971,9 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
// global object if it is null or undefined.
__ JumpIfSmi(ebx, &call_to_object);
__ cmp(ebx, factory->null_value());
__ j(equal, &use_global_receiver);
__ j(equal, &use_global_proxy);
__ cmp(ebx, factory->undefined_value());
__ j(equal, &use_global_receiver);
__ j(equal, &use_global_proxy);
STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
__ CmpObjectType(ebx, FIRST_SPEC_OBJECT_TYPE, ecx);
__ j(above_equal, &push_receiver);
......@@ -984,10 +984,10 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
__ mov(ebx, eax);
__ jmp(&push_receiver);
__ bind(&use_global_receiver);
__ bind(&use_global_proxy);
__ mov(ebx,
Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
__ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalReceiverOffset));
__ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalProxyOffset));
// Push the receiver.
__ bind(&push_receiver);
......
......@@ -123,7 +123,7 @@ void FullCodeGenerator::Generate() {
__ j(not_equal, &ok, Label::kNear);
__ mov(ecx, GlobalObjectOperand());
__ mov(ecx, FieldOperand(ecx, GlobalObject::kGlobalReceiverOffset));
__ mov(ecx, FieldOperand(ecx, GlobalObject::kGlobalProxyOffset));
__ mov(Operand(esp, receiver_offset), ecx);
......
......@@ -120,7 +120,7 @@ bool LCodeGen::GeneratePrologue() {
__ j(not_equal, &ok, Label::kNear);
__ mov(ecx, GlobalObjectOperand());
__ mov(ecx, FieldOperand(ecx, GlobalObject::kGlobalReceiverOffset));
__ mov(ecx, FieldOperand(ecx, GlobalObject::kGlobalProxyOffset));
__ mov(Operand(esp, receiver_offset), ecx);
......@@ -3439,8 +3439,8 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
__ mov(receiver, FieldOperand(function, JSFunction::kContextOffset));
const int global_offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX);
__ mov(receiver, Operand(receiver, global_offset));
const int receiver_offset = GlobalObject::kGlobalReceiverOffset;
__ mov(receiver, FieldOperand(receiver, receiver_offset));
const int proxy_offset = GlobalObject::kGlobalProxyOffset;
__ mov(receiver, FieldOperand(receiver, proxy_offset));
__ bind(&receiver_ok);
}
......
......@@ -1176,7 +1176,7 @@ void StoreStubCompiler::GenerateStoreViaSetter(
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver.
__ mov(receiver,
FieldOperand(receiver, JSGlobalObject::kGlobalReceiverOffset));
FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
}
__ push(receiver);
__ push(value());
......@@ -1333,7 +1333,7 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver.
__ mov(receiver,
FieldOperand(receiver, JSGlobalObject::kGlobalReceiverOffset));
FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
}
__ push(receiver);
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