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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 SetFunctionPosition(function()); | 140 SetFunctionPosition(function()); |
141 Comment cmnt(masm_, "[ function compiled by full code generator"); | 141 Comment cmnt(masm_, "[ function compiled by full code generator"); |
142 | 142 |
143 #ifdef DEBUG | 143 #ifdef DEBUG |
144 if (strlen(FLAG_stop_at) > 0 && | 144 if (strlen(FLAG_stop_at) > 0 && |
145 info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) { | 145 info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) { |
146 __ stop("stop-at"); | 146 __ stop("stop-at"); |
147 } | 147 } |
148 #endif | 148 #endif |
149 | 149 |
150 // Strict mode functions need to replace the receiver with undefined | 150 // Strict mode functions and builtins need to replace the receiver |
151 // when called as functions (without an explicit receiver | 151 // with undefined when called as functions (without an explicit |
152 // object). t1 is zero for method calls and non-zero for function | 152 // receiver object). t1 is zero for method calls and non-zero for |
153 // calls. | 153 // function calls. |
154 if (info->is_strict_mode()) { | 154 if (info->is_strict_mode() || info->is_native()) { |
155 Label ok; | 155 Label ok; |
156 __ Branch(&ok, eq, t1, Operand(zero_reg)); | 156 __ Branch(&ok, eq, t1, Operand(zero_reg)); |
157 int receiver_offset = scope()->num_parameters() * kPointerSize; | 157 int receiver_offset = scope()->num_parameters() * kPointerSize; |
158 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); | 158 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); |
159 __ sw(a2, MemOperand(sp, receiver_offset)); | 159 __ sw(a2, MemOperand(sp, receiver_offset)); |
160 __ bind(&ok); | 160 __ bind(&ok); |
161 } | 161 } |
162 | 162 |
163 int locals_count = scope()->num_stack_slots(); | 163 int locals_count = scope()->num_stack_slots(); |
164 | 164 |
(...skipping 4214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4379 __ Addu(at, a1, Operand(masm_->CodeObject())); | 4379 __ Addu(at, a1, Operand(masm_->CodeObject())); |
4380 __ Jump(at); | 4380 __ Jump(at); |
4381 } | 4381 } |
4382 | 4382 |
4383 | 4383 |
4384 #undef __ | 4384 #undef __ |
4385 | 4385 |
4386 } } // namespace v8::internal | 4386 } } // namespace v8::internal |
4387 | 4387 |
4388 #endif // V8_TARGET_ARCH_MIPS | 4388 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |