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/messages.h" | 10 #include "src/messages.h" |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 object = Handle<JSReceiver>(context->global_object()); | 1075 object = Handle<JSReceiver>(context->global_object()); |
1076 } | 1076 } |
1077 | 1077 |
1078 RETURN_FAILURE_ON_EXCEPTION( | 1078 RETURN_FAILURE_ON_EXCEPTION( |
1079 isolate, Object::SetProperty(object, name, value, language_mode)); | 1079 isolate, Object::SetProperty(object, name, value, language_mode)); |
1080 | 1080 |
1081 return *value; | 1081 return *value; |
1082 } | 1082 } |
1083 | 1083 |
1084 | 1084 |
1085 RUNTIME_FUNCTION(Runtime_GetArgumentsProperty) { | 1085 RUNTIME_FUNCTION(Runtime_ArgumentsLength) { |
| 1086 SealHandleScope shs(isolate); |
| 1087 DCHECK(args.length() == 0); |
| 1088 JavaScriptFrameIterator it(isolate); |
| 1089 JavaScriptFrame* frame = it.frame(); |
| 1090 return Smi::FromInt(frame->GetArgumentsLength()); |
| 1091 } |
| 1092 |
| 1093 |
| 1094 RUNTIME_FUNCTION(Runtime_Arguments) { |
1086 SealHandleScope shs(isolate); | 1095 SealHandleScope shs(isolate); |
1087 DCHECK(args.length() == 1); | 1096 DCHECK(args.length() == 1); |
1088 CONVERT_ARG_HANDLE_CHECKED(Object, raw_key, 0); | 1097 CONVERT_ARG_HANDLE_CHECKED(Object, raw_key, 0); |
1089 | 1098 |
1090 // Compute the frame holding the arguments. | 1099 // Compute the frame holding the arguments. |
1091 JavaScriptFrameIterator it(isolate); | 1100 JavaScriptFrameIterator it(isolate); |
1092 it.AdvanceToArgumentsFrame(); | 1101 it.AdvanceToArgumentsFrame(); |
1093 JavaScriptFrame* frame = it.frame(); | 1102 JavaScriptFrame* frame = it.frame(); |
1094 | 1103 |
1095 // Get the actual number of provided arguments. | 1104 // Get the actual number of provided arguments. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 return function; | 1159 return function; |
1151 } | 1160 } |
1152 | 1161 |
1153 // Lookup in the initial Object.prototype object. | 1162 // Lookup in the initial Object.prototype object. |
1154 Handle<Object> result; | 1163 Handle<Object> result; |
1155 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 1164 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
1156 isolate, result, | 1165 isolate, result, |
1157 Object::GetProperty(isolate->initial_object_prototype(), key)); | 1166 Object::GetProperty(isolate->initial_object_prototype(), key)); |
1158 return *result; | 1167 return *result; |
1159 } | 1168 } |
1160 | |
1161 | |
1162 RUNTIME_FUNCTION(Runtime_ArgumentsLength) { | |
1163 SealHandleScope shs(isolate); | |
1164 DCHECK(args.length() == 0); | |
1165 JavaScriptFrameIterator it(isolate); | |
1166 JavaScriptFrame* frame = it.frame(); | |
1167 return Smi::FromInt(frame->GetArgumentsLength()); | |
1168 } | |
1169 | |
1170 | |
1171 RUNTIME_FUNCTION(Runtime_Arguments) { | |
1172 SealHandleScope shs(isolate); | |
1173 return __RT_impl_Runtime_GetArgumentsProperty(args, isolate); | |
1174 } | |
1175 } // namespace internal | 1169 } // namespace internal |
1176 } // namespace v8 | 1170 } // namespace v8 |
OLD | NEW |