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

Side by Side Diff: src/full-codegen/x87/full-codegen-x87.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, 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
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_X87 5 #if V8_TARGET_ARCH_X87
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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 if (true_label_ != fall_through_) __ jmp(true_label_); 500 if (true_label_ != fall_through_) __ jmp(true_label_);
501 } 501 }
502 } else { 502 } else {
503 // For simplicity we always test the accumulator register. 503 // For simplicity we always test the accumulator register.
504 __ mov(result_register(), lit); 504 __ mov(result_register(), lit);
505 codegen()->DoTest(this); 505 codegen()->DoTest(this);
506 } 506 }
507 } 507 }
508 508
509 509
510 void FullCodeGenerator::EffectContext::DropAndPlug(int count,
511 Register reg) const {
512 DCHECK(count > 0);
513 __ Drop(count);
514 }
515
516
517 void FullCodeGenerator::AccumulatorValueContext::DropAndPlug(
518 int count,
519 Register reg) const {
520 DCHECK(count > 0);
521 __ Drop(count);
522 __ Move(result_register(), reg);
523 }
524
525
526 void FullCodeGenerator::StackValueContext::DropAndPlug(int count, 510 void FullCodeGenerator::StackValueContext::DropAndPlug(int count,
527 Register reg) const { 511 Register reg) const {
528 DCHECK(count > 0); 512 DCHECK(count > 0);
529 if (count > 1) __ Drop(count - 1); 513 if (count > 1) __ Drop(count - 1);
530 __ mov(Operand(esp, 0), reg); 514 __ mov(Operand(esp, 0), reg);
531 } 515 }
532 516
533 517
534 void FullCodeGenerator::TestContext::DropAndPlug(int count,
535 Register reg) const {
536 DCHECK(count > 0);
537 // For simplicity we always test the accumulator register.
538 __ Drop(count);
539 __ Move(result_register(), reg);
540 codegen()->PrepareForBailoutBeforeSplit(condition(), false, NULL, NULL);
541 codegen()->DoTest(this);
542 }
543
544
545 void FullCodeGenerator::EffectContext::Plug(Label* materialize_true, 518 void FullCodeGenerator::EffectContext::Plug(Label* materialize_true,
546 Label* materialize_false) const { 519 Label* materialize_false) const {
547 DCHECK(materialize_true == materialize_false); 520 DCHECK(materialize_true == materialize_false);
548 __ bind(materialize_true); 521 __ bind(materialize_true);
549 } 522 }
550 523
551 524
552 void FullCodeGenerator::AccumulatorValueContext::Plug( 525 void FullCodeGenerator::AccumulatorValueContext::Plug(
553 Label* materialize_true, 526 Label* materialize_true,
554 Label* materialize_false) const { 527 Label* materialize_false) const {
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1998 DCHECK(!key->value()->IsSmi()); 1971 DCHECK(!key->value()->IsSmi());
1999 DCHECK(!prop->IsSuperAccess()); 1972 DCHECK(!prop->IsSuperAccess());
2000 1973
2001 __ mov(LoadDescriptor::NameRegister(), Immediate(key->value())); 1974 __ mov(LoadDescriptor::NameRegister(), Immediate(key->value()));
2002 __ mov(LoadDescriptor::SlotRegister(), 1975 __ mov(LoadDescriptor::SlotRegister(),
2003 Immediate(SmiFromSlot(prop->PropertyFeedbackSlot()))); 1976 Immediate(SmiFromSlot(prop->PropertyFeedbackSlot())));
2004 CallLoadIC(NOT_INSIDE_TYPEOF); 1977 CallLoadIC(NOT_INSIDE_TYPEOF);
2005 } 1978 }
2006 1979
2007 1980
2008 void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
2009 // Stack: receiver, home_object.
2010 SetExpressionPosition(prop);
2011 Literal* key = prop->key()->AsLiteral();
2012 DCHECK(!key->value()->IsSmi());
2013 DCHECK(prop->IsSuperAccess());
2014
2015 __ push(Immediate(key->value()));
2016 __ CallRuntime(Runtime::kLoadFromSuper);
2017 }
2018
2019
2020 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
2021 SetExpressionPosition(prop);
2022 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code();
2023 __ mov(LoadDescriptor::SlotRegister(),
2024 Immediate(SmiFromSlot(prop->PropertyFeedbackSlot())));
2025 CallIC(ic);
2026 }
2027
2028
2029 void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
2030 // Stack: receiver, home_object, key.
2031 SetExpressionPosition(prop);
2032 __ CallRuntime(Runtime::kLoadKeyedFromSuper);
2033 }
2034
2035
2036 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, 1981 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
2037 Token::Value op, 1982 Token::Value op,
2038 Expression* left, 1983 Expression* left,
2039 Expression* right) { 1984 Expression* right) {
2040 // Do combined smi check of the operands. Left operand is on the 1985 // Do combined smi check of the operands. Left operand is on the
2041 // stack. Right operand is in eax. 1986 // stack. Right operand is in eax.
2042 Label smi_case, done, stub_call; 1987 Label smi_case, done, stub_call;
2043 __ pop(edx); 1988 __ pop(edx);
2044 __ mov(ecx, eax); 1989 __ mov(ecx, eax);
2045 __ or_(eax, edx); 1990 __ or_(eax, edx);
(...skipping 2104 matching lines...) Expand 10 before | Expand all | Expand 10 after
4150 Assembler::target_address_at(call_target_address, 4095 Assembler::target_address_at(call_target_address,
4151 unoptimized_code)); 4096 unoptimized_code));
4152 return OSR_AFTER_STACK_CHECK; 4097 return OSR_AFTER_STACK_CHECK;
4153 } 4098 }
4154 4099
4155 4100
4156 } // namespace internal 4101 } // namespace internal
4157 } // namespace v8 4102 } // namespace v8
4158 4103
4159 #endif // V8_TARGET_ARCH_X87 4104 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698