Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(734)

Side by Side Diff: src/compiler/ia32/code-generator-ia32.cc

Issue 1696043002: [runtime] Unify and simplify how frames are marked (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweaks Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after
1448 // | FP | RET | args | caller frame | 1448 // | FP | RET | args | caller frame |
1449 // ^ esp,ebp 1449 // ^ esp,ebp
1450 1450
1451 // --{ pop ebp }---------------------------------------------------------------- 1451 // --{ pop ebp }----------------------------------------------------------------
1452 // | RET | args | caller frame | 1452 // | RET | args | caller frame |
1453 // ^ esp ^ ebp 1453 // ^ esp ^ ebp
1454 1454
1455 1455
1456 void CodeGenerator::AssemblePrologue() { 1456 void CodeGenerator::AssemblePrologue() {
1457 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); 1457 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
1458 if (descriptor->IsCFunctionCall()) { 1458 if (this->info()->GeneratePreagedPrologue()) {
1459 // TODO(turbofan): this prologue is redundant with OSR, but still needed for
1460 // code aging.
1461 DCHECK(frame()->needs_frame());
1462 DCHECK((descriptor->flags() & CallDescriptor::kHasStandardFrameHeader) !=
1463 0);
1464 __ call(isolate()->builtins()->MarkCodeAsExecutedOnce(),
1465 RelocInfo::CODE_AGE_SEQUENCE);
1466 __ Nop(kNoCodeAgeSequenceLength -
1467 v8::internal::Assembler::kCallInstructionLength);
1468 } else if (frame()->needs_frame()) {
1459 // Assemble a prologue similar the to cdecl calling convention. 1469 // Assemble a prologue similar the to cdecl calling convention.
Michael Starzinger 2016/02/23 10:57:33 nit: Comment is outdated, it follows our internal
danno 2016/03/07 09:33:38 Done.
1460 __ push(ebp); 1470 __ push(ebp);
1461 __ mov(ebp, esp); 1471 __ mov(ebp, esp);
1462 } else if (descriptor->IsJSFunctionCall()) { 1472 if ((descriptor->flags() & CallDescriptor::kHasStandardFrameHeader) != 0) {
1463 // TODO(turbofan): this prologue is redundant with OSR, but still needed for 1473 __ push(esi);
1464 // code aging. 1474 __ push(edi);
1465 __ Prologue(this->info()->GeneratePreagedPrologue()); 1475 } else {
1466 } else if (frame()->needs_frame()) { 1476 __ push(Immediate(Smi::FromInt(StackFrame::STUB)));
1467 __ StubPrologue(); 1477 }
1468 } else { 1478 } else {
1469 frame()->SetElidedFrameSizeInSlots(kPCOnStackSize / kPointerSize); 1479 frame()->SetElidedFrameSizeInSlots(kPCOnStackSize / kPointerSize);
1470 } 1480 }
1471 frame_access_state()->SetFrameAccessToDefault(); 1481 frame_access_state()->SetFrameAccessToDefault();
1472 1482
1473 int stack_shrink_slots = frame()->GetSpillSlotCount(); 1483 int stack_shrink_slots = frame()->GetSpillSlotCount();
1474 if (info()->is_osr()) { 1484 if (info()->is_osr()) {
1475 // TurboFan OSR-compiled functions cannot be entered directly. 1485 // TurboFan OSR-compiled functions cannot be entered directly.
1476 __ Abort(kShouldNotDirectlyEnterOsrFunction); 1486 __ Abort(kShouldNotDirectlyEnterOsrFunction);
1477 1487
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 1745 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
1736 __ Nop(padding_size); 1746 __ Nop(padding_size);
1737 } 1747 }
1738 } 1748 }
1739 1749
1740 #undef __ 1750 #undef __
1741 1751
1742 } // namespace compiler 1752 } // namespace compiler
1743 } // namespace internal 1753 } // namespace internal
1744 } // namespace v8 1754 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/frame.h ('k') | src/compiler/linkage.h » ('j') | src/compiler/linkage.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698