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

Side by Side Diff: src/runtime/runtime-classes.cc

Issue 1178503004: Replace SetObjectProperty / DefineObjectProperty with less powerful alternatives where relevant. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 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
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-debug.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/arguments.h" 10 #include "src/arguments.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 } 193 }
194 194
195 195
196 RUNTIME_FUNCTION(Runtime_DefineClassMethod) { 196 RUNTIME_FUNCTION(Runtime_DefineClassMethod) {
197 HandleScope scope(isolate); 197 HandleScope scope(isolate);
198 DCHECK(args.length() == 3); 198 DCHECK(args.length() == 3);
199 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); 199 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
200 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); 200 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
201 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 2); 201 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 2);
202 202
203 uint32_t index; 203 RETURN_FAILURE_ON_EXCEPTION(isolate, JSObject::DefinePropertyOrElement(
204 if (name->AsArrayIndex(&index)) { 204 object, name, function, DONT_ENUM));
205 RETURN_FAILURE_ON_EXCEPTION(
206 isolate, JSObject::SetOwnElementIgnoreAttributes(object, index,
207 function, DONT_ENUM));
208 } else {
209 RETURN_FAILURE_ON_EXCEPTION(
210 isolate, JSObject::SetOwnPropertyIgnoreAttributes(object, name,
211 function, DONT_ENUM));
212 }
213 return isolate->heap()->undefined_value(); 205 return isolate->heap()->undefined_value();
214 } 206 }
215 207
216 208
217 RUNTIME_FUNCTION(Runtime_ClassGetSourceCode) { 209 RUNTIME_FUNCTION(Runtime_ClassGetSourceCode) {
218 HandleScope shs(isolate); 210 HandleScope shs(isolate);
219 DCHECK(args.length() == 1); 211 DCHECK(args.length() == 1);
220 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); 212 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0);
221 213
222 Handle<Object> script; 214 Handle<Object> script;
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 return nullptr; 447 return nullptr;
456 } 448 }
457 449
458 450
459 RUNTIME_FUNCTION(Runtime_CallSuperWithSpread) { 451 RUNTIME_FUNCTION(Runtime_CallSuperWithSpread) {
460 UNIMPLEMENTED(); 452 UNIMPLEMENTED();
461 return nullptr; 453 return nullptr;
462 } 454 }
463 } // namespace internal 455 } // namespace internal
464 } // namespace v8 456 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698