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

Side by Side Diff: src/ast.cc

Issue 227573002: Return MaybeHandle from SetElement and DeleteElement. (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 | « src/api.cc ('k') | src/handles.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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 if (m_literal->depth() + 1 > depth_acc) { 371 if (m_literal->depth() + 1 > depth_acc) {
372 depth_acc = m_literal->depth() + 1; 372 depth_acc = m_literal->depth() + 1;
373 } 373 }
374 } 374 }
375 Handle<Object> boilerplate_value = GetBoilerplateValue(element, isolate); 375 Handle<Object> boilerplate_value = GetBoilerplateValue(element, isolate);
376 if (boilerplate_value->IsTheHole()) { 376 if (boilerplate_value->IsTheHole()) {
377 is_holey = true; 377 is_holey = true;
378 } else if (boilerplate_value->IsUninitialized()) { 378 } else if (boilerplate_value->IsUninitialized()) {
379 is_simple = false; 379 is_simple = false;
380 JSObject::SetOwnElement( 380 JSObject::SetOwnElement(
381 array, i, handle(Smi::FromInt(0), isolate), SLOPPY); 381 array, i, handle(Smi::FromInt(0), isolate), SLOPPY).Assert();
382 } else { 382 } else {
383 JSObject::SetOwnElement(array, i, boilerplate_value, SLOPPY); 383 JSObject::SetOwnElement(array, i, boilerplate_value, SLOPPY).Assert();
384 } 384 }
385 } 385 }
386 386
387 Handle<FixedArrayBase> element_values(array->elements()); 387 Handle<FixedArrayBase> element_values(array->elements());
388 388
389 // Simple and shallow arrays can be lazily copied, we transform the 389 // Simple and shallow arrays can be lazily copied, we transform the
390 // elements array to a copy-on-write array. 390 // elements array to a copy-on-write array.
391 if (is_simple && depth_acc == 1 && values()->length() > 0 && 391 if (is_simple && depth_acc == 1 && values()->length() > 0 &&
392 array->HasFastSmiOrObjectElements()) { 392 array->HasFastSmiOrObjectElements()) {
393 element_values->set_map(isolate->heap()->fixed_cow_array_map()); 393 element_values->set_map(isolate->heap()->fixed_cow_array_map());
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value()); 1175 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value());
1176 str = arr; 1176 str = arr;
1177 } else { 1177 } else {
1178 str = DoubleToCString(value_->Number(), buffer); 1178 str = DoubleToCString(value_->Number(), buffer);
1179 } 1179 }
1180 return isolate_->factory()->NewStringFromAscii(CStrVector(str)); 1180 return isolate_->factory()->NewStringFromAscii(CStrVector(str));
1181 } 1181 }
1182 1182
1183 1183
1184 } } // namespace v8::internal 1184 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698