OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arm64/lithium-codegen-arm64.h" | 7 #include "src/arm64/lithium-codegen-arm64.h" |
8 #include "src/arm64/lithium-gap-resolver-arm64.h" | 8 #include "src/arm64/lithium-gap-resolver-arm64.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
682 if (info()->saves_caller_doubles()) { | 682 if (info()->saves_caller_doubles()) { |
683 SaveCallerDoubles(); | 683 SaveCallerDoubles(); |
684 } | 684 } |
685 | 685 |
686 // Allocate a local context if needed. | 686 // Allocate a local context if needed. |
687 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 687 int heap_slots = info()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
688 if (heap_slots > 0) { | 688 if (heap_slots > 0) { |
689 Comment(";;; Allocate local context"); | 689 Comment(";;; Allocate local context"); |
690 bool need_write_barrier = true; | 690 bool need_write_barrier = true; |
691 // Argument to NewContext is the function, which is in x1. | 691 // Argument to NewContext is the function, which is in x1. |
692 if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 692 if (FLAG_harmony_scoping && info()->scope()->is_global_scope()) { |
693 __ Push(x1); | |
694 __ Push(info()->scope()->GetScopeInfo()); | |
jbramley
2014/07/28 16:00:32
I think it would be slightly better load the scope
Michael Starzinger
2014/07/28 16:15:53
Done.
| |
695 __ CallRuntime(Runtime::kNewGlobalContext, 2); | |
696 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { | |
693 FastNewContextStub stub(isolate(), heap_slots); | 697 FastNewContextStub stub(isolate(), heap_slots); |
694 __ CallStub(&stub); | 698 __ CallStub(&stub); |
695 // Result of FastNewContextStub is always in new space. | 699 // Result of FastNewContextStub is always in new space. |
696 need_write_barrier = false; | 700 need_write_barrier = false; |
697 } else { | 701 } else { |
698 __ Push(x1); | 702 __ Push(x1); |
699 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 703 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
700 } | 704 } |
701 RecordSafepoint(Safepoint::kNoLazyDeopt); | 705 RecordSafepoint(Safepoint::kNoLazyDeopt); |
702 // Context is returned in x0. It replaces the context passed to us. It's | 706 // Context is returned in x0. It replaces the context passed to us. It's |
(...skipping 4324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5027 void LCodeGen::DoDebugBreak(LDebugBreak* instr) { | 5031 void LCodeGen::DoDebugBreak(LDebugBreak* instr) { |
5028 __ Debug("LDebugBreak", 0, BREAK); | 5032 __ Debug("LDebugBreak", 0, BREAK); |
5029 } | 5033 } |
5030 | 5034 |
5031 | 5035 |
5032 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { | 5036 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { |
5033 ASSERT(ToRegister(instr->context()).is(cp)); | 5037 ASSERT(ToRegister(instr->context()).is(cp)); |
5034 Register scratch1 = x5; | 5038 Register scratch1 = x5; |
5035 Register scratch2 = x6; | 5039 Register scratch2 = x6; |
5036 ASSERT(instr->IsMarkedAsCall()); | 5040 ASSERT(instr->IsMarkedAsCall()); |
5037 | |
5038 ASM_UNIMPLEMENTED_BREAK("DoDeclareGlobals"); | |
jbramley
2014/07/28 16:00:32
We used ASM_UNIMPLEMENTED_BREAK during development
Michael Starzinger
2014/07/28 16:15:53
Acknowledged. This actually was the last use. Woul
jbramley
2014/07/28 16:28:11
I see no reason to keep it. We can recreate it fai
| |
5039 // TODO(all): if Mov could handle object in new space then it could be used | 5041 // TODO(all): if Mov could handle object in new space then it could be used |
5040 // here. | 5042 // here. |
5041 __ LoadHeapObject(scratch1, instr->hydrogen()->pairs()); | 5043 __ LoadHeapObject(scratch1, instr->hydrogen()->pairs()); |
5042 __ Mov(scratch2, Smi::FromInt(instr->hydrogen()->flags())); | 5044 __ Mov(scratch2, Smi::FromInt(instr->hydrogen()->flags())); |
5043 __ Push(cp, scratch1, scratch2); // The context is the first argument. | 5045 __ Push(cp, scratch1, scratch2); // The context is the first argument. |
5044 CallRuntime(Runtime::kDeclareGlobals, 3, instr); | 5046 CallRuntime(Runtime::kDeclareGlobals, 3, instr); |
5045 } | 5047 } |
5046 | 5048 |
5047 | 5049 |
5048 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) { | 5050 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) { |
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6054 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6056 Handle<ScopeInfo> scope_info = instr->scope_info(); |
6055 __ Push(scope_info); | 6057 __ Push(scope_info); |
6056 __ Push(ToRegister(instr->function())); | 6058 __ Push(ToRegister(instr->function())); |
6057 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6059 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6058 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6060 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6059 } | 6061 } |
6060 | 6062 |
6061 | 6063 |
6062 | 6064 |
6063 } } // namespace v8::internal | 6065 } } // namespace v8::internal |
OLD | NEW |