| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 6 | 6 |
| 7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
| 8 // | 8 // |
| 9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
| 10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 CompilationInfo* info = info_; | 113 CompilationInfo* info = info_; |
| 114 profiling_counter_ = isolate()->factory()->NewCell( | 114 profiling_counter_ = isolate()->factory()->NewCell( |
| 115 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); | 115 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); |
| 116 SetFunctionPosition(function()); | 116 SetFunctionPosition(function()); |
| 117 Comment cmnt(masm_, "[ function compiled by full code generator"); | 117 Comment cmnt(masm_, "[ function compiled by full code generator"); |
| 118 | 118 |
| 119 ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 119 ProfileEntryHookStub::MaybeCallEntryHook(masm_); |
| 120 | 120 |
| 121 #ifdef DEBUG | 121 #ifdef DEBUG |
| 122 if (strlen(FLAG_stop_at) > 0 && | 122 if (strlen(FLAG_stop_at) > 0 && |
| 123 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 123 info->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
| 124 __ stop("stop-at"); | 124 __ stop("stop-at"); |
| 125 } | 125 } |
| 126 #endif | 126 #endif |
| 127 | 127 |
| 128 // Sloppy mode functions and builtins need to replace the receiver with the | 128 // Sloppy mode functions and builtins need to replace the receiver with the |
| 129 // global proxy when called as functions (without an explicit receiver | 129 // global proxy when called as functions (without an explicit receiver |
| 130 // object). | 130 // object). |
| 131 if (is_sloppy(info->language_mode()) && !info->is_native() && | 131 if (is_sloppy(info->language_mode()) && !info->is_native() && |
| 132 info->MayUseThis() && info->scope()->has_this_declaration()) { | 132 info->MayUseThis() && info->scope()->has_this_declaration()) { |
| 133 Label ok; | 133 Label ok; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 149 // the frame (that is done below). | 149 // the frame (that is done below). |
| 150 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 150 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
| 151 | 151 |
| 152 info->set_prologue_offset(masm_->pc_offset()); | 152 info->set_prologue_offset(masm_->pc_offset()); |
| 153 __ Prologue(info->IsCodePreAgingActive()); | 153 __ Prologue(info->IsCodePreAgingActive()); |
| 154 info->AddNoFrameRange(0, masm_->pc_offset()); | 154 info->AddNoFrameRange(0, masm_->pc_offset()); |
| 155 | 155 |
| 156 { Comment cmnt(masm_, "[ Allocate locals"); | 156 { Comment cmnt(masm_, "[ Allocate locals"); |
| 157 int locals_count = info->scope()->num_stack_slots(); | 157 int locals_count = info->scope()->num_stack_slots(); |
| 158 // Generators allocate locals, if any, in context slots. | 158 // Generators allocate locals, if any, in context slots. |
| 159 DCHECK(!IsGeneratorFunction(info->function()->kind()) || locals_count == 0); | 159 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); |
| 160 if (locals_count > 0) { | 160 if (locals_count > 0) { |
| 161 if (locals_count >= 128) { | 161 if (locals_count >= 128) { |
| 162 Label ok; | 162 Label ok; |
| 163 __ Subu(t5, sp, Operand(locals_count * kPointerSize)); | 163 __ Subu(t5, sp, Operand(locals_count * kPointerSize)); |
| 164 __ LoadRoot(a2, Heap::kRealStackLimitRootIndex); | 164 __ LoadRoot(a2, Heap::kRealStackLimitRootIndex); |
| 165 __ Branch(&ok, hs, t5, Operand(a2)); | 165 __ Branch(&ok, hs, t5, Operand(a2)); |
| 166 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); | 166 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); |
| 167 __ bind(&ok); | 167 __ bind(&ok); |
| 168 } | 168 } |
| 169 __ LoadRoot(t5, Heap::kUndefinedValueRootIndex); | 169 __ LoadRoot(t5, Heap::kUndefinedValueRootIndex); |
| (...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1472 // | 1472 // |
| 1473 // The condition on the declaration scopes is a conservative check for | 1473 // The condition on the declaration scopes is a conservative check for |
| 1474 // nested functions that access a binding and are called before the | 1474 // nested functions that access a binding and are called before the |
| 1475 // binding is initialized: | 1475 // binding is initialized: |
| 1476 // function() { f(); let x = 1; function f() { x = 2; } } | 1476 // function() { f(); let x = 1; function f() { x = 2; } } |
| 1477 // | 1477 // |
| 1478 bool skip_init_check; | 1478 bool skip_init_check; |
| 1479 if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) { | 1479 if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) { |
| 1480 skip_init_check = false; | 1480 skip_init_check = false; |
| 1481 } else if (var->is_this()) { | 1481 } else if (var->is_this()) { |
| 1482 CHECK(info_->function() != nullptr && | 1482 CHECK(info_->has_literal() && |
| 1483 (info_->function()->kind() & kSubclassConstructor) != 0); | 1483 (info_->literal()->kind() & kSubclassConstructor) != 0); |
| 1484 // TODO(dslomov): implement 'this' hole check elimination. | 1484 // TODO(dslomov): implement 'this' hole check elimination. |
| 1485 skip_init_check = false; | 1485 skip_init_check = false; |
| 1486 } else { | 1486 } else { |
| 1487 // Check that we always have valid source position. | 1487 // Check that we always have valid source position. |
| 1488 DCHECK(var->initializer_position() != RelocInfo::kNoPosition); | 1488 DCHECK(var->initializer_position() != RelocInfo::kNoPosition); |
| 1489 DCHECK(proxy->position() != RelocInfo::kNoPosition); | 1489 DCHECK(proxy->position() != RelocInfo::kNoPosition); |
| 1490 skip_init_check = var->mode() != CONST_LEGACY && | 1490 skip_init_check = var->mode() != CONST_LEGACY && |
| 1491 var->initializer_position() < proxy->position(); | 1491 var->initializer_position() < proxy->position(); |
| 1492 } | 1492 } |
| 1493 | 1493 |
| (...skipping 3882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5376 reinterpret_cast<uint32_t>( | 5376 reinterpret_cast<uint32_t>( |
| 5377 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5377 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5378 return OSR_AFTER_STACK_CHECK; | 5378 return OSR_AFTER_STACK_CHECK; |
| 5379 } | 5379 } |
| 5380 | 5380 |
| 5381 | 5381 |
| 5382 } // namespace internal | 5382 } // namespace internal |
| 5383 } // namespace v8 | 5383 } // namespace v8 |
| 5384 | 5384 |
| 5385 #endif // V8_TARGET_ARCH_MIPS | 5385 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |