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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 #ifdef DEBUG | 101 #ifdef DEBUG |
102 if (strlen(FLAG_stop_at) > 0 && | 102 if (strlen(FLAG_stop_at) > 0 && |
103 info->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 103 info->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
104 __ int3(); | 104 __ int3(); |
105 } | 105 } |
106 #endif | 106 #endif |
107 | 107 |
108 // Sloppy mode functions and builtins need to replace the receiver with the | 108 // Sloppy mode functions and builtins need to replace the receiver with the |
109 // global proxy when called as functions (without an explicit receiver | 109 // global proxy when called as functions (without an explicit receiver |
110 // object). | 110 // object). |
111 if (is_sloppy(info->language_mode()) && !info->is_native() && | 111 if (info->MustReplaceUndefinedReceiverWithGlobalProxy()) { |
112 info->MayUseThis() && info->scope()->has_this_declaration()) { | |
113 Label ok; | 112 Label ok; |
114 // +1 for return address. | 113 // +1 for return address. |
115 StackArgumentsAccessor args(rsp, info->scope()->num_parameters()); | 114 StackArgumentsAccessor args(rsp, info->scope()->num_parameters()); |
116 __ movp(rcx, args.GetReceiverOperand()); | 115 __ movp(rcx, args.GetReceiverOperand()); |
117 | 116 |
118 __ CompareRoot(rcx, Heap::kUndefinedValueRootIndex); | 117 __ CompareRoot(rcx, Heap::kUndefinedValueRootIndex); |
119 __ j(not_equal, &ok, Label::kNear); | 118 __ j(not_equal, &ok, Label::kNear); |
120 | 119 |
121 __ movp(rcx, GlobalObjectOperand()); | 120 __ movp(rcx, GlobalObjectOperand()); |
122 __ movp(rcx, FieldOperand(rcx, GlobalObject::kGlobalProxyOffset)); | 121 __ movp(rcx, FieldOperand(rcx, GlobalObject::kGlobalProxyOffset)); |
(...skipping 5143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5266 Assembler::target_address_at(call_target_address, | 5265 Assembler::target_address_at(call_target_address, |
5267 unoptimized_code)); | 5266 unoptimized_code)); |
5268 return OSR_AFTER_STACK_CHECK; | 5267 return OSR_AFTER_STACK_CHECK; |
5269 } | 5268 } |
5270 | 5269 |
5271 | 5270 |
5272 } // namespace internal | 5271 } // namespace internal |
5273 } // namespace v8 | 5272 } // namespace v8 |
5274 | 5273 |
5275 #endif // V8_TARGET_ARCH_X64 | 5274 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |