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

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

Issue 1378533002: [es6] Introduce %ToInteger and %ToLength. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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-numbers.cc ('k') | src/string.js » ('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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.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/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 RUNTIME_FUNCTION(Runtime_ToNumber) { 1439 RUNTIME_FUNCTION(Runtime_ToNumber) {
1440 HandleScope scope(isolate); 1440 HandleScope scope(isolate);
1441 DCHECK_EQ(1, args.length()); 1441 DCHECK_EQ(1, args.length());
1442 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0); 1442 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0);
1443 Handle<Object> result; 1443 Handle<Object> result;
1444 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, Object::ToNumber(input)); 1444 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, Object::ToNumber(input));
1445 return *result; 1445 return *result;
1446 } 1446 }
1447 1447
1448 1448
1449 RUNTIME_FUNCTION(Runtime_ToInteger) {
1450 HandleScope scope(isolate);
1451 DCHECK_EQ(1, args.length());
1452 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0);
1453 Handle<Object> result;
1454 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
1455 Object::ToInteger(isolate, input));
1456 return *result;
1457 }
1458
1459
1460 RUNTIME_FUNCTION(Runtime_ToLength) {
1461 HandleScope scope(isolate);
1462 DCHECK_EQ(1, args.length());
1463 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0);
1464 Handle<Object> result;
1465 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
1466 Object::ToLength(isolate, input));
1467 return *result;
1468 }
1469
1470
1449 RUNTIME_FUNCTION(Runtime_ToString) { 1471 RUNTIME_FUNCTION(Runtime_ToString) {
1450 HandleScope scope(isolate); 1472 HandleScope scope(isolate);
1451 DCHECK_EQ(1, args.length()); 1473 DCHECK_EQ(1, args.length());
1452 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0); 1474 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0);
1453 Handle<Object> result; 1475 Handle<Object> result;
1454 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, 1476 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
1455 Object::ToString(isolate, input)); 1477 Object::ToString(isolate, input));
1456 return *result; 1478 return *result;
1457 } 1479 }
1458 1480
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1609 RUNTIME_FUNCTION(Runtime_IsAccessCheckNeeded) { 1631 RUNTIME_FUNCTION(Runtime_IsAccessCheckNeeded) {
1610 SealHandleScope shs(isolate); 1632 SealHandleScope shs(isolate);
1611 DCHECK_EQ(1, args.length()); 1633 DCHECK_EQ(1, args.length());
1612 CONVERT_ARG_CHECKED(Object, object, 0); 1634 CONVERT_ARG_CHECKED(Object, object, 0);
1613 return isolate->heap()->ToBoolean(object->IsAccessCheckNeeded()); 1635 return isolate->heap()->ToBoolean(object->IsAccessCheckNeeded());
1614 } 1636 }
1615 1637
1616 1638
1617 } // namespace internal 1639 } // namespace internal
1618 } // namespace v8 1640 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-numbers.cc ('k') | src/string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698