OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 5862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5873 DCHECK(!environment->HasBeenRegistered()); | 5873 DCHECK(!environment->HasBeenRegistered()); |
5874 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 5874 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
5875 | 5875 |
5876 GenerateOsrPrologue(); | 5876 GenerateOsrPrologue(); |
5877 } | 5877 } |
5878 | 5878 |
5879 | 5879 |
5880 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { | 5880 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { |
5881 Register result = ToRegister(instr->result()); | 5881 Register result = ToRegister(instr->result()); |
5882 Register object = ToRegister(instr->object()); | 5882 Register object = ToRegister(instr->object()); |
5883 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | |
5884 DeoptimizeIf(eq, instr, Deoptimizer::kUndefined, object, Operand(at)); | |
5885 | |
5886 Register null_value = a5; | |
5887 __ LoadRoot(null_value, Heap::kNullValueRootIndex); | |
5888 DeoptimizeIf(eq, instr, Deoptimizer::kNull, object, Operand(null_value)); | |
5889 | 5883 |
5890 __ And(at, object, kSmiTagMask); | 5884 __ And(at, object, kSmiTagMask); |
5891 DeoptimizeIf(eq, instr, Deoptimizer::kSmi, at, Operand(zero_reg)); | 5885 DeoptimizeIf(eq, instr, Deoptimizer::kSmi, at, Operand(zero_reg)); |
5892 | 5886 |
5893 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 5887 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
5894 __ GetObjectType(object, a1, a1); | 5888 __ GetObjectType(object, a1, a1); |
5895 DeoptimizeIf(le, instr, Deoptimizer::kNotAJavaScriptObject, a1, | 5889 DeoptimizeIf(le, instr, Deoptimizer::kNotAJavaScriptObject, a1, |
5896 Operand(LAST_JS_PROXY_TYPE)); | 5890 Operand(LAST_JS_PROXY_TYPE)); |
5897 | 5891 |
5898 Label use_cache, call_runtime; | 5892 Label use_cache, call_runtime; |
5899 DCHECK(object.is(a0)); | 5893 DCHECK(object.is(a0)); |
| 5894 Register null_value = a5; |
| 5895 __ LoadRoot(null_value, Heap::kNullValueRootIndex); |
5900 __ CheckEnumCache(null_value, &call_runtime); | 5896 __ CheckEnumCache(null_value, &call_runtime); |
5901 | 5897 |
5902 __ ld(result, FieldMemOperand(object, HeapObject::kMapOffset)); | 5898 __ ld(result, FieldMemOperand(object, HeapObject::kMapOffset)); |
5903 __ Branch(&use_cache); | 5899 __ Branch(&use_cache); |
5904 | 5900 |
5905 // Get the set of properties to enumerate. | 5901 // Get the set of properties to enumerate. |
5906 __ bind(&call_runtime); | 5902 __ bind(&call_runtime); |
5907 __ push(object); | 5903 __ push(object); |
5908 CallRuntime(Runtime::kGetPropertyNamesFast, 1, instr); | 5904 CallRuntime(Runtime::kGetPropertyNamesFast, 1, instr); |
5909 | 5905 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6028 __ li(at, scope_info); | 6024 __ li(at, scope_info); |
6029 __ Push(at, ToRegister(instr->function())); | 6025 __ Push(at, ToRegister(instr->function())); |
6030 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6026 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6031 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6027 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6032 } | 6028 } |
6033 | 6029 |
6034 | 6030 |
6035 #undef __ | 6031 #undef __ |
6036 | 6032 |
6037 } } // namespace v8::internal | 6033 } } // namespace v8::internal |
OLD | NEW |