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

Side by Side Diff: src/accessors.cc

Issue 229943006: ElementsAccessor::SetLength() maybehandlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 bool has_exception; 205 bool has_exception;
206 Handle<Object> uint32_v = 206 Handle<Object> uint32_v =
207 Execution::ToUint32(isolate, value, &has_exception); 207 Execution::ToUint32(isolate, value, &has_exception);
208 if (has_exception) return Failure::Exception(); 208 if (has_exception) return Failure::Exception();
209 Handle<Object> number_v = 209 Handle<Object> number_v =
210 Execution::ToNumber(isolate, value, &has_exception); 210 Execution::ToNumber(isolate, value, &has_exception);
211 if (has_exception) return Failure::Exception(); 211 if (has_exception) return Failure::Exception();
212 212
213 if (uint32_v->Number() == number_v->Number()) { 213 if (uint32_v->Number() == number_v->Number()) {
214 Handle<Object> result = JSArray::SetElementsLength(array_handle, uint32_v); 214 Handle<Object> result;
215 RETURN_IF_EMPTY_HANDLE(isolate, result); 215 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
216 isolate, result,
217 JSArray::SetElementsLength(array_handle, uint32_v));
216 return *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,
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 info->set_data(Smi::FromInt(index)); 969 info->set_data(Smi::FromInt(index));
968 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); 970 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport);
969 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); 971 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport);
970 info->set_getter(*getter); 972 info->set_getter(*getter);
971 if (!(attributes & ReadOnly)) info->set_setter(*setter); 973 if (!(attributes & ReadOnly)) info->set_setter(*setter);
972 return info; 974 return info;
973 } 975 }
974 976
975 977
976 } } // namespace v8::internal 978 } } // 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