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/ic/ic.h" | 5 #include "src/ic/ic.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 2795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2806 CHECK(false); | 2806 CHECK(false); |
2807 return isolate->heap()->undefined_value(); | 2807 return isolate->heap()->undefined_value(); |
2808 } | 2808 } |
2809 | 2809 |
2810 | 2810 |
2811 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { | 2811 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { |
2812 ToBooleanStub stub(isolate(), target()->extra_ic_state()); | 2812 ToBooleanStub stub(isolate(), target()->extra_ic_state()); |
2813 bool to_boolean_value = stub.UpdateStatus(object); | 2813 bool to_boolean_value = stub.UpdateStatus(object); |
2814 Handle<Code> code = stub.GetCode(); | 2814 Handle<Code> code = stub.GetCode(); |
2815 set_target(*code); | 2815 set_target(*code); |
2816 return handle(Smi::FromInt(to_boolean_value ? 1 : 0), isolate()); | 2816 return isolate()->factory()->ToBoolean(to_boolean_value); |
2817 } | 2817 } |
2818 | 2818 |
2819 | 2819 |
2820 RUNTIME_FUNCTION(Runtime_ToBooleanIC_Miss) { | 2820 RUNTIME_FUNCTION(Runtime_ToBooleanIC_Miss) { |
2821 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2821 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2822 DCHECK(args.length() == 1); | 2822 DCHECK(args.length() == 1); |
2823 HandleScope scope(isolate); | 2823 HandleScope scope(isolate); |
2824 Handle<Object> object = args.at<Object>(0); | 2824 Handle<Object> object = args.at<Object>(0); |
2825 ToBooleanIC ic(isolate); | 2825 ToBooleanIC ic(isolate); |
2826 return *ic.ToBoolean(object); | 2826 return *ic.ToBoolean(object); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2990 KeyedLoadICNexus nexus(vector, vector_slot); | 2990 KeyedLoadICNexus nexus(vector, vector_slot); |
2991 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2991 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2992 ic.UpdateState(receiver, key); | 2992 ic.UpdateState(receiver, key); |
2993 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 2993 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
2994 } | 2994 } |
2995 | 2995 |
2996 return *result; | 2996 return *result; |
2997 } | 2997 } |
2998 } // namespace internal | 2998 } // namespace internal |
2999 } // namespace v8 | 2999 } // namespace v8 |
OLD | NEW |