OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 CompilationInfo* info = info_; | 102 CompilationInfo* info = info_; |
103 profiling_counter_ = isolate()->factory()->NewCell( | 103 profiling_counter_ = isolate()->factory()->NewCell( |
104 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); | 104 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); |
105 SetFunctionPosition(function()); | 105 SetFunctionPosition(function()); |
106 Comment cmnt(masm_, "[ function compiled by full code generator"); | 106 Comment cmnt(masm_, "[ function compiled by full code generator"); |
107 | 107 |
108 ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 108 ProfileEntryHookStub::MaybeCallEntryHook(masm_); |
109 | 109 |
110 #ifdef DEBUG | 110 #ifdef DEBUG |
111 if (strlen(FLAG_stop_at) > 0 && | 111 if (strlen(FLAG_stop_at) > 0 && |
112 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 112 info->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
113 __ stop("stop-at"); | 113 __ stop("stop-at"); |
114 } | 114 } |
115 #endif | 115 #endif |
116 | 116 |
117 // Sloppy mode functions and builtins need to replace the receiver with the | 117 // Sloppy mode functions and builtins need to replace the receiver with the |
118 // global proxy when called as functions (without an explicit receiver | 118 // global proxy when called as functions (without an explicit receiver |
119 // object). | 119 // object). |
120 if (is_sloppy(info->language_mode()) && !info->is_native() && | 120 if (is_sloppy(info->language_mode()) && !info->is_native() && |
121 info->MayUseThis() && info->scope()->has_this_declaration()) { | 121 info->MayUseThis() && info->scope()->has_this_declaration()) { |
122 Label ok; | 122 Label ok; |
(...skipping 23 matching lines...) Expand all Loading... |
146 __ addi(ip, ip, Operand(prologue_offset)); | 146 __ addi(ip, ip, Operand(prologue_offset)); |
147 } | 147 } |
148 info->set_prologue_offset(prologue_offset); | 148 info->set_prologue_offset(prologue_offset); |
149 __ Prologue(info->IsCodePreAgingActive(), prologue_offset); | 149 __ Prologue(info->IsCodePreAgingActive(), prologue_offset); |
150 info->AddNoFrameRange(0, masm_->pc_offset()); | 150 info->AddNoFrameRange(0, masm_->pc_offset()); |
151 | 151 |
152 { | 152 { |
153 Comment cmnt(masm_, "[ Allocate locals"); | 153 Comment cmnt(masm_, "[ Allocate locals"); |
154 int locals_count = info->scope()->num_stack_slots(); | 154 int locals_count = info->scope()->num_stack_slots(); |
155 // Generators allocate locals, if any, in context slots. | 155 // Generators allocate locals, if any, in context slots. |
156 DCHECK(!IsGeneratorFunction(info->function()->kind()) || locals_count == 0); | 156 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); |
157 if (locals_count > 0) { | 157 if (locals_count > 0) { |
158 if (locals_count >= 128) { | 158 if (locals_count >= 128) { |
159 Label ok; | 159 Label ok; |
160 __ Add(ip, sp, -(locals_count * kPointerSize), r0); | 160 __ Add(ip, sp, -(locals_count * kPointerSize), r0); |
161 __ LoadRoot(r5, Heap::kRealStackLimitRootIndex); | 161 __ LoadRoot(r5, Heap::kRealStackLimitRootIndex); |
162 __ cmpl(ip, r5); | 162 __ cmpl(ip, r5); |
163 __ bc_short(ge, &ok); | 163 __ bc_short(ge, &ok); |
164 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); | 164 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); |
165 __ bind(&ok); | 165 __ bind(&ok); |
166 } | 166 } |
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 // | 1439 // |
1440 // The condition on the declaration scopes is a conservative check for | 1440 // The condition on the declaration scopes is a conservative check for |
1441 // nested functions that access a binding and are called before the | 1441 // nested functions that access a binding and are called before the |
1442 // binding is initialized: | 1442 // binding is initialized: |
1443 // function() { f(); let x = 1; function f() { x = 2; } } | 1443 // function() { f(); let x = 1; function f() { x = 2; } } |
1444 // | 1444 // |
1445 bool skip_init_check; | 1445 bool skip_init_check; |
1446 if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) { | 1446 if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) { |
1447 skip_init_check = false; | 1447 skip_init_check = false; |
1448 } else if (var->is_this()) { | 1448 } else if (var->is_this()) { |
1449 CHECK(info_->function() != nullptr && | 1449 CHECK(info_->has_literal() && |
1450 (info_->function()->kind() & kSubclassConstructor) != 0); | 1450 (info_->literal()->kind() & kSubclassConstructor) != 0); |
1451 // TODO(dslomov): implement 'this' hole check elimination. | 1451 // TODO(dslomov): implement 'this' hole check elimination. |
1452 skip_init_check = false; | 1452 skip_init_check = false; |
1453 } else { | 1453 } else { |
1454 // Check that we always have valid source position. | 1454 // Check that we always have valid source position. |
1455 DCHECK(var->initializer_position() != RelocInfo::kNoPosition); | 1455 DCHECK(var->initializer_position() != RelocInfo::kNoPosition); |
1456 DCHECK(proxy->position() != RelocInfo::kNoPosition); | 1456 DCHECK(proxy->position() != RelocInfo::kNoPosition); |
1457 skip_init_check = var->mode() != CONST_LEGACY && | 1457 skip_init_check = var->mode() != CONST_LEGACY && |
1458 var->initializer_position() < proxy->position(); | 1458 var->initializer_position() < proxy->position(); |
1459 } | 1459 } |
1460 | 1460 |
(...skipping 3928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5389 return ON_STACK_REPLACEMENT; | 5389 return ON_STACK_REPLACEMENT; |
5390 } | 5390 } |
5391 | 5391 |
5392 DCHECK(interrupt_address == | 5392 DCHECK(interrupt_address == |
5393 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5393 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5394 return OSR_AFTER_STACK_CHECK; | 5394 return OSR_AFTER_STACK_CHECK; |
5395 } | 5395 } |
5396 } // namespace internal | 5396 } // namespace internal |
5397 } // namespace v8 | 5397 } // namespace v8 |
5398 #endif // V8_TARGET_ARCH_PPC | 5398 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |