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

Side by Side Diff: src/factory.cc

Issue 225823003: Implement handlified String::Equals and Name::Equals. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: refactored StringToDouble Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « src/conversions.cc ('k') | src/func-name-inferrer.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 "factory.h" 5 #include "factory.h"
6 6
7 #include "isolate-inl.h" 7 #include "isolate-inl.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after
1974 instance, 1974 instance,
1975 instance_template, 1975 instance_template,
1976 pending_exception); 1976 pending_exception);
1977 } else { 1977 } else {
1978 *pending_exception = false; 1978 *pending_exception = false;
1979 } 1979 }
1980 } 1980 }
1981 1981
1982 1982
1983 Handle<Object> Factory::GlobalConstantFor(Handle<String> name) { 1983 Handle<Object> Factory::GlobalConstantFor(Handle<String> name) {
1984 Heap* h = isolate()->heap(); 1984 if (String::Equals(name, undefined_string())) return undefined_value();
1985 if (name->Equals(h->undefined_string())) return undefined_value(); 1985 if (String::Equals(name, nan_string())) return nan_value();
1986 if (name->Equals(h->nan_string())) return nan_value(); 1986 if (String::Equals(name, infinity_string())) return infinity_value();
1987 if (name->Equals(h->infinity_string())) return infinity_value();
1988 return Handle<Object>::null(); 1987 return Handle<Object>::null();
1989 } 1988 }
1990 1989
1991 1990
1992 Handle<Object> Factory::ToBoolean(bool value) { 1991 Handle<Object> Factory::ToBoolean(bool value) {
1993 return value ? true_value() : false_value(); 1992 return value ? true_value() : false_value();
1994 } 1993 }
1995 1994
1996 } } // namespace v8::internal 1995 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/conversions.cc ('k') | src/func-name-inferrer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698