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/lookup.h" | 5 #include "src/lookup.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
9 #include "src/elements.h" | 9 #include "src/elements.h" |
10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // the wrapper. Hence we can skip generating the wrapper for all other cases. | 122 // the wrapper. Hence we can skip generating the wrapper for all other cases. |
123 if (index != kMaxUInt32 && receiver->IsString() && | 123 if (index != kMaxUInt32 && receiver->IsString() && |
124 index < static_cast<uint32_t>(String::cast(*receiver)->length())) { | 124 index < static_cast<uint32_t>(String::cast(*receiver)->length())) { |
125 // TODO(verwaest): Speed this up. Perhaps use a cached wrapper on the native | 125 // TODO(verwaest): Speed this up. Perhaps use a cached wrapper on the native |
126 // context, ensuring that we don't leak it into JS? | 126 // context, ensuring that we don't leak it into JS? |
127 Handle<JSFunction> constructor = isolate->string_function(); | 127 Handle<JSFunction> constructor = isolate->string_function(); |
128 Handle<JSObject> result = isolate->factory()->NewJSObject(constructor); | 128 Handle<JSObject> result = isolate->factory()->NewJSObject(constructor); |
129 Handle<JSValue>::cast(result)->set_value(*receiver); | 129 Handle<JSValue>::cast(result)->set_value(*receiver); |
130 return result; | 130 return result; |
131 } | 131 } |
132 auto root = handle(receiver->GetRootMap(isolate)->prototype(), isolate); | 132 auto root = |
| 133 handle(receiver->GetPrototypeChainRootMap(isolate)->prototype(), isolate); |
133 if (root->IsNull(isolate)) { | 134 if (root->IsNull(isolate)) { |
134 unsigned int magic = 0xbbbbbbbb; | 135 unsigned int magic = 0xbbbbbbbb; |
135 isolate->PushStackTraceAndDie(magic, *receiver, NULL, magic); | 136 isolate->PushStackTraceAndDie(magic, *receiver, NULL, magic); |
136 } | 137 } |
137 return Handle<JSReceiver>::cast(root); | 138 return Handle<JSReceiver>::cast(root); |
138 } | 139 } |
139 | 140 |
140 | 141 |
141 Handle<Map> LookupIterator::GetReceiverMap() const { | 142 Handle<Map> LookupIterator::GetReceiverMap() const { |
142 if (receiver_->IsNumber()) return factory()->heap_number_map(); | 143 if (receiver_->IsNumber()) return factory()->heap_number_map(); |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 : access_check_info->named_interceptor(); | 837 : access_check_info->named_interceptor(); |
837 if (interceptor) { | 838 if (interceptor) { |
838 return handle(InterceptorInfo::cast(interceptor), isolate_); | 839 return handle(InterceptorInfo::cast(interceptor), isolate_); |
839 } | 840 } |
840 } | 841 } |
841 return Handle<InterceptorInfo>(); | 842 return Handle<InterceptorInfo>(); |
842 } | 843 } |
843 | 844 |
844 } // namespace internal | 845 } // namespace internal |
845 } // namespace v8 | 846 } // namespace v8 |
OLD | NEW |