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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 info_->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) { | 139 info_->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) { |
140 __ stop("stop_at"); | 140 __ stop("stop_at"); |
141 } | 141 } |
142 #endif | 142 #endif |
143 | 143 |
144 // r1: Callee's JS function. | 144 // r1: Callee's JS function. |
145 // cp: Callee's context. | 145 // cp: Callee's context. |
146 // fp: Caller's frame pointer. | 146 // fp: Caller's frame pointer. |
147 // lr: Caller's pc. | 147 // lr: Caller's pc. |
148 | 148 |
149 // Strict mode functions need to replace the receiver with undefined | 149 // Strict mode functions and builtins need to replace the receiver |
150 // when called as functions (without an explicit receiver | 150 // with undefined when called as functions (without an explicit |
151 // object). r5 is zero for method calls and non-zero for function | 151 // receiver object). r5 is zero for method calls and non-zero for |
152 // calls. | 152 // function calls. |
153 if (info_->is_strict_mode()) { | 153 if (info_->is_strict_mode() || info_->is_native()) { |
154 Label ok; | 154 Label ok; |
155 __ cmp(r5, Operand(0)); | 155 __ cmp(r5, Operand(0)); |
156 __ b(eq, &ok); | 156 __ b(eq, &ok); |
157 int receiver_offset = scope()->num_parameters() * kPointerSize; | 157 int receiver_offset = scope()->num_parameters() * kPointerSize; |
158 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); | 158 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); |
159 __ str(r2, MemOperand(sp, receiver_offset)); | 159 __ str(r2, MemOperand(sp, receiver_offset)); |
160 __ bind(&ok); | 160 __ bind(&ok); |
161 } | 161 } |
162 | 162 |
163 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); | 163 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); |
(...skipping 4353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4517 ASSERT(osr_pc_offset_ == -1); | 4517 ASSERT(osr_pc_offset_ == -1); |
4518 osr_pc_offset_ = masm()->pc_offset(); | 4518 osr_pc_offset_ = masm()->pc_offset(); |
4519 } | 4519 } |
4520 | 4520 |
4521 | 4521 |
4522 | 4522 |
4523 | 4523 |
4524 #undef __ | 4524 #undef __ |
4525 | 4525 |
4526 } } // namespace v8::internal | 4526 } } // namespace v8::internal |
OLD | NEW |