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

Side by Side Diff: src/compiler/ia32/code-generator-ia32.cc

Issue 717093002: Perform receiver patching for sloppy mode in high-level IR. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Minor fix. Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/compiler/code-generator-impl.h" 7 #include "src/compiler/code-generator-impl.h"
8 #include "src/compiler/gap-resolver.h" 8 #include "src/compiler/gap-resolver.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/node-properties-inl.h" 10 #include "src/compiler/node-properties-inl.h"
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 __ push(Register::from_code(i)); 811 __ push(Register::from_code(i));
812 register_save_area_size += kPointerSize; 812 register_save_area_size += kPointerSize;
813 } 813 }
814 frame->SetRegisterSaveAreaSize(register_save_area_size); 814 frame->SetRegisterSaveAreaSize(register_save_area_size);
815 } 815 }
816 } else if (descriptor->IsJSFunctionCall()) { 816 } else if (descriptor->IsJSFunctionCall()) {
817 CompilationInfo* info = this->info(); 817 CompilationInfo* info = this->info();
818 __ Prologue(info->IsCodePreAgingActive()); 818 __ Prologue(info->IsCodePreAgingActive());
819 frame->SetRegisterSaveAreaSize( 819 frame->SetRegisterSaveAreaSize(
820 StandardFrameConstants::kFixedFrameSizeFromFp); 820 StandardFrameConstants::kFixedFrameSizeFromFp);
821
822 // Sloppy mode functions and builtins need to replace the receiver with the
823 // global proxy when called as functions (without an explicit receiver
824 // object).
825 // TODO(mstarzinger/verwaest): Should this be moved back into the CallIC?
826 if (info->strict_mode() == SLOPPY && !info->is_native()) {
827 Label ok;
828 // +2 for return address and saved frame pointer.
829 int receiver_slot = info->scope()->num_parameters() + 2;
830 __ mov(ecx, Operand(ebp, receiver_slot * kPointerSize));
831 __ cmp(ecx, isolate()->factory()->undefined_value());
832 __ j(not_equal, &ok, Label::kNear);
833 __ mov(ecx, GlobalObjectOperand());
834 __ mov(ecx, FieldOperand(ecx, GlobalObject::kGlobalProxyOffset));
835 __ mov(Operand(ebp, receiver_slot * kPointerSize), ecx);
836 __ bind(&ok);
837 }
838
839 } else { 821 } else {
840 __ StubPrologue(); 822 __ StubPrologue();
841 frame->SetRegisterSaveAreaSize( 823 frame->SetRegisterSaveAreaSize(
842 StandardFrameConstants::kFixedFrameSizeFromFp); 824 StandardFrameConstants::kFixedFrameSizeFromFp);
843 } 825 }
844 if (stack_slots > 0) { 826 if (stack_slots > 0) {
845 __ sub(esp, Immediate(stack_slots * kPointerSize)); 827 __ sub(esp, Immediate(stack_slots * kPointerSize));
846 } 828 }
847 } 829 }
848 830
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 } 1036 }
1055 } 1037 }
1056 MarkLazyDeoptSite(); 1038 MarkLazyDeoptSite();
1057 } 1039 }
1058 1040
1059 #undef __ 1041 #undef __
1060 1042
1061 } // namespace compiler 1043 } // namespace compiler
1062 } // namespace internal 1044 } // namespace internal
1063 } // namespace v8 1045 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698