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

Side by Side Diff: src/runtime.cc

Issue 325553002: --verify-predictable mode added for ensuring that GC behaves deterministically. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing review comments Created 6 years, 6 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/objects-printer.cc ('k') | src/serialize.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 9622 matching lines...) Expand 10 before | Expand all | Expand 10 after
9633 9633
9634 9634
9635 RUNTIME_FUNCTION(Runtime_DateCurrentTime) { 9635 RUNTIME_FUNCTION(Runtime_DateCurrentTime) {
9636 HandleScope scope(isolate); 9636 HandleScope scope(isolate);
9637 ASSERT(args.length() == 0); 9637 ASSERT(args.length() == 0);
9638 9638
9639 // According to ECMA-262, section 15.9.1, page 117, the precision of 9639 // According to ECMA-262, section 15.9.1, page 117, the precision of
9640 // the number in a Date object representing a particular instant in 9640 // the number in a Date object representing a particular instant in
9641 // time is milliseconds. Therefore, we floor the result of getting 9641 // time is milliseconds. Therefore, we floor the result of getting
9642 // the OS time. 9642 // the OS time.
9643 double millis = std::floor(OS::TimeCurrentMillis()); 9643 double millis;
9644 if (FLAG_verify_predictable) {
9645 millis = 1388534400000.0; // Jan 1 2014 00:00:00 GMT+0000
9646 millis += std::floor(isolate->heap()->synthetic_time());
9647 } else {
9648 millis = std::floor(OS::TimeCurrentMillis());
9649 }
9644 return *isolate->factory()->NewNumber(millis); 9650 return *isolate->factory()->NewNumber(millis);
9645 } 9651 }
9646 9652
9647 9653
9648 RUNTIME_FUNCTION(Runtime_DateParseString) { 9654 RUNTIME_FUNCTION(Runtime_DateParseString) {
9649 HandleScope scope(isolate); 9655 HandleScope scope(isolate);
9650 ASSERT(args.length() == 2); 9656 ASSERT(args.length() == 2);
9651 CONVERT_ARG_HANDLE_CHECKED(String, str, 0); 9657 CONVERT_ARG_HANDLE_CHECKED(String, str, 0);
9652 CONVERT_ARG_HANDLE_CHECKED(JSArray, output, 1); 9658 CONVERT_ARG_HANDLE_CHECKED(JSArray, output, 1);
9653 9659
(...skipping 5490 matching lines...) Expand 10 before | Expand all | Expand 10 after
15144 } 15150 }
15145 return NULL; 15151 return NULL;
15146 } 15152 }
15147 15153
15148 15154
15149 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15155 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15150 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15156 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15151 } 15157 }
15152 15158
15153 } } // namespace v8::internal 15159 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-printer.cc ('k') | src/serialize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698