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

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

Issue 645243003: Initialize double values before calling rempio2. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | « no previous file | no next file » | 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/assembler.h" 8 #include "src/assembler.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/runtime/runtime.h" 10 #include "src/runtime/runtime.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo; 58 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo;
59 return *isolate->factory()->NewNumber(uint64_to_double(result)); 59 return *isolate->factory()->NewNumber(uint64_to_double(result));
60 } 60 }
61 61
62 62
63 RUNTIME_FUNCTION(Runtime_RemPiO2) { 63 RUNTIME_FUNCTION(Runtime_RemPiO2) {
64 HandleScope handle_scope(isolate); 64 HandleScope handle_scope(isolate);
65 DCHECK(args.length() == 1); 65 DCHECK(args.length() == 1);
66 CONVERT_DOUBLE_ARG_CHECKED(x, 0); 66 CONVERT_DOUBLE_ARG_CHECKED(x, 0);
67 Factory* factory = isolate->factory(); 67 Factory* factory = isolate->factory();
68 double y[2]; 68 double y[2] = {0.0, 0.0};
69 int n = fdlibm::rempio2(x, y); 69 int n = fdlibm::rempio2(x, y);
70 Handle<FixedArray> array = factory->NewFixedArray(3); 70 Handle<FixedArray> array = factory->NewFixedArray(3);
71 Handle<HeapNumber> y0 = factory->NewHeapNumber(y[0]); 71 Handle<HeapNumber> y0 = factory->NewHeapNumber(y[0]);
72 Handle<HeapNumber> y1 = factory->NewHeapNumber(y[1]); 72 Handle<HeapNumber> y1 = factory->NewHeapNumber(y[1]);
73 array->set(0, Smi::FromInt(n)); 73 array->set(0, Smi::FromInt(n));
74 array->set(1, *y0); 74 array->set(1, *y0);
75 array->set(2, *y1); 75 array->set(2, *y1);
76 return *factory->NewJSArrayWithElements(array); 76 return *factory->NewJSArrayWithElements(array);
77 } 77 }
78 78
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 RUNTIME_FUNCTION(RuntimeReference_IsMinusZero) { 238 RUNTIME_FUNCTION(RuntimeReference_IsMinusZero) {
239 SealHandleScope shs(isolate); 239 SealHandleScope shs(isolate);
240 DCHECK(args.length() == 1); 240 DCHECK(args.length() == 1);
241 CONVERT_ARG_CHECKED(Object, obj, 0); 241 CONVERT_ARG_CHECKED(Object, obj, 0);
242 if (!obj->IsHeapNumber()) return isolate->heap()->false_value(); 242 if (!obj->IsHeapNumber()) return isolate->heap()->false_value();
243 HeapNumber* number = HeapNumber::cast(obj); 243 HeapNumber* number = HeapNumber::cast(obj);
244 return isolate->heap()->ToBoolean(IsMinusZero(number->value())); 244 return isolate->heap()->ToBoolean(IsMinusZero(number->value()));
245 } 245 }
246 } 246 }
247 } // namespace v8::internal 247 } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698