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

Side by Side Diff: src/factory.cc

Issue 2152693002: [stubs] Introduce NonPrimitiveToPrimitive builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments. Created 4 years, 5 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/factory.h ('k') | src/globals.h » ('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/factory.h" 5 #include "src/factory.h"
6 6
7 #include "src/allocation-site-scopes.h" 7 #include "src/allocation-site-scopes.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 2364 matching lines...) Expand 10 before | Expand all | Expand 10 after
2375 if (Name::Equals(name, nan_string())) return nan_value(); 2375 if (Name::Equals(name, nan_string())) return nan_value();
2376 if (Name::Equals(name, infinity_string())) return infinity_value(); 2376 if (Name::Equals(name, infinity_string())) return infinity_value();
2377 return Handle<Object>::null(); 2377 return Handle<Object>::null();
2378 } 2378 }
2379 2379
2380 2380
2381 Handle<Object> Factory::ToBoolean(bool value) { 2381 Handle<Object> Factory::ToBoolean(bool value) {
2382 return value ? true_value() : false_value(); 2382 return value ? true_value() : false_value();
2383 } 2383 }
2384 2384
2385 Handle<String> Factory::ToPrimitiveHintString(ToPrimitiveHint hint) {
2386 switch (hint) {
2387 case ToPrimitiveHint::kDefault:
2388 return default_string();
2389 case ToPrimitiveHint::kNumber:
2390 return number_string();
2391 case ToPrimitiveHint::kString:
2392 return string_string();
2393 }
2394 UNREACHABLE();
2395 return Handle<String>::null();
2396 }
2385 2397
2386 } // namespace internal 2398 } // namespace internal
2387 } // namespace v8 2399 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698