| 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/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
| 9 #include "src/frames-inl.h" | 9 #include "src/frames-inl.h" |
| 10 #include "src/runtime/runtime-utils.h" | 10 #include "src/runtime/runtime-utils.h" |
| (...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 static Object* ComputeReceiverForNonGlobal(Isolate* isolate, JSObject* holder) { | 856 static Object* ComputeReceiverForNonGlobal(Isolate* isolate, JSObject* holder) { |
| 857 DCHECK(!holder->IsGlobalObject()); | 857 DCHECK(!holder->IsGlobalObject()); |
| 858 Context* top = isolate->context(); | 858 Context* top = isolate->context(); |
| 859 // Get the context extension function. | 859 // Get the context extension function. |
| 860 JSFunction* context_extension_function = | 860 JSFunction* context_extension_function = |
| 861 top->native_context()->context_extension_function(); | 861 top->native_context()->context_extension_function(); |
| 862 // If the holder isn't a context extension object, we just return it | 862 // If the holder isn't a context extension object, we just return it |
| 863 // as the receiver. This allows arguments objects to be used as | 863 // as the receiver. This allows arguments objects to be used as |
| 864 // receivers, but only if they are put in the context scope chain | 864 // receivers, but only if they are put in the context scope chain |
| 865 // explicitly via a with-statement. | 865 // explicitly via a with-statement. |
| 866 Object* constructor = holder->map()->constructor(); | 866 Object* constructor = holder->map()->GetConstructor(); |
| 867 if (constructor != context_extension_function) return holder; | 867 if (constructor != context_extension_function) return holder; |
| 868 // Fall back to using the global object as the implicit receiver if | 868 // Fall back to using the global object as the implicit receiver if |
| 869 // the property turns out to be a local variable allocated in a | 869 // the property turns out to be a local variable allocated in a |
| 870 // context extension object - introduced via eval. | 870 // context extension object - introduced via eval. |
| 871 return isolate->heap()->undefined_value(); | 871 return isolate->heap()->undefined_value(); |
| 872 } | 872 } |
| 873 | 873 |
| 874 | 874 |
| 875 static ObjectPair LoadLookupSlotHelper(Arguments args, Isolate* isolate, | 875 static ObjectPair LoadLookupSlotHelper(Arguments args, Isolate* isolate, |
| 876 bool throw_error) { | 876 bool throw_error) { |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1122 return Smi::FromInt(frame->GetArgumentsLength()); | 1122 return Smi::FromInt(frame->GetArgumentsLength()); |
| 1123 } | 1123 } |
| 1124 | 1124 |
| 1125 | 1125 |
| 1126 RUNTIME_FUNCTION(RuntimeReference_Arguments) { | 1126 RUNTIME_FUNCTION(RuntimeReference_Arguments) { |
| 1127 SealHandleScope shs(isolate); | 1127 SealHandleScope shs(isolate); |
| 1128 return __RT_impl_Runtime_GetArgumentsProperty(args, isolate); | 1128 return __RT_impl_Runtime_GetArgumentsProperty(args, isolate); |
| 1129 } | 1129 } |
| 1130 } | 1130 } |
| 1131 } // namespace v8::internal | 1131 } // namespace v8::internal |
| OLD | NEW |