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

Side by Side Diff: src/factory.cc

Issue 2652553003: Access double fields in C++ as uint64_t fields to preserve signaling bit of a NaN. (Closed)
Patch Set: More fixes Created 3 years, 11 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/heap/heap.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/accessors.h" 7 #include "src/accessors.h"
8 #include "src/allocation-site-scopes.h" 8 #include "src/allocation-site-scopes.h"
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 1301
1302 Handle<Object> Factory::NewNumberFromUint(uint32_t value, 1302 Handle<Object> Factory::NewNumberFromUint(uint32_t value,
1303 PretenureFlag pretenure) { 1303 PretenureFlag pretenure) {
1304 int32_t int32v = static_cast<int32_t>(value); 1304 int32_t int32v = static_cast<int32_t>(value);
1305 if (int32v >= 0 && Smi::IsValid(int32v)) { 1305 if (int32v >= 0 && Smi::IsValid(int32v)) {
1306 return handle(Smi::FromInt(int32v), isolate()); 1306 return handle(Smi::FromInt(int32v), isolate());
1307 } 1307 }
1308 return NewHeapNumber(FastUI2D(value), IMMUTABLE, pretenure); 1308 return NewHeapNumber(FastUI2D(value), IMMUTABLE, pretenure);
1309 } 1309 }
1310 1310
1311 1311 Handle<HeapNumber> Factory::NewHeapNumber(MutableMode mode,
1312 Handle<HeapNumber> Factory::NewHeapNumber(double value,
1313 MutableMode mode,
1314 PretenureFlag pretenure) { 1312 PretenureFlag pretenure) {
1315 CALL_HEAP_FUNCTION( 1313 CALL_HEAP_FUNCTION(isolate(),
1316 isolate(), 1314 isolate()->heap()->AllocateHeapNumber(mode, pretenure),
1317 isolate()->heap()->AllocateHeapNumber(value, mode, pretenure), 1315 HeapNumber);
1318 HeapNumber);
1319 } 1316 }
1320 1317
1321
1322 #define SIMD128_NEW_DEF(TYPE, Type, type, lane_count, lane_type) \ 1318 #define SIMD128_NEW_DEF(TYPE, Type, type, lane_count, lane_type) \
1323 Handle<Type> Factory::New##Type(lane_type lanes[lane_count], \ 1319 Handle<Type> Factory::New##Type(lane_type lanes[lane_count], \
1324 PretenureFlag pretenure) { \ 1320 PretenureFlag pretenure) { \
1325 CALL_HEAP_FUNCTION( \ 1321 CALL_HEAP_FUNCTION( \
1326 isolate(), isolate()->heap()->Allocate##Type(lanes, pretenure), Type); \ 1322 isolate(), isolate()->heap()->Allocate##Type(lanes, pretenure), Type); \
1327 } 1323 }
1328 SIMD128_TYPES(SIMD128_NEW_DEF) 1324 SIMD128_TYPES(SIMD128_NEW_DEF)
1329 #undef SIMD128_NEW_DEF 1325 #undef SIMD128_NEW_DEF
1330 1326
1331 1327
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after
2846 Handle<AccessorInfo> prototype = 2842 Handle<AccessorInfo> prototype =
2847 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); 2843 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs);
2848 Descriptor d = Descriptor::AccessorConstant( 2844 Descriptor d = Descriptor::AccessorConstant(
2849 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs); 2845 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs);
2850 map->AppendDescriptor(&d); 2846 map->AppendDescriptor(&d);
2851 } 2847 }
2852 } 2848 }
2853 2849
2854 } // namespace internal 2850 } // namespace internal
2855 } // namespace v8 2851 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698