| OLD | NEW | 
|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/code-factory.h" | 5 #include "src/code-factory.h" | 
| 6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" | 
| 7 #include "src/cpu-profiler.h" | 7 #include "src/cpu-profiler.h" | 
| 8 #include "src/hydrogen-osr.h" | 8 #include "src/hydrogen-osr.h" | 
| 9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" | 
| 10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" | 
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 109 #endif | 109 #endif | 
| 110 | 110 | 
| 111     // a1: Callee's JS function. | 111     // a1: Callee's JS function. | 
| 112     // cp: Callee's context. | 112     // cp: Callee's context. | 
| 113     // fp: Caller's frame pointer. | 113     // fp: Caller's frame pointer. | 
| 114     // lr: Caller's pc. | 114     // lr: Caller's pc. | 
| 115 | 115 | 
| 116     // Sloppy mode functions and builtins need to replace the receiver with the | 116     // Sloppy mode functions and builtins need to replace the receiver with the | 
| 117     // global proxy when called as functions (without an explicit receiver | 117     // global proxy when called as functions (without an explicit receiver | 
| 118     // object). | 118     // object). | 
| 119     if (is_sloppy(info()->language_mode()) && info()->MayUseThis() && | 119     if (info()->MustReplaceUndefinedReceiverWithGlobalProxy()) { | 
| 120         !info()->is_native() && info()->scope()->has_this_declaration()) { |  | 
| 121       Label ok; | 120       Label ok; | 
| 122       int receiver_offset = info_->scope()->num_parameters() * kPointerSize; | 121       int receiver_offset = info_->scope()->num_parameters() * kPointerSize; | 
| 123       __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 122       __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 
| 124       __ ld(a2, MemOperand(sp, receiver_offset)); | 123       __ ld(a2, MemOperand(sp, receiver_offset)); | 
| 125       __ Branch(&ok, ne, a2, Operand(at)); | 124       __ Branch(&ok, ne, a2, Operand(at)); | 
| 126 | 125 | 
| 127       __ ld(a2, GlobalObjectOperand()); | 126       __ ld(a2, GlobalObjectOperand()); | 
| 128       __ ld(a2, FieldMemOperand(a2, GlobalObject::kGlobalProxyOffset)); | 127       __ ld(a2, FieldMemOperand(a2, GlobalObject::kGlobalProxyOffset)); | 
| 129 | 128 | 
| 130       __ sd(a2, MemOperand(sp, receiver_offset)); | 129       __ sd(a2, MemOperand(sp, receiver_offset)); | 
| (...skipping 5983 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 6114   __ Push(at, ToRegister(instr->function())); | 6113   __ Push(at, ToRegister(instr->function())); | 
| 6115   CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6114   CallRuntime(Runtime::kPushBlockContext, 2, instr); | 
| 6116   RecordSafepoint(Safepoint::kNoLazyDeopt); | 6115   RecordSafepoint(Safepoint::kNoLazyDeopt); | 
| 6117 } | 6116 } | 
| 6118 | 6117 | 
| 6119 | 6118 | 
| 6120 #undef __ | 6119 #undef __ | 
| 6121 | 6120 | 
| 6122 }  // namespace internal | 6121 }  // namespace internal | 
| 6123 }  // namespace v8 | 6122 }  // namespace v8 | 
| OLD | NEW | 
|---|