| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 if (info()->saves_caller_doubles()) { | 193 if (info()->saves_caller_doubles()) { |
| 194 SaveCallerDoubles(); | 194 SaveCallerDoubles(); |
| 195 } | 195 } |
| 196 | 196 |
| 197 // Possibly allocate a local context. | 197 // Possibly allocate a local context. |
| 198 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 198 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
| 199 if (heap_slots > 0) { | 199 if (heap_slots > 0) { |
| 200 Comment(";;; Allocate local context"); | 200 Comment(";;; Allocate local context"); |
| 201 bool need_write_barrier = true; | 201 bool need_write_barrier = true; |
| 202 // Argument to NewContext is the function, which is in a1. | 202 // Argument to NewContext is the function, which is in a1. |
| 203 if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 203 if (FLAG_harmony_scoping && info()->scope()->is_global_scope()) { |
| 204 __ push(a1); |
| 205 __ Push(info()->scope()->GetScopeInfo()); |
| 206 __ CallRuntime(Runtime::kNewGlobalContext, 2); |
| 207 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
| 204 FastNewContextStub stub(isolate(), heap_slots); | 208 FastNewContextStub stub(isolate(), heap_slots); |
| 205 __ CallStub(&stub); | 209 __ CallStub(&stub); |
| 206 // Result of FastNewContextStub is always in new space. | 210 // Result of FastNewContextStub is always in new space. |
| 207 need_write_barrier = false; | 211 need_write_barrier = false; |
| 208 } else { | 212 } else { |
| 209 __ push(a1); | 213 __ push(a1); |
| 210 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 214 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
| 211 } | 215 } |
| 212 RecordSafepoint(Safepoint::kNoLazyDeopt); | 216 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 213 // Context is returned in both v0. It replaces the context passed to us. | 217 // Context is returned in both v0. It replaces the context passed to us. |
| (...skipping 5717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5931 __ li(at, scope_info); | 5935 __ li(at, scope_info); |
| 5932 __ Push(at, ToRegister(instr->function())); | 5936 __ Push(at, ToRegister(instr->function())); |
| 5933 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5937 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5934 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5938 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5935 } | 5939 } |
| 5936 | 5940 |
| 5937 | 5941 |
| 5938 #undef __ | 5942 #undef __ |
| 5939 | 5943 |
| 5940 } } // namespace v8::internal | 5944 } } // namespace v8::internal |
| OLD | NEW |