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

Side by Side Diff: src/full-codegen/ppc/full-codegen-ppc.cc

Issue 1706283002: [fullcodegen] Implement operand stack depth tracking. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Turn off verification. Created 4 years, 9 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 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/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 if (true_label_ != fall_through_) __ b(true_label_); 533 if (true_label_ != fall_through_) __ b(true_label_);
534 } 534 }
535 } else { 535 } else {
536 // For simplicity we always test the accumulator register. 536 // For simplicity we always test the accumulator register.
537 __ mov(result_register(), Operand(lit)); 537 __ mov(result_register(), Operand(lit));
538 codegen()->DoTest(this); 538 codegen()->DoTest(this);
539 } 539 }
540 } 540 }
541 541
542 542
543 void FullCodeGenerator::EffectContext::DropAndPlug(int count,
544 Register reg) const {
545 DCHECK(count > 0);
546 __ Drop(count);
547 }
548
549
550 void FullCodeGenerator::AccumulatorValueContext::DropAndPlug(
551 int count, Register reg) const {
552 DCHECK(count > 0);
553 __ Drop(count);
554 __ Move(result_register(), reg);
555 }
556
557
558 void FullCodeGenerator::StackValueContext::DropAndPlug(int count, 543 void FullCodeGenerator::StackValueContext::DropAndPlug(int count,
559 Register reg) const { 544 Register reg) const {
560 DCHECK(count > 0); 545 DCHECK(count > 0);
561 if (count > 1) __ Drop(count - 1); 546 if (count > 1) __ Drop(count - 1);
562 __ StoreP(reg, MemOperand(sp, 0)); 547 __ StoreP(reg, MemOperand(sp, 0));
563 } 548 }
564 549
565 550
566 void FullCodeGenerator::TestContext::DropAndPlug(int count,
567 Register reg) const {
568 DCHECK(count > 0);
569 // For simplicity we always test the accumulator register.
570 __ Drop(count);
571 __ Move(result_register(), reg);
572 codegen()->PrepareForBailoutBeforeSplit(condition(), false, NULL, NULL);
573 codegen()->DoTest(this);
574 }
575
576
577 void FullCodeGenerator::EffectContext::Plug(Label* materialize_true, 551 void FullCodeGenerator::EffectContext::Plug(Label* materialize_true,
578 Label* materialize_false) const { 552 Label* materialize_false) const {
579 DCHECK(materialize_true == materialize_false); 553 DCHECK(materialize_true == materialize_false);
580 __ bind(materialize_true); 554 __ bind(materialize_true);
581 } 555 }
582 556
583 557
584 void FullCodeGenerator::AccumulatorValueContext::Plug( 558 void FullCodeGenerator::AccumulatorValueContext::Plug(
585 Label* materialize_true, Label* materialize_false) const { 559 Label* materialize_true, Label* materialize_false) const {
586 Label done; 560 Label done;
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after
2069 Literal* key = prop->key()->AsLiteral(); 2043 Literal* key = prop->key()->AsLiteral();
2070 DCHECK(!prop->IsSuperAccess()); 2044 DCHECK(!prop->IsSuperAccess());
2071 2045
2072 __ mov(LoadDescriptor::NameRegister(), Operand(key->value())); 2046 __ mov(LoadDescriptor::NameRegister(), Operand(key->value()));
2073 __ mov(LoadDescriptor::SlotRegister(), 2047 __ mov(LoadDescriptor::SlotRegister(),
2074 Operand(SmiFromSlot(prop->PropertyFeedbackSlot()))); 2048 Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
2075 CallLoadIC(NOT_INSIDE_TYPEOF); 2049 CallLoadIC(NOT_INSIDE_TYPEOF);
2076 } 2050 }
2077 2051
2078 2052
2079 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
2080 // Stack: receiver, home_object.
2081 SetExpressionPosition(prop);
2082 Literal* key = prop->key()->AsLiteral();
2083 DCHECK(!key->value()->IsSmi());
2084 DCHECK(prop->IsSuperAccess());
2085
2086 __ Push(key->value());
2087 __ CallRuntime(Runtime::kLoadFromSuper);
2088 }
2089
2090
2091 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
2092 SetExpressionPosition(prop);
2093 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
2094 __ mov(LoadDescriptor::SlotRegister(),
2095 Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
2096 CallIC(ic);
2097 }
2098
2099
2100 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
2101 // Stack: receiver, home_object, key.
2102 SetExpressionPosition(prop);
2103 __ CallRuntime(Runtime::kLoadKeyedFromSuper);
2104 }
2105
2106
2107 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, 2053 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
2108 Token::Value op, 2054 Token::Value op,
2109 Expression* left_expr, 2055 Expression* left_expr,
2110 Expression* right_expr) { 2056 Expression* right_expr) {
2111 Label done, smi_case, stub_call; 2057 Label done, smi_case, stub_call;
2112 2058
2113 Register scratch1 = r5; 2059 Register scratch1 = r5;
2114 Register scratch2 = r6; 2060 Register scratch2 = r6;
2115 2061
2116 // Get the arguments. 2062 // Get the arguments.
(...skipping 2115 matching lines...) Expand 10 before | Expand all | Expand 10 after
4232 return ON_STACK_REPLACEMENT; 4178 return ON_STACK_REPLACEMENT;
4233 } 4179 }
4234 4180
4235 DCHECK(interrupt_address == 4181 DCHECK(interrupt_address ==
4236 isolate->builtins()->OsrAfterStackCheck()->entry()); 4182 isolate->builtins()->OsrAfterStackCheck()->entry());
4237 return OSR_AFTER_STACK_CHECK; 4183 return OSR_AFTER_STACK_CHECK;
4238 } 4184 }
4239 } // namespace internal 4185 } // namespace internal
4240 } // namespace v8 4186 } // namespace v8
4241 #endif // V8_TARGET_ARCH_PPC 4187 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698