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

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

Issue 10832157: Unify handling of bailout IDs for property loads. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Incorporated review comments. Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/hydrogen.cc ('k') | src/mips/full-codegen-mips.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after
1784 if (expr->is_compound()) { 1784 if (expr->is_compound()) {
1785 AccumulatorValueContext result_context(this); 1785 AccumulatorValueContext result_context(this);
1786 { AccumulatorValueContext left_operand_context(this); 1786 { AccumulatorValueContext left_operand_context(this);
1787 switch (assign_type) { 1787 switch (assign_type) {
1788 case VARIABLE: 1788 case VARIABLE:
1789 EmitVariableLoad(expr->target()->AsVariableProxy()); 1789 EmitVariableLoad(expr->target()->AsVariableProxy());
1790 PrepareForBailout(expr->target(), TOS_REG); 1790 PrepareForBailout(expr->target(), TOS_REG);
1791 break; 1791 break;
1792 case NAMED_PROPERTY: 1792 case NAMED_PROPERTY:
1793 EmitNamedPropertyLoad(property); 1793 EmitNamedPropertyLoad(property);
1794 PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG); 1794 PrepareForBailoutForId(property->LoadId(), TOS_REG);
1795 break; 1795 break;
1796 case KEYED_PROPERTY: 1796 case KEYED_PROPERTY:
1797 EmitKeyedPropertyLoad(property); 1797 EmitKeyedPropertyLoad(property);
1798 PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG); 1798 PrepareForBailoutForId(property->LoadId(), TOS_REG);
1799 break; 1799 break;
1800 } 1800 }
1801 } 1801 }
1802 1802
1803 Token::Value op = expr->binary_op(); 1803 Token::Value op = expr->binary_op();
1804 __ push(eax); // Left operand goes on the stack. 1804 __ push(eax); // Left operand goes on the stack.
1805 VisitForAccumulatorValue(expr->value()); 1805 VisitForAccumulatorValue(expr->value());
1806 1806
1807 OverwriteMode mode = expr->value()->ResultOverwriteAllowed() 1807 OverwriteMode mode = expr->value()->ResultOverwriteAllowed()
1808 ? OVERWRITE_RIGHT 1808 ? OVERWRITE_RIGHT
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
2209 2209
2210 2210
2211 void FullCodeGenerator::VisitProperty(Property* expr) { 2211 void FullCodeGenerator::VisitProperty(Property* expr) {
2212 Comment cmnt(masm_, "[ Property"); 2212 Comment cmnt(masm_, "[ Property");
2213 Expression* key = expr->key(); 2213 Expression* key = expr->key();
2214 2214
2215 if (key->IsPropertyName()) { 2215 if (key->IsPropertyName()) {
2216 VisitForAccumulatorValue(expr->obj()); 2216 VisitForAccumulatorValue(expr->obj());
2217 __ mov(edx, result_register()); 2217 __ mov(edx, result_register());
2218 EmitNamedPropertyLoad(expr); 2218 EmitNamedPropertyLoad(expr);
2219 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); 2219 PrepareForBailoutForId(expr->LoadId(), TOS_REG);
2220 context()->Plug(eax); 2220 context()->Plug(eax);
2221 } else { 2221 } else {
2222 VisitForStackValue(expr->obj()); 2222 VisitForStackValue(expr->obj());
2223 VisitForAccumulatorValue(expr->key()); 2223 VisitForAccumulatorValue(expr->key());
2224 __ pop(edx); // Object. 2224 __ pop(edx); // Object.
2225 __ mov(ecx, result_register()); // Key. 2225 __ mov(ecx, result_register()); // Key.
2226 EmitKeyedPropertyLoad(expr); 2226 EmitKeyedPropertyLoad(expr);
2227 context()->Plug(eax); 2227 context()->Plug(eax);
2228 } 2228 }
2229 } 2229 }
(...skipping 1796 matching lines...) Expand 10 before | Expand all | Expand 10 after
4026 __ mov(ecx, Operand(esp, 0)); // Key. 4026 __ mov(ecx, Operand(esp, 0)); // Key.
4027 EmitKeyedPropertyLoad(prop); 4027 EmitKeyedPropertyLoad(prop);
4028 } 4028 }
4029 } 4029 }
4030 4030
4031 // We need a second deoptimization point after loading the value 4031 // We need a second deoptimization point after loading the value
4032 // in case evaluating the property load my have a side effect. 4032 // in case evaluating the property load my have a side effect.
4033 if (assign_type == VARIABLE) { 4033 if (assign_type == VARIABLE) {
4034 PrepareForBailout(expr->expression(), TOS_REG); 4034 PrepareForBailout(expr->expression(), TOS_REG);
4035 } else { 4035 } else {
4036 PrepareForBailoutForId(expr->CountId(), TOS_REG); 4036 PrepareForBailoutForId(prop->LoadId(), TOS_REG);
4037 } 4037 }
4038 4038
4039 // Call ToNumber only if operand is not a smi. 4039 // Call ToNumber only if operand is not a smi.
4040 Label no_conversion; 4040 Label no_conversion;
4041 if (ShouldInlineSmiCase(expr->op())) { 4041 if (ShouldInlineSmiCase(expr->op())) {
4042 __ JumpIfSmi(eax, &no_conversion, Label::kNear); 4042 __ JumpIfSmi(eax, &no_conversion, Label::kNear);
4043 } 4043 }
4044 ToNumberStub convert_stub; 4044 ToNumberStub convert_stub;
4045 __ CallStub(&convert_stub); 4045 __ CallStub(&convert_stub);
4046 __ bind(&no_conversion); 4046 __ bind(&no_conversion);
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
4544 *stack_depth = 0; 4544 *stack_depth = 0;
4545 *context_length = 0; 4545 *context_length = 0;
4546 return previous_; 4546 return previous_;
4547 } 4547 }
4548 4548
4549 #undef __ 4549 #undef __
4550 4550
4551 } } // namespace v8::internal 4551 } } // namespace v8::internal
4552 4552
4553 #endif // V8_TARGET_ARCH_IA32 4553 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698