| 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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 | 
| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 104   CompilationInfo* info = info_; | 104   CompilationInfo* info = info_; | 
| 105   profiling_counter_ = isolate()->factory()->NewCell( | 105   profiling_counter_ = isolate()->factory()->NewCell( | 
| 106       Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); | 106       Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); | 
| 107   SetFunctionPosition(function()); | 107   SetFunctionPosition(function()); | 
| 108   Comment cmnt(masm_, "[ Function compiled by full code generator"); | 108   Comment cmnt(masm_, "[ Function compiled by full code generator"); | 
| 109 | 109 | 
| 110   ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 110   ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 
| 111 | 111 | 
| 112 #ifdef DEBUG | 112 #ifdef DEBUG | 
| 113   if (strlen(FLAG_stop_at) > 0 && | 113   if (strlen(FLAG_stop_at) > 0 && | 
| 114       info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 114       info->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 
| 115     __ Debug("stop-at", __LINE__, BREAK); | 115     __ Debug("stop-at", __LINE__, BREAK); | 
| 116   } | 116   } | 
| 117 #endif | 117 #endif | 
| 118 | 118 | 
| 119   // Sloppy mode functions and builtins need to replace the receiver with the | 119   // Sloppy mode functions and builtins need to replace the receiver with the | 
| 120   // global proxy when called as functions (without an explicit receiver | 120   // global proxy when called as functions (without an explicit receiver | 
| 121   // object). | 121   // object). | 
| 122   if (is_sloppy(info->language_mode()) && !info->is_native() && | 122   if (is_sloppy(info->language_mode()) && !info->is_native() && | 
| 123       info->MayUseThis() && info->scope()->has_this_declaration()) { | 123       info->MayUseThis() && info->scope()->has_this_declaration()) { | 
| 124     Label ok; | 124     Label ok; | 
| (...skipping 19 matching lines...) Expand all  Loading... | 
| 144   //  Push(lr, fp, cp, x1); | 144   //  Push(lr, fp, cp, x1); | 
| 145   //  Add(fp, jssp, 2 * kPointerSize); | 145   //  Add(fp, jssp, 2 * kPointerSize); | 
| 146   info->set_prologue_offset(masm_->pc_offset()); | 146   info->set_prologue_offset(masm_->pc_offset()); | 
| 147   __ Prologue(info->IsCodePreAgingActive()); | 147   __ Prologue(info->IsCodePreAgingActive()); | 
| 148   info->AddNoFrameRange(0, masm_->pc_offset()); | 148   info->AddNoFrameRange(0, masm_->pc_offset()); | 
| 149 | 149 | 
| 150   // Reserve space on the stack for locals. | 150   // Reserve space on the stack for locals. | 
| 151   { Comment cmnt(masm_, "[ Allocate locals"); | 151   { Comment cmnt(masm_, "[ Allocate locals"); | 
| 152     int locals_count = info->scope()->num_stack_slots(); | 152     int locals_count = info->scope()->num_stack_slots(); | 
| 153     // Generators allocate locals, if any, in context slots. | 153     // Generators allocate locals, if any, in context slots. | 
| 154     DCHECK(!IsGeneratorFunction(info->function()->kind()) || locals_count == 0); | 154     DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); | 
| 155 | 155 | 
| 156     if (locals_count > 0) { | 156     if (locals_count > 0) { | 
| 157       if (locals_count >= 128) { | 157       if (locals_count >= 128) { | 
| 158         Label ok; | 158         Label ok; | 
| 159         DCHECK(jssp.Is(__ StackPointer())); | 159         DCHECK(jssp.Is(__ StackPointer())); | 
| 160         __ Sub(x10, jssp, locals_count * kPointerSize); | 160         __ Sub(x10, jssp, locals_count * kPointerSize); | 
| 161         __ CompareRoot(x10, Heap::kRealStackLimitRootIndex); | 161         __ CompareRoot(x10, Heap::kRealStackLimitRootIndex); | 
| 162         __ B(hs, &ok); | 162         __ B(hs, &ok); | 
| 163         __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); | 163         __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); | 
| 164         __ Bind(&ok); | 164         __ Bind(&ok); | 
| (...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1462         // | 1462         // | 
| 1463         // The condition on the declaration scopes is a conservative check for | 1463         // The condition on the declaration scopes is a conservative check for | 
| 1464         // nested functions that access a binding and are called before the | 1464         // nested functions that access a binding and are called before the | 
| 1465         // binding is initialized: | 1465         // binding is initialized: | 
| 1466         //   function() { f(); let x = 1; function f() { x = 2; } } | 1466         //   function() { f(); let x = 1; function f() { x = 2; } } | 
| 1467         // | 1467         // | 
| 1468         bool skip_init_check; | 1468         bool skip_init_check; | 
| 1469         if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) { | 1469         if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) { | 
| 1470           skip_init_check = false; | 1470           skip_init_check = false; | 
| 1471         } else if (var->is_this()) { | 1471         } else if (var->is_this()) { | 
| 1472           CHECK(info_->function() != nullptr && | 1472           CHECK(info_->has_literal() && | 
| 1473                 (info_->function()->kind() & kSubclassConstructor) != 0); | 1473                 (info_->literal()->kind() & kSubclassConstructor) != 0); | 
| 1474           // TODO(dslomov): implement 'this' hole check elimination. | 1474           // TODO(dslomov): implement 'this' hole check elimination. | 
| 1475           skip_init_check = false; | 1475           skip_init_check = false; | 
| 1476         } else { | 1476         } else { | 
| 1477           // Check that we always have valid source position. | 1477           // Check that we always have valid source position. | 
| 1478           DCHECK(var->initializer_position() != RelocInfo::kNoPosition); | 1478           DCHECK(var->initializer_position() != RelocInfo::kNoPosition); | 
| 1479           DCHECK(proxy->position() != RelocInfo::kNoPosition); | 1479           DCHECK(proxy->position() != RelocInfo::kNoPosition); | 
| 1480           skip_init_check = var->mode() != CONST_LEGACY && | 1480           skip_init_check = var->mode() != CONST_LEGACY && | 
| 1481               var->initializer_position() < proxy->position(); | 1481               var->initializer_position() < proxy->position(); | 
| 1482         } | 1482         } | 
| 1483 | 1483 | 
| (...skipping 3916 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5400   } | 5400   } | 
| 5401 | 5401 | 
| 5402   return INTERRUPT; | 5402   return INTERRUPT; | 
| 5403 } | 5403 } | 
| 5404 | 5404 | 
| 5405 | 5405 | 
| 5406 }  // namespace internal | 5406 }  // namespace internal | 
| 5407 }  // namespace v8 | 5407 }  // namespace v8 | 
| 5408 | 5408 | 
| 5409 #endif  // V8_TARGET_ARCH_ARM64 | 5409 #endif  // V8_TARGET_ARCH_ARM64 | 
| OLD | NEW | 
|---|