OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.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/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 6017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6028 // If the environment were already registered, we would have no way of | 6028 // If the environment were already registered, we would have no way of |
6029 // backpatching it with the spill slot operands. | 6029 // backpatching it with the spill slot operands. |
6030 DCHECK(!environment->HasBeenRegistered()); | 6030 DCHECK(!environment->HasBeenRegistered()); |
6031 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 6031 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
6032 | 6032 |
6033 GenerateOsrPrologue(); | 6033 GenerateOsrPrologue(); |
6034 } | 6034 } |
6035 | 6035 |
6036 | 6036 |
6037 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { | 6037 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { |
6038 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | |
6039 __ cmp(r3, ip); | |
6040 DeoptimizeIf(eq, instr, Deoptimizer::kUndefined); | |
6041 | |
6042 Register null_value = r8; | |
6043 __ LoadRoot(null_value, Heap::kNullValueRootIndex); | |
6044 __ cmp(r3, null_value); | |
6045 DeoptimizeIf(eq, instr, Deoptimizer::kNull); | |
6046 | |
6047 __ TestIfSmi(r3, r0); | 6038 __ TestIfSmi(r3, r0); |
6048 DeoptimizeIf(eq, instr, Deoptimizer::kSmi, cr0); | 6039 DeoptimizeIf(eq, instr, Deoptimizer::kSmi, cr0); |
6049 | 6040 |
6050 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 6041 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
6051 __ CompareObjectType(r3, r4, r4, LAST_JS_PROXY_TYPE); | 6042 __ CompareObjectType(r3, r4, r4, LAST_JS_PROXY_TYPE); |
6052 DeoptimizeIf(le, instr, Deoptimizer::kWrongInstanceType); | 6043 DeoptimizeIf(le, instr, Deoptimizer::kWrongInstanceType); |
6053 | 6044 |
6054 Label use_cache, call_runtime; | 6045 Label use_cache, call_runtime; |
| 6046 Register null_value = r8; |
| 6047 __ LoadRoot(null_value, Heap::kNullValueRootIndex); |
6055 __ CheckEnumCache(null_value, &call_runtime); | 6048 __ CheckEnumCache(null_value, &call_runtime); |
6056 | 6049 |
6057 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); | 6050 __ LoadP(r3, FieldMemOperand(r3, HeapObject::kMapOffset)); |
6058 __ b(&use_cache); | 6051 __ b(&use_cache); |
6059 | 6052 |
6060 // Get the set of properties to enumerate. | 6053 // Get the set of properties to enumerate. |
6061 __ bind(&call_runtime); | 6054 __ bind(&call_runtime); |
6062 __ push(r3); | 6055 __ push(r3); |
6063 CallRuntime(Runtime::kGetPropertyNamesFast, 1, instr); | 6056 CallRuntime(Runtime::kGetPropertyNamesFast, 1, instr); |
6064 | 6057 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6182 __ Push(scope_info); | 6175 __ Push(scope_info); |
6183 __ push(ToRegister(instr->function())); | 6176 __ push(ToRegister(instr->function())); |
6184 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6177 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6185 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6178 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6186 } | 6179 } |
6187 | 6180 |
6188 | 6181 |
6189 #undef __ | 6182 #undef __ |
6190 } | 6183 } |
6191 } // namespace v8::internal | 6184 } // namespace v8::internal |
OLD | NEW |