OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
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 10 matching lines...) Expand all Loading... |
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "src/crankshaft/mips/lithium-codegen-mips.h" | 28 #include "src/crankshaft/mips/lithium-codegen-mips.h" |
29 | 29 |
30 #include "src/base/bits.h" | 30 #include "src/base/bits.h" |
| 31 #include "src/builtins/builtins-constructor.h" |
31 #include "src/code-factory.h" | 32 #include "src/code-factory.h" |
32 #include "src/code-stubs.h" | 33 #include "src/code-stubs.h" |
33 #include "src/crankshaft/hydrogen-osr.h" | 34 #include "src/crankshaft/hydrogen-osr.h" |
34 #include "src/crankshaft/mips/lithium-gap-resolver-mips.h" | 35 #include "src/crankshaft/mips/lithium-gap-resolver-mips.h" |
35 #include "src/ic/ic.h" | 36 #include "src/ic/ic.h" |
36 #include "src/ic/stub-cache.h" | 37 #include "src/ic/stub-cache.h" |
37 | 38 |
38 namespace v8 { | 39 namespace v8 { |
39 namespace internal { | 40 namespace internal { |
40 | 41 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 bool need_write_barrier = true; | 196 bool need_write_barrier = true; |
196 // Argument to NewContext is the function, which is in a1. | 197 // Argument to NewContext is the function, which is in a1. |
197 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 198 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
198 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; | 199 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; |
199 if (info()->scope()->is_script_scope()) { | 200 if (info()->scope()->is_script_scope()) { |
200 __ push(a1); | 201 __ push(a1); |
201 __ Push(info()->scope()->scope_info()); | 202 __ Push(info()->scope()->scope_info()); |
202 __ CallRuntime(Runtime::kNewScriptContext); | 203 __ CallRuntime(Runtime::kNewScriptContext); |
203 deopt_mode = Safepoint::kLazyDeopt; | 204 deopt_mode = Safepoint::kLazyDeopt; |
204 } else { | 205 } else { |
205 if (slots <= FastNewFunctionContextStub::MaximumSlots()) { | 206 if (slots <= |
206 FastNewFunctionContextStub stub(isolate(), | 207 ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) { |
207 info()->scope()->scope_type()); | 208 Callable callable = CodeFactory::FastNewFunctionContext( |
| 209 isolate(), info()->scope()->scope_type()); |
208 __ li(FastNewFunctionContextDescriptor::SlotsRegister(), | 210 __ li(FastNewFunctionContextDescriptor::SlotsRegister(), |
209 Operand(slots)); | 211 Operand(slots)); |
210 __ CallStub(&stub); | 212 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
211 // Result of FastNewFunctionContextStub is always in new space. | 213 // Result of the FastNewFunctionContext builtin is always in new space. |
212 need_write_barrier = false; | 214 need_write_barrier = false; |
213 } else { | 215 } else { |
214 __ push(a1); | 216 __ push(a1); |
215 __ Push(Smi::FromInt(info()->scope()->scope_type())); | 217 __ Push(Smi::FromInt(info()->scope()->scope_type())); |
216 __ CallRuntime(Runtime::kNewFunctionContext); | 218 __ CallRuntime(Runtime::kNewFunctionContext); |
217 } | 219 } |
218 } | 220 } |
219 RecordSafepoint(deopt_mode); | 221 RecordSafepoint(deopt_mode); |
220 | 222 |
221 // Context is returned in both v0. It replaces the context passed to us. | 223 // Context is returned in both v0. It replaces the context passed to us. |
(...skipping 5194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5416 __ lw(result, FieldMemOperand(scratch, | 5418 __ lw(result, FieldMemOperand(scratch, |
5417 FixedArray::kHeaderSize - kPointerSize)); | 5419 FixedArray::kHeaderSize - kPointerSize)); |
5418 __ bind(deferred->exit()); | 5420 __ bind(deferred->exit()); |
5419 __ bind(&done); | 5421 __ bind(&done); |
5420 } | 5422 } |
5421 | 5423 |
5422 #undef __ | 5424 #undef __ |
5423 | 5425 |
5424 } // namespace internal | 5426 } // namespace internal |
5425 } // namespace v8 | 5427 } // namespace v8 |
OLD | NEW |