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

Side by Side Diff: src/factory.h

Issue 2202163002: Revert of [builtins] implement Array.prototype.includes in TurboFan (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/elements.cc ('k') | src/js/array.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 #ifndef V8_FACTORY_H_ 5 #ifndef V8_FACTORY_H_
6 #define V8_FACTORY_H_ 6 #define V8_FACTORY_H_
7 7
8 #include "src/isolate.h" 8 #include "src/isolate.h"
9 #include "src/messages.h" 9 #include "src/messages.h"
10 #include "src/type-feedback-vector.h" 10 #include "src/type-feedback-vector.h"
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 Handle<Object> NewNumberFromSize(size_t value, 373 Handle<Object> NewNumberFromSize(size_t value,
374 PretenureFlag pretenure = NOT_TENURED) { 374 PretenureFlag pretenure = NOT_TENURED) {
375 // We can't use Smi::IsValid() here because that operates on a signed 375 // We can't use Smi::IsValid() here because that operates on a signed
376 // intptr_t, and casting from size_t could create a bogus sign bit. 376 // intptr_t, and casting from size_t could create a bogus sign bit.
377 if (value <= static_cast<size_t>(Smi::kMaxValue)) { 377 if (value <= static_cast<size_t>(Smi::kMaxValue)) {
378 return Handle<Object>(Smi::FromIntptr(static_cast<intptr_t>(value)), 378 return Handle<Object>(Smi::FromIntptr(static_cast<intptr_t>(value)),
379 isolate()); 379 isolate());
380 } 380 }
381 return NewNumber(static_cast<double>(value), pretenure); 381 return NewNumber(static_cast<double>(value), pretenure);
382 } 382 }
383 Handle<Object> NewNumberFromInt64(int64_t value,
384 PretenureFlag pretenure = NOT_TENURED) {
385 if (value <= std::numeric_limits<int32_t>::max() &&
386 value >= std::numeric_limits<int32_t>::min() &&
387 Smi::IsValid(static_cast<int32_t>(value))) {
388 return Handle<Object>(Smi::FromInt(static_cast<int32_t>(value)),
389 isolate());
390 }
391 return NewNumber(static_cast<double>(value), pretenure);
392 }
393 Handle<HeapNumber> NewHeapNumber(double value, 383 Handle<HeapNumber> NewHeapNumber(double value,
394 MutableMode mode = IMMUTABLE, 384 MutableMode mode = IMMUTABLE,
395 PretenureFlag pretenure = NOT_TENURED); 385 PretenureFlag pretenure = NOT_TENURED);
396 386
397 #define SIMD128_NEW_DECL(TYPE, Type, type, lane_count, lane_type) \ 387 #define SIMD128_NEW_DECL(TYPE, Type, type, lane_count, lane_type) \
398 Handle<Type> New##Type(lane_type lanes[lane_count], \ 388 Handle<Type> New##Type(lane_type lanes[lane_count], \
399 PretenureFlag pretenure = NOT_TENURED); 389 PretenureFlag pretenure = NOT_TENURED);
400 SIMD128_TYPES(SIMD128_NEW_DECL) 390 SIMD128_TYPES(SIMD128_NEW_DECL)
401 #undef SIMD128_NEW_DECL 391 #undef SIMD128_NEW_DECL
402 392
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 FunctionMode function_mode); 740 FunctionMode function_mode);
751 741
752 void SetStrictFunctionInstanceDescriptor(Handle<Map> map, 742 void SetStrictFunctionInstanceDescriptor(Handle<Map> map,
753 FunctionMode function_mode); 743 FunctionMode function_mode);
754 }; 744 };
755 745
756 } // namespace internal 746 } // namespace internal
757 } // namespace v8 747 } // namespace v8
758 748
759 #endif // V8_FACTORY_H_ 749 #endif // V8_FACTORY_H_
OLDNEW
« no previous file with comments | « src/elements.cc ('k') | src/js/array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698