Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(768)

Side by Side Diff: src/runtime.cc

Issue 342453002: Arguments object has @@iterator (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 6072 matching lines...) Expand 10 before | Expand all | Expand 10 after
6083 6083
6084 // Try to convert the key to an index. If successful and within 6084 // Try to convert the key to an index. If successful and within
6085 // index return the the argument from the frame. 6085 // index return the the argument from the frame.
6086 uint32_t index; 6086 uint32_t index;
6087 if (raw_key->ToArrayIndex(&index) && index < n) { 6087 if (raw_key->ToArrayIndex(&index) && index < n) {
6088 return frame->GetParameter(index); 6088 return frame->GetParameter(index);
6089 } 6089 }
6090 6090
6091 HandleScope scope(isolate); 6091 HandleScope scope(isolate);
6092 if (raw_key->IsSymbol()) { 6092 if (raw_key->IsSymbol()) {
6093 Handle<Symbol> symbol = Handle<Symbol>::cast(raw_key);
6094 if (FLAG_harmony_iteration &&
6095 symbol->Equals(isolate->native_context()->iterator_symbol())) {
6096 return isolate->native_context()->array_values_iterator();
6097 }
6093 // Lookup in the initial Object.prototype object. 6098 // Lookup in the initial Object.prototype object.
6094 Handle<Object> result; 6099 Handle<Object> result;
6095 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 6100 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
6096 isolate, result, 6101 isolate, result,
6097 Object::GetProperty(isolate->initial_object_prototype(), 6102 Object::GetProperty(isolate->initial_object_prototype(),
6098 Handle<Symbol>::cast(raw_key))); 6103 Handle<Symbol>::cast(raw_key)));
6099 return *result; 6104 return *result;
6100 } 6105 }
6101 6106
6102 // Convert the key to a string. 6107 // Convert the key to a string.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
6134 6139
6135 // Lookup in the initial Object.prototype object. 6140 // Lookup in the initial Object.prototype object.
6136 Handle<Object> result; 6141 Handle<Object> result;
6137 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 6142 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
6138 isolate, result, 6143 isolate, result,
6139 Object::GetProperty(isolate->initial_object_prototype(), key)); 6144 Object::GetProperty(isolate->initial_object_prototype(), key));
6140 return *result; 6145 return *result;
6141 } 6146 }
6142 6147
6143 6148
6149 RUNTIME_FUNCTION(Runtime_GetArgumentsBoilerplateObject) {
6150 HandleScope scope(isolate);
6151 ASSERT(args.length() == 1);
6152 CONVERT_SMI_ARG_CHECKED(index, 0);
6153 RUNTIME_ASSERT(isolate->bootstrapper()->IsActive());
6154
6155 switch (index) {
6156 case 0:
6157 return isolate->native_context()->sloppy_arguments_boilerplate();
6158 case 1:
6159 return isolate->native_context()->aliased_arguments_boilerplate();
6160 case 2:
6161 return isolate->native_context()->strict_arguments_boilerplate();
6162 default:
6163 return isolate->ThrowIllegalOperation();
6164 }
6165 }
6166
6167
6144 RUNTIME_FUNCTION(Runtime_ToFastProperties) { 6168 RUNTIME_FUNCTION(Runtime_ToFastProperties) {
6145 HandleScope scope(isolate); 6169 HandleScope scope(isolate);
6146 ASSERT(args.length() == 1); 6170 ASSERT(args.length() == 1);
6147 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); 6171 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
6148 if (object->IsJSObject() && !object->IsGlobalObject()) { 6172 if (object->IsJSObject() && !object->IsGlobalObject()) {
6149 JSObject::TransformToFastProperties(Handle<JSObject>::cast(object), 0); 6173 JSObject::TransformToFastProperties(Handle<JSObject>::cast(object), 0);
6150 } 6174 }
6151 return *object; 6175 return *object;
6152 } 6176 }
6153 6177
(...skipping 9057 matching lines...) Expand 10 before | Expand all | Expand 10 after
15211 } 15235 }
15212 return NULL; 15236 return NULL;
15213 } 15237 }
15214 15238
15215 15239
15216 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15240 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15217 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15241 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15218 } 15242 }
15219 15243
15220 } } // namespace v8::internal 15244 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698