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

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

Issue 1266013006: [stubs] Unify (and optimize) implementation of ToObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing support for %_ToObject in TurboFan and Crankshaft. Created 5 years, 4 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-simd.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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/debug.h" 9 #include "src/debug.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); 1454 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
1455 CONVERT_ARG_HANDLE_CHECKED(JSFunction, setter, 2); 1455 CONVERT_ARG_HANDLE_CHECKED(JSFunction, setter, 2);
1456 CONVERT_PROPERTY_ATTRIBUTES_CHECKED(attrs, 3); 1456 CONVERT_PROPERTY_ATTRIBUTES_CHECKED(attrs, 3);
1457 1457
1458 RETURN_FAILURE_ON_EXCEPTION( 1458 RETURN_FAILURE_ON_EXCEPTION(
1459 isolate, 1459 isolate,
1460 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(), 1460 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(),
1461 setter, attrs)); 1461 setter, attrs));
1462 return isolate->heap()->undefined_value(); 1462 return isolate->heap()->undefined_value();
1463 } 1463 }
1464
1465
1466 RUNTIME_FUNCTION(Runtime_ToObject) {
1467 HandleScope scope(isolate);
1468 DCHECK_EQ(1, args.length());
1469 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
1470 Handle<JSReceiver> receiver;
1471 if (JSReceiver::ToObject(isolate, object).ToHandle(&receiver)) {
1472 return *receiver;
1473 }
1474 THROW_NEW_ERROR_RETURN_FAILURE(
1475 isolate, NewTypeError(MessageTemplate::kUndefinedOrNullToObject));
1476 }
1477
1464 } // namespace internal 1478 } // namespace internal
1465 } // namespace v8 1479 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-simd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698