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/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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
728 PatchCache(name, stub.GetCode()); | 728 PatchCache(name, stub.GetCode()); |
729 } | 729 } |
730 return result; | 730 return result; |
731 } | 731 } |
732 } | 732 } |
733 | 733 |
734 // Named lookup in the object. | 734 // Named lookup in the object. |
735 LookupIterator it(object, name); | 735 LookupIterator it(object, name); |
736 LookupForRead(&it); | 736 LookupForRead(&it); |
737 | 737 |
738 if (it.IsFound() || !IsUndeclaredGlobal(object)) { | 738 if (it.IsFound() || typeof_mode() == INSIDE_TYPEOF) { |
Toon Verwaest
2015/07/10 15:41:31
typeof_mode() == INSIDE_TYPEOF is not the same as
Igor Sheludko
2015/07/13 12:17:09
Done.
| |
739 // Update inline cache and stub cache. | 739 // Update inline cache and stub cache. |
740 if (use_ic) UpdateCaches(&it); | 740 if (use_ic) UpdateCaches(&it); |
741 | 741 |
742 // Get the property. | 742 // Get the property. |
743 Handle<Object> result; | 743 Handle<Object> result; |
744 | 744 |
745 ASSIGN_RETURN_ON_EXCEPTION( | 745 ASSIGN_RETURN_ON_EXCEPTION( |
746 isolate(), result, Object::GetProperty(&it, language_mode()), Object); | 746 isolate(), result, Object::GetProperty(&it, language_mode()), Object); |
747 if (it.IsFound()) { | 747 if (it.IsFound()) { |
748 return result; | 748 return result; |
749 } else if (!IsUndeclaredGlobal(object)) { | 749 } else if (typeof_mode() == INSIDE_TYPEOF) { |
Toon Verwaest
2015/07/10 15:41:31
Same here.
Igor Sheludko
2015/07/13 12:17:09
Done.
| |
750 LOG(isolate(), SuspectReadEvent(*name, *object)); | 750 LOG(isolate(), SuspectReadEvent(*name, *object)); |
751 return result; | 751 return result; |
752 } | 752 } |
753 } | 753 } |
754 return ReferenceError(name); | 754 return ReferenceError(name); |
755 } | 755 } |
756 | 756 |
757 | 757 |
758 static bool AddOneReceiverMapIfMissing(MapHandleList* receiver_maps, | 758 static bool AddOneReceiverMapIfMissing(MapHandleList* receiver_maps, |
759 Handle<Map> new_receiver_map) { | 759 Handle<Map> new_receiver_map) { |
(...skipping 2222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2982 if (done) return *result; | 2982 if (done) return *result; |
2983 return isolate->heap()->no_interceptor_result_sentinel(); | 2983 return isolate->heap()->no_interceptor_result_sentinel(); |
2984 } | 2984 } |
2985 | 2985 |
2986 | 2986 |
2987 static Object* ThrowReferenceError(Isolate* isolate, Name* name) { | 2987 static Object* ThrowReferenceError(Isolate* isolate, Name* name) { |
2988 // If the load is non-contextual, just return the undefined result. | 2988 // If the load is non-contextual, just return the undefined result. |
2989 // Note that both keyed and non-keyed loads may end up here. | 2989 // Note that both keyed and non-keyed loads may end up here. |
2990 HandleScope scope(isolate); | 2990 HandleScope scope(isolate); |
2991 LoadIC ic(IC::NO_EXTRA_FRAME, isolate, true); | 2991 LoadIC ic(IC::NO_EXTRA_FRAME, isolate, true); |
2992 if (ic.contextual_mode() != CONTEXTUAL) { | 2992 if (ic.typeof_mode() == INSIDE_TYPEOF) { |
2993 return isolate->heap()->undefined_value(); | 2993 return isolate->heap()->undefined_value(); |
2994 } | 2994 } |
2995 | 2995 |
2996 // Throw a reference error. | 2996 // Throw a reference error. |
2997 Handle<Name> name_handle(name); | 2997 Handle<Name> name_handle(name); |
2998 THROW_NEW_ERROR_RETURN_FAILURE( | 2998 THROW_NEW_ERROR_RETURN_FAILURE( |
2999 isolate, NewReferenceError(MessageTemplate::kNotDefined, name_handle)); | 2999 isolate, NewReferenceError(MessageTemplate::kNotDefined, name_handle)); |
3000 } | 3000 } |
3001 | 3001 |
3002 | 3002 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3105 static const Address IC_utilities[] = { | 3105 static const Address IC_utilities[] = { |
3106 #define ADDR(name) FUNCTION_ADDR(name), | 3106 #define ADDR(name) FUNCTION_ADDR(name), |
3107 IC_UTIL_LIST(ADDR) NULL | 3107 IC_UTIL_LIST(ADDR) NULL |
3108 #undef ADDR | 3108 #undef ADDR |
3109 }; | 3109 }; |
3110 | 3110 |
3111 | 3111 |
3112 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } | 3112 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } |
3113 } // namespace internal | 3113 } // namespace internal |
3114 } // namespace v8 | 3114 } // namespace v8 |
OLD | NEW |