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

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

Issue 1181733002: Revert of Replace SetObjectProperty / DefineObjectProperty with less powerful alternatives where relevant. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 RETURN_FAILURE_ON_EXCEPTION(isolate, JSObject::DefinePropertyOrElement( 203 uint32_t index;
204 object, name, function, DONT_ENUM)); 204 if (name->AsArrayIndex(&index)) {
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 }
205 return isolate->heap()->undefined_value(); 213 return isolate->heap()->undefined_value();
206 } 214 }
207 215
208 216
209 RUNTIME_FUNCTION(Runtime_ClassGetSourceCode) { 217 RUNTIME_FUNCTION(Runtime_ClassGetSourceCode) {
210 HandleScope shs(isolate); 218 HandleScope shs(isolate);
211 DCHECK(args.length() == 1); 219 DCHECK(args.length() == 1);
212 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); 220 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0);
213 221
214 Handle<Object> script; 222 Handle<Object> script;
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 return nullptr; 455 return nullptr;
448 } 456 }
449 457
450 458
451 RUNTIME_FUNCTION(Runtime_CallSuperWithSpread) { 459 RUNTIME_FUNCTION(Runtime_CallSuperWithSpread) {
452 UNIMPLEMENTED(); 460 UNIMPLEMENTED();
453 return nullptr; 461 return nullptr;
454 } 462 }
455 } // namespace internal 463 } // namespace internal
456 } // namespace v8 464 } // 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