This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Modulo(value, remainder) { | |
var mod = value % remainder; | |
// Guard against returning -0. | |
if (mod == 0) return 0; | |
return mod >= 0 ? mod : mod + remainder; | |
} | |
function WeekDay(time) { | |
return Modulo(Math.floor(time / 86400000) + 4, 7); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: src/arm/macro-assembler-arm.cc | |
=================================================================== | |
--- src/arm/macro-assembler-arm.cc (revision 9710) | |
+++ src/arm/macro-assembler-arm.cc (working copy) | |
@@ -2907,8 +2907,8 @@ | |
#ifdef CAN_USE_ARMV5_INSTRUCTIONS | |
clz(zeros, source); // This instruction is only supported after ARM5. | |
#else | |
+ Move(scratch, source); | |
mov(zeros, Operand(0, RelocInfo::NONE)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static Handle<Value> Stat(const Arguments& args) { | |
HandleScope scope; | |
if (args.Length() < 1 || !args[0]->IsString()) { | |
return THROW_BAD_ARGS; | |
} | |
String::Utf8Value path(args[0]->ToString()); | |
if (args[1]->IsFunction()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Variant of Tim Caswell's "fibers" proposal based on Harmony generators. | |
// Make generator into a shallow coroutine. | |
function GF(g) { | |
var f = g(resume); | |
function resume (value) { f.send(value); } | |
f.next(); | |
} | |
function readfile(filename, next) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mraleph@whitestar|~/src/v8/% ./d8 [svn|bleeding_edge-10247] | |
V8 version 3.7.4 (candidate) [console: dumb] | |
d8> typeof null | |
object | |
d8> ^C | |
mraleph@whitestar|~/src/v8/% ./d8 --harmony [svn|bleeding_edge-10247] | |
V8 version 3.7.4 (candidate) [console: dumb] | |
d8> typeof null | |
null | |
d8> ^C |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To make the benchmark results predictable, we replace Math.random | |
// with a 100% deterministic alternative. | |
Math.random = (function() { | |
var seed = 49734321; | |
return function() { | |
// Robert Jenkins' 32 bit integer hash function. | |
seed = ((seed + 0x7ed55d16) + (seed << 12)) & 0xffffffff; | |
seed = ((seed ^ 0xc761c23c) ^ (seed >>> 19)) & 0xffffffff; | |
seed = ((seed + 0x165667b1) + (seed << 5)) & 0xffffffff; | |
seed = ((seed + 0xd3a2646c) ^ (seed << 9)) & 0xffffffff; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function MakePoint(x, y) | |
local point = {} | |
point.x = x | |
point.y = y | |
return point | |
end | |
function MakeArrayOfPoints(N) | |
local array = {} | |
local m = -1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 0 v13 BlockEntry | |
0 0 v14 Simulate id=3 | |
0 0 v15 StackCheck changes[NewSpacePromotion] | |
0 4 i137 Change t5 t to i range[-2147483648,2147483647,m0=0] | |
0 3 i146 Constant 0 range[0,0,m0=0] | |
0 1 i18 Add i137 i146 range[-2147483648,2147483647,m0=0] | |
0 4 i141 Change t7 t to i range[-2147483648,2147483647,m0=0] | |
0 1 i20 Add i141 i146 range[-2147483648,2147483647,m0=0] | |
0 0 t21 CheckNonSmi t6 | |
0 0 t22 CheckMaps t6 [0x4e80ede1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sending futures across isolate boundaries. | |
#import('dart:isolate', prefix: 'isolate'); | |
// FutureSendPort/FutureReceivePorts are ports for sending and receiving futures | |
// When connecting futures across isolates boundaries they do it by | |
// building the following structure: | |
// | |
// ISOLATE A | |
// [Future] --events--> [Completer SendPort] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To make the benchmark results predictable, we replace Math.random | |
// with a 100% deterministic alternative. | |
Math.random = (function() { | |
var seed = 49734321; | |
return function() { | |
// Robert Jenkins' 32 bit integer hash function. | |
seed = ((seed + 0x7ed55d16) + (seed << 12)) & 0xffffffff; | |
seed = ((seed ^ 0xc761c23c) ^ (seed >>> 19)) & 0xffffffff; | |
seed = ((seed + 0x165667b1) + (seed << 5)) & 0xffffffff; | |
seed = ((seed + 0xd3a2646c) ^ (seed << 9)) & 0xffffffff; |