| 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 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 | 873 |
| 874 | 874 |
| 875 void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { | 875 void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
| 876 Comment cmnt(masm_, "[ ForInStatement"); | 876 Comment cmnt(masm_, "[ ForInStatement"); |
| 877 SetStatementPosition(stmt); | 877 SetStatementPosition(stmt); |
| 878 | 878 |
| 879 Label loop, exit; | 879 Label loop, exit; |
| 880 ForIn loop_statement(this, stmt); | 880 ForIn loop_statement(this, stmt); |
| 881 increment_loop_depth(); | 881 increment_loop_depth(); |
| 882 | 882 |
| 883 // Load null value as it is used several times below. | |
| 884 Register null_value = r5; | |
| 885 __ LoadRoot(null_value, Heap::kNullValueRootIndex); | |
| 886 | |
| 887 // Get the object to enumerate over. Both SpiderMonkey and JSC | 883 // Get the object to enumerate over. Both SpiderMonkey and JSC |
| 888 // ignore null and undefined in contrast to the specification; see | 884 // ignore null and undefined in contrast to the specification; see |
| 889 // ECMA-262 section 12.6.4. | 885 // ECMA-262 section 12.6.4. |
| 890 VisitForAccumulatorValue(stmt->enumerable()); | 886 VisitForAccumulatorValue(stmt->enumerable()); |
| 891 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 887 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
| 892 __ cmp(r0, ip); | 888 __ cmp(r0, ip); |
| 893 __ b(eq, &exit); | 889 __ b(eq, &exit); |
| 890 Register null_value = r5; |
| 891 __ LoadRoot(null_value, Heap::kNullValueRootIndex); |
| 894 __ cmp(r0, null_value); | 892 __ cmp(r0, null_value); |
| 895 __ b(eq, &exit); | 893 __ b(eq, &exit); |
| 896 | 894 |
| 897 // Convert the object to a JS object. | 895 // Convert the object to a JS object. |
| 898 Label convert, done_convert; | 896 Label convert, done_convert; |
| 899 __ JumpIfSmi(r0, &convert); | 897 __ JumpIfSmi(r0, &convert); |
| 900 __ CompareObjectType(r0, r1, r1, FIRST_JS_OBJECT_TYPE); | 898 __ CompareObjectType(r0, r1, r1, FIRST_JS_OBJECT_TYPE); |
| 901 __ b(hs, &done_convert); | 899 __ b(hs, &done_convert); |
| 902 __ bind(&convert); | 900 __ bind(&convert); |
| 903 __ push(r0); | 901 __ push(r0); |
| (...skipping 3199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4103 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 4101 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
| 4104 __ add(pc, r1, Operand(masm_->CodeObject())); | 4102 __ add(pc, r1, Operand(masm_->CodeObject())); |
| 4105 } | 4103 } |
| 4106 | 4104 |
| 4107 | 4105 |
| 4108 #undef __ | 4106 #undef __ |
| 4109 | 4107 |
| 4110 } } // namespace v8::internal | 4108 } } // namespace v8::internal |
| 4111 | 4109 |
| 4112 #endif // V8_TARGET_ARCH_ARM | 4110 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |