OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 if (strlen(FLAG_stop_at) > 0 && | 137 if (strlen(FLAG_stop_at) > 0 && |
138 info_->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) { | 138 info_->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) { |
139 __ int3(); | 139 __ int3(); |
140 } | 140 } |
141 #endif | 141 #endif |
142 | 142 |
143 // Strict mode functions need to replace the receiver with undefined | 143 // Strict mode functions need to replace the receiver with undefined |
144 // when called as functions (without an explicit receiver | 144 // when called as functions (without an explicit receiver |
145 // object). rcx is zero for method calls and non-zero for function | 145 // object). rcx is zero for method calls and non-zero for function |
146 // calls. | 146 // calls. |
147 if (info_->is_strict_mode()) { | 147 if (info_->is_strict_mode() || info_->is_native()) { |
148 Label ok; | 148 Label ok; |
149 __ testq(rcx, rcx); | 149 __ testq(rcx, rcx); |
150 __ j(zero, &ok, Label::kNear); | 150 __ j(zero, &ok, Label::kNear); |
151 // +1 for return address. | 151 // +1 for return address. |
152 int receiver_offset = (scope()->num_parameters() + 1) * kPointerSize; | 152 int receiver_offset = (scope()->num_parameters() + 1) * kPointerSize; |
153 __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex); | 153 __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex); |
154 __ movq(Operand(rsp, receiver_offset), kScratchRegister); | 154 __ movq(Operand(rsp, receiver_offset), kScratchRegister); |
155 __ bind(&ok); | 155 __ bind(&ok); |
156 } | 156 } |
157 | 157 |
(...skipping 4100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4258 RegisterEnvironmentForDeoptimization(environment); | 4258 RegisterEnvironmentForDeoptimization(environment); |
4259 ASSERT(osr_pc_offset_ == -1); | 4259 ASSERT(osr_pc_offset_ == -1); |
4260 osr_pc_offset_ = masm()->pc_offset(); | 4260 osr_pc_offset_ = masm()->pc_offset(); |
4261 } | 4261 } |
4262 | 4262 |
4263 #undef __ | 4263 #undef __ |
4264 | 4264 |
4265 } } // namespace v8::internal | 4265 } } // namespace v8::internal |
4266 | 4266 |
4267 #endif // V8_TARGET_ARCH_X64 | 4267 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |