Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 3116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3127 Comment cmnt(masm_, "[ Assignment"); | 3127 Comment cmnt(masm_, "[ Assignment"); |
| 3128 CodeForStatementPosition(node); | 3128 CodeForStatementPosition(node); |
| 3129 | 3129 |
| 3130 { Reference target(this, node->target()); | 3130 { Reference target(this, node->target()); |
| 3131 if (target.is_illegal()) { | 3131 if (target.is_illegal()) { |
| 3132 // Fool the virtual frame into thinking that we left the assignment's | 3132 // Fool the virtual frame into thinking that we left the assignment's |
| 3133 // value on the frame. | 3133 // value on the frame. |
| 3134 frame_->Push(Smi::FromInt(0)); | 3134 frame_->Push(Smi::FromInt(0)); |
| 3135 return; | 3135 return; |
| 3136 } | 3136 } |
| 3137 Variable* var = node->target()->AsVariableProxy()->AsVariable(); | |
| 3137 | 3138 |
| 3138 if (node->op() == Token::ASSIGN || | 3139 if (node->op() == Token::ASSIGN || |
| 3139 node->op() == Token::INIT_VAR || | 3140 node->op() == Token::INIT_VAR || |
| 3140 node->op() == Token::INIT_CONST) { | 3141 node->op() == Token::INIT_CONST) { |
| 3141 Load(node->value()); | 3142 Load(node->value()); |
| 3142 | 3143 |
| 3143 } else { | 3144 } else { |
| 3144 VirtualFrame::SpilledScope spilled_scope(this); | 3145 // VirtualFrame::SpilledScope spilled_scope(this); |
|
Kevin Millikin (Chromium)
2009/02/03 09:48:55
Remove code rather than commenting it out.
| |
| 3145 target.GetValueAndSpill(NOT_INSIDE_TYPEOF); | |
| 3146 Literal* literal = node->value()->AsLiteral(); | 3146 Literal* literal = node->value()->AsLiteral(); |
| 3147 Variable* right_var = node->value()->AsVariableProxy()->AsVariable(); | |
| 3148 if (literal != NULL || (right_var != NULL && right_var != var)) { | |
|
Kevin Millikin (Chromium)
2009/02/03 09:48:55
This needs a simple comment saying what you are do
| |
| 3149 target.TakeValue(NOT_INSIDE_TYPEOF); | |
| 3150 } else { | |
| 3151 target.GetValue(NOT_INSIDE_TYPEOF); | |
| 3152 } | |
| 3147 if (IsInlineSmi(literal)) { | 3153 if (IsInlineSmi(literal)) { |
| 3148 SmiOperation(node->binary_op(), node->type(), literal->handle(), false, | 3154 SmiOperation(node->binary_op(), node->type(), literal->handle(), false, |
| 3149 NO_OVERWRITE); | 3155 NO_OVERWRITE); |
| 3150 } else { | 3156 } else { |
| 3151 LoadAndSpill(node->value()); | 3157 Load(node->value()); |
| 3152 GenericBinaryOperation(node->binary_op(), node->type()); | 3158 GenericBinaryOperation(node->binary_op(), node->type()); |
| 3153 } | 3159 } |
| 3154 } | 3160 } |
| 3155 | 3161 |
| 3156 Variable* var = node->target()->AsVariableProxy()->AsVariable(); | |
| 3157 if (var != NULL && | 3162 if (var != NULL && |
| 3158 var->mode() == Variable::CONST && | 3163 var->mode() == Variable::CONST && |
| 3159 node->op() != Token::INIT_VAR && node->op() != Token::INIT_CONST) { | 3164 node->op() != Token::INIT_VAR && node->op() != Token::INIT_CONST) { |
| 3160 // Assignment ignored - leave the value on the stack. | 3165 // Assignment ignored - leave the value on the stack. |
| 3161 } else { | 3166 } else { |
| 3162 CodeForSourcePosition(node->position()); | 3167 CodeForSourcePosition(node->position()); |
| 3163 if (node->op() == Token::INIT_CONST) { | 3168 if (node->op() == Token::INIT_CONST) { |
| 3164 // Dynamic constant initializations must use the function context | 3169 // Dynamic constant initializations must use the function context |
| 3165 // and initialize the actual constant declared. Dynamic variable | 3170 // and initialize the actual constant declared. Dynamic variable |
| 3166 // initializations are simply assignments and use SetValue. | 3171 // initializations are simply assignments and use SetValue. |
| (...skipping 3099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6266 | 6271 |
| 6267 // Slow-case: Go through the JavaScript implementation. | 6272 // Slow-case: Go through the JavaScript implementation. |
| 6268 __ bind(&slow); | 6273 __ bind(&slow); |
| 6269 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 6274 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
| 6270 } | 6275 } |
| 6271 | 6276 |
| 6272 | 6277 |
| 6273 #undef __ | 6278 #undef __ |
| 6274 | 6279 |
| 6275 } } // namespace v8::internal | 6280 } } // namespace v8::internal |
| OLD | NEW |