Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 739 } else { | 739 } else { |
| 740 __ mov(r0, Operand(Smi::FromInt(0))); // No initial value! | 740 __ mov(r0, Operand(Smi::FromInt(0))); // No initial value! |
| 741 __ Push(cp, r2, r1, r0); | 741 __ Push(cp, r2, r1, r0); |
| 742 } | 742 } |
| 743 __ CallRuntime(Runtime::kDeclareContextSlot, 4); | 743 __ CallRuntime(Runtime::kDeclareContextSlot, 4); |
| 744 break; | 744 break; |
| 745 } | 745 } |
| 746 } | 746 } |
| 747 | 747 |
| 748 } else if (prop != NULL) { | 748 } else if (prop != NULL) { |
| 749 if (function != NULL || mode == Variable::CONST) { | 749 // A const declaration aliasing a parameter is a illegal redeclaration. |
|
Kevin Millikin (Chromium)
2011/05/24 14:36:25
"a" ==> "an" :)
| |
| 750 // We are declaring a function or constant that rewrites to a | 750 ASSERT(mode != Variable::CONST); |
| 751 // property. Use (keyed) IC to set the initial value. We | 751 // Do nothing for a regular var declaration. |
| 752 // cannot visit the rewrite because it's shared and we risk | 752 // Store the function for a function declaration. |
|
Kevin Millikin (Chromium)
2011/05/24 14:36:25
This whole function is doing nothing for a regular
| |
| 753 // recording duplicate AST IDs for bailouts from optimized code. | 753 if (function != NULL) { |
| 754 // We are declaring a function that rewrites to a property. | |
| 755 // Use (keyed) IC to set the initial value. We cannot visit the | |
| 756 // rewrite because it's shared and we risk recording duplicate AST | |
| 757 // IDs for bailouts from optimized code. | |
| 754 ASSERT(prop->obj()->AsVariableProxy() != NULL); | 758 ASSERT(prop->obj()->AsVariableProxy() != NULL); |
| 755 { AccumulatorValueContext for_object(this); | 759 { AccumulatorValueContext for_object(this); |
| 756 EmitVariableLoad(prop->obj()->AsVariableProxy()->var()); | 760 EmitVariableLoad(prop->obj()->AsVariableProxy()->var()); |
| 757 } | 761 } |
| 758 if (function != NULL) { | 762 |
| 759 __ push(r0); | 763 __ push(r0); |
| 760 VisitForAccumulatorValue(function); | 764 VisitForAccumulatorValue(function); |
| 761 __ pop(r2); | 765 __ pop(r2); |
| 762 } else { | 766 |
| 763 __ mov(r2, r0); | |
| 764 __ LoadRoot(r0, Heap::kTheHoleValueRootIndex); | |
| 765 } | |
| 766 ASSERT(prop->key()->AsLiteral() != NULL && | 767 ASSERT(prop->key()->AsLiteral() != NULL && |
| 767 prop->key()->AsLiteral()->handle()->IsSmi()); | 768 prop->key()->AsLiteral()->handle()->IsSmi()); |
| 768 __ mov(r1, Operand(prop->key()->AsLiteral()->handle())); | 769 __ mov(r1, Operand(prop->key()->AsLiteral()->handle())); |
| 769 | 770 |
| 770 Handle<Code> ic = is_strict_mode() | 771 Handle<Code> ic = is_strict_mode() |
| 771 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() | 772 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
| 772 : isolate()->builtins()->KeyedStoreIC_Initialize(); | 773 : isolate()->builtins()->KeyedStoreIC_Initialize(); |
| 773 EmitCallIC(ic, RelocInfo::CODE_TARGET, AstNode::kNoNumber); | 774 EmitCallIC(ic, RelocInfo::CODE_TARGET, AstNode::kNoNumber); |
| 774 // Value in r0 is ignored (declarations are statements). | 775 // Value in r0 is ignored (declarations are statements). |
| 775 } | 776 } |
| (...skipping 3574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4350 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 4351 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
| 4351 __ add(pc, r1, Operand(masm_->CodeObject())); | 4352 __ add(pc, r1, Operand(masm_->CodeObject())); |
| 4352 } | 4353 } |
| 4353 | 4354 |
| 4354 | 4355 |
| 4355 #undef __ | 4356 #undef __ |
| 4356 | 4357 |
| 4357 } } // namespace v8::internal | 4358 } } // namespace v8::internal |
| 4358 | 4359 |
| 4359 #endif // V8_TARGET_ARCH_ARM | 4360 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |