| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 bool need_write_barrier = true; | 196 bool need_write_barrier = true; |
| 197 // Argument to NewContext is the function, which is in a1. | 197 // Argument to NewContext is the function, which is in a1. |
| 198 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 198 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
| 199 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; | 199 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; |
| 200 if (info()->scope()->is_script_scope()) { | 200 if (info()->scope()->is_script_scope()) { |
| 201 __ push(a1); | 201 __ push(a1); |
| 202 __ Push(info()->scope()->scope_info()); | 202 __ Push(info()->scope()->scope_info()); |
| 203 __ CallRuntime(Runtime::kNewScriptContext); | 203 __ CallRuntime(Runtime::kNewScriptContext); |
| 204 deopt_mode = Safepoint::kLazyDeopt; | 204 deopt_mode = Safepoint::kLazyDeopt; |
| 205 } else { | 205 } else { |
| 206 if (slots <= | 206 if (slots <= ConstructorBuiltins::MaximumFunctionContextSlots()) { |
| 207 ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) { | |
| 208 Callable callable = CodeFactory::FastNewFunctionContext( | 207 Callable callable = CodeFactory::FastNewFunctionContext( |
| 209 isolate(), info()->scope()->scope_type()); | 208 isolate(), info()->scope()->scope_type()); |
| 210 __ li(FastNewFunctionContextDescriptor::SlotsRegister(), | 209 __ li(FastNewFunctionContextDescriptor::SlotsRegister(), |
| 211 Operand(slots)); | 210 Operand(slots)); |
| 212 __ Call(callable.code(), RelocInfo::CODE_TARGET); | 211 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
| 213 // Result of the FastNewFunctionContext builtin is always in new space. | 212 // Result of the FastNewFunctionContext builtin is always in new space. |
| 214 need_write_barrier = false; | 213 need_write_barrier = false; |
| 215 } else { | 214 } else { |
| 216 __ push(a1); | 215 __ push(a1); |
| 217 __ Push(Smi::FromInt(info()->scope()->scope_type())); | 216 __ Push(Smi::FromInt(info()->scope()->scope_type())); |
| (...skipping 5138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5356 __ lw(result, FieldMemOperand(scratch, | 5355 __ lw(result, FieldMemOperand(scratch, |
| 5357 FixedArray::kHeaderSize - kPointerSize)); | 5356 FixedArray::kHeaderSize - kPointerSize)); |
| 5358 __ bind(deferred->exit()); | 5357 __ bind(deferred->exit()); |
| 5359 __ bind(&done); | 5358 __ bind(&done); |
| 5360 } | 5359 } |
| 5361 | 5360 |
| 5362 #undef __ | 5361 #undef __ |
| 5363 | 5362 |
| 5364 } // namespace internal | 5363 } // namespace internal |
| 5365 } // namespace v8 | 5364 } // namespace v8 |
| OLD | NEW |