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

Side by Side Diff: src/accessors.cc

Issue 203333004: Handlification of JSArray::SetElementsLength(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing review notes Created 6 years, 9 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
« no previous file with comments | « no previous file | src/elements.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 206
207 bool has_exception; 207 bool has_exception;
208 Handle<Object> uint32_v = 208 Handle<Object> uint32_v =
209 Execution::ToUint32(isolate, value, &has_exception); 209 Execution::ToUint32(isolate, value, &has_exception);
210 if (has_exception) return Failure::Exception(); 210 if (has_exception) return Failure::Exception();
211 Handle<Object> number_v = 211 Handle<Object> number_v =
212 Execution::ToNumber(isolate, value, &has_exception); 212 Execution::ToNumber(isolate, value, &has_exception);
213 if (has_exception) return Failure::Exception(); 213 if (has_exception) return Failure::Exception();
214 214
215 if (uint32_v->Number() == number_v->Number()) { 215 if (uint32_v->Number() == number_v->Number()) {
216 return array_handle->SetElementsLength(*uint32_v); 216 Handle<Object> result = JSArray::SetElementsLength(array_handle, uint32_v);
217 RETURN_IF_EMPTY_HANDLE(isolate, result);
218 return *result;
217 } 219 }
218 return isolate->Throw( 220 return isolate->Throw(
219 *isolate->factory()->NewRangeError("invalid_array_length", 221 *isolate->factory()->NewRangeError("invalid_array_length",
220 HandleVector<Object>(NULL, 0))); 222 HandleVector<Object>(NULL, 0)));
221 } 223 }
222 224
223 225
224 const AccessorDescriptor Accessors::ArrayLength = { 226 const AccessorDescriptor Accessors::ArrayLength = {
225 ArrayGetLength, 227 ArrayGetLength,
226 ArraySetLength, 228 ArraySetLength,
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 info->set_data(Smi::FromInt(index)); 967 info->set_data(Smi::FromInt(index));
966 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); 968 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport);
967 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); 969 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport);
968 info->set_getter(*getter); 970 info->set_getter(*getter);
969 if (!(attributes & ReadOnly)) info->set_setter(*setter); 971 if (!(attributes & ReadOnly)) info->set_setter(*setter);
970 return info; 972 return info;
971 } 973 }
972 974
973 975
974 } } // namespace v8::internal 976 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/elements.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698