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

Side by Side Diff: src/objects.cc

Issue 17167002: Fix Runtime_SetProperty to properly handle OOM failures (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 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
« no previous file with comments | « no previous file | src/runtime.cc » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 12039 matching lines...) Expand 10 before | Expand all | Expand 10 after
12050 } 12050 }
12051 12051
12052 12052
12053 Handle<Object> JSObject::SetElement(Handle<JSObject> object, 12053 Handle<Object> JSObject::SetElement(Handle<JSObject> object,
12054 uint32_t index, 12054 uint32_t index,
12055 Handle<Object> value, 12055 Handle<Object> value,
12056 PropertyAttributes attr, 12056 PropertyAttributes attr,
12057 StrictModeFlag strict_mode, 12057 StrictModeFlag strict_mode,
12058 SetPropertyMode set_mode) { 12058 SetPropertyMode set_mode) {
12059 if (object->HasExternalArrayElements()) { 12059 if (object->HasExternalArrayElements()) {
12060 if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) { 12060 if (!value->IsNumber() && !value->IsUndefined()) {
12061 bool has_exception; 12061 bool has_exception;
12062 Handle<Object> number = Execution::ToNumber(value, &has_exception); 12062 Handle<Object> number = Execution::ToNumber(value, &has_exception);
12063 if (has_exception) return Handle<Object>(); 12063 if (has_exception) return Handle<Object>();
12064 value = number; 12064 value = number;
12065 } 12065 }
12066 } 12066 }
12067 CALL_HEAP_FUNCTION( 12067 CALL_HEAP_FUNCTION(
12068 object->GetIsolate(), 12068 object->GetIsolate(),
12069 object->SetElement(index, *value, attr, strict_mode, true, set_mode), 12069 object->SetElement(index, *value, attr, strict_mode, true, set_mode),
12070 Object); 12070 Object);
(...skipping 3743 matching lines...) Expand 10 before | Expand all | Expand 10 after
15814 return static_cast<Type*>(type_raw()); 15814 return static_cast<Type*>(type_raw());
15815 } 15815 }
15816 15816
15817 15817
15818 void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) { 15818 void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) {
15819 set_type_raw(type, ignored); 15819 set_type_raw(type, ignored);
15820 } 15820 }
15821 15821
15822 15822
15823 } } // namespace v8::internal 15823 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698