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

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

Issue 1337993005: [runtime] Replace the EQUALS builtin with proper Object::Equals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address Michi's nit. Created 5 years, 3 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/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/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 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after
1471 HandleScope scope(isolate); 1471 HandleScope scope(isolate);
1472 DCHECK_EQ(1, args.length()); 1472 DCHECK_EQ(1, args.length());
1473 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0); 1473 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0);
1474 Handle<Object> result; 1474 Handle<Object> result;
1475 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, 1475 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
1476 Object::ToName(isolate, input)); 1476 Object::ToName(isolate, input));
1477 return *result; 1477 return *result;
1478 } 1478 }
1479 1479
1480 1480
1481 RUNTIME_FUNCTION(Runtime_Equals) {
1482 HandleScope scope(isolate);
1483 DCHECK_EQ(2, args.length());
1484 CONVERT_ARG_HANDLE_CHECKED(Object, x, 0);
1485 CONVERT_ARG_HANDLE_CHECKED(Object, y, 1);
1486 Maybe<bool> result = Object::Equals(x, y);
1487 if (!result.IsJust()) return isolate->heap()->exception();
1488 // TODO(bmeurer): Change this at some point to return true/false instead.
1489 return Smi::FromInt(result.FromJust() ? EQUAL : NOT_EQUAL);
1490 }
1491
1492
1481 RUNTIME_FUNCTION(Runtime_StrictEquals) { 1493 RUNTIME_FUNCTION(Runtime_StrictEquals) {
1482 SealHandleScope scope(isolate); 1494 SealHandleScope scope(isolate);
1483 DCHECK_EQ(2, args.length()); 1495 DCHECK_EQ(2, args.length());
1484 CONVERT_ARG_CHECKED(Object, x, 0); 1496 CONVERT_ARG_CHECKED(Object, x, 0);
1485 CONVERT_ARG_CHECKED(Object, y, 1); 1497 CONVERT_ARG_CHECKED(Object, y, 1);
1486 // TODO(bmeurer): Change this at some point to return true/false instead. 1498 // TODO(bmeurer): Change this at some point to return true/false instead.
1487 return Smi::FromInt(x->StrictEquals(y) ? EQUAL : NOT_EQUAL); 1499 return Smi::FromInt(x->StrictEquals(y) ? EQUAL : NOT_EQUAL);
1488 } 1500 }
1489 1501
1490 1502
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1546 RUNTIME_FUNCTION(Runtime_CreateIterResultObject) { 1558 RUNTIME_FUNCTION(Runtime_CreateIterResultObject) {
1547 HandleScope scope(isolate); 1559 HandleScope scope(isolate);
1548 DCHECK_EQ(2, args.length()); 1560 DCHECK_EQ(2, args.length());
1549 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0); 1561 CONVERT_ARG_HANDLE_CHECKED(Object, value, 0);
1550 CONVERT_ARG_HANDLE_CHECKED(Object, done, 1); 1562 CONVERT_ARG_HANDLE_CHECKED(Object, done, 1);
1551 return *isolate->factory()->NewJSIteratorResult(value, done); 1563 return *isolate->factory()->NewJSIteratorResult(value, done);
1552 } 1564 }
1553 1565
1554 } // namespace internal 1566 } // namespace internal
1555 } // namespace v8 1567 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-numbers.cc ('k') | src/runtime/runtime-simd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698