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 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 // Try to convert the key to an index. If successful and within | 999 // Try to convert the key to an index. If successful and within |
1000 // index return the the argument from the frame. | 1000 // index return the the argument from the frame. |
1001 uint32_t index; | 1001 uint32_t index; |
1002 if (raw_key->ToArrayIndex(&index) && index < n) { | 1002 if (raw_key->ToArrayIndex(&index) && index < n) { |
1003 return frame->GetParameter(index); | 1003 return frame->GetParameter(index); |
1004 } | 1004 } |
1005 | 1005 |
1006 HandleScope scope(isolate); | 1006 HandleScope scope(isolate); |
1007 if (raw_key->IsSymbol()) { | 1007 if (raw_key->IsSymbol()) { |
1008 Handle<Symbol> symbol = Handle<Symbol>::cast(raw_key); | 1008 Handle<Symbol> symbol = Handle<Symbol>::cast(raw_key); |
1009 if (symbol->Equals(isolate->native_context()->iterator_symbol())) { | 1009 if (Name::Equals(symbol, isolate->factory()->iterator_symbol())) { |
1010 return isolate->native_context()->array_values_iterator(); | 1010 return isolate->native_context()->array_values_iterator(); |
1011 } | 1011 } |
1012 // Lookup in the initial Object.prototype object. | 1012 // Lookup in the initial Object.prototype object. |
1013 Handle<Object> result; | 1013 Handle<Object> result; |
1014 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 1014 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
1015 isolate, result, | 1015 isolate, result, |
1016 Object::GetProperty(isolate->initial_object_prototype(), | 1016 Object::GetProperty(isolate->initial_object_prototype(), |
1017 Handle<Symbol>::cast(raw_key))); | 1017 Handle<Symbol>::cast(raw_key))); |
1018 return *result; | 1018 return *result; |
1019 } | 1019 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 return Smi::FromInt(frame->GetArgumentsLength()); | 1069 return Smi::FromInt(frame->GetArgumentsLength()); |
1070 } | 1070 } |
1071 | 1071 |
1072 | 1072 |
1073 RUNTIME_FUNCTION(RuntimeReference_Arguments) { | 1073 RUNTIME_FUNCTION(RuntimeReference_Arguments) { |
1074 SealHandleScope shs(isolate); | 1074 SealHandleScope shs(isolate); |
1075 return __RT_impl_Runtime_GetArgumentsProperty(args, isolate); | 1075 return __RT_impl_Runtime_GetArgumentsProperty(args, isolate); |
1076 } | 1076 } |
1077 } | 1077 } |
1078 } // namespace v8::internal | 1078 } // namespace v8::internal |
OLD | NEW |