Skip to content

Instantly share code, notes, and snippets.

@ipeychev
Created May 24, 2015 20:59
Show Gist options
  • Save ipeychev/c58f78702c3b0ef743aa to your computer and use it in GitHub Desktop.
Save ipeychev/c58f78702c3b0ef743aa to your computer and use it in GitHub Desktop.
--- FUNCTION SOURCE (y) id{0,0} ---
() { return this._y; }
--- END ---
--- FUNCTION SOURCE (len) id{1,0} ---
(v) {
// We are going to deoptimize here when we call
// loop the second time because hidden class of
// v2 does not match hidden class of v.
// We changed by adding a new property "name" to
// the object allocated with Vec2.
return v.len();
}
--- END ---
--- FUNCTION SOURCE (Vec2.len) id{1,1} ---
() {
return Math.sqrt(this.len2());
}
--- END ---
INLINE (Vec2.len) id{1,1} AS 1 AT <0:247>
--- FUNCTION SOURCE (Vec2.len2) id{1,2} ---
() {
return this.x * this.x + this.y * this.y;
}
--- END ---
INLINE (Vec2.len2) id{1,2} AS 2 AT <1:31>
--- FUNCTION SOURCE (x) id{1,3} ---
() { return this._x; }
--- END ---
INLINE (x) id{1,3} AS 3 AT <2:20>
--- FUNCTION SOURCE (x) id{1,4} ---
() { return this._x; }
--- END ---
INLINE (x) id{1,4} AS 4 AT <2:29>
--- FUNCTION SOURCE (y) id{1,5} ---
() { return this._y; }
--- END ---
INLINE (y) id{1,5} AS 5 AT <2:38>
--- FUNCTION SOURCE (y) id{1,6} ---
() { return this._y; }
--- END ---
INLINE (y) id{1,6} AS 6 AT <2:47>
--- FUNCTION SOURCE (loop) id{2,0} ---
(v) {
var sum = 0;
for (var i = 0; i < 1e5; i++) sum += len(v);
return sum;
}
--- END ---
--- FUNCTION SOURCE (len) id{2,1} ---
(v) {
// We are going to deoptimize here when we call
// loop the second time because hidden class of
// v2 does not match hidden class of v.
// We changed by adding a new property "name" to
// the object allocated with Vec2.
return v.len();
}
--- END ---
INLINE (len) id{2,1} AS 1 AT <0:60>
--- FUNCTION SOURCE (Vec2.len) id{2,2} ---
() {
return Math.sqrt(this.len2());
}
--- END ---
INLINE (Vec2.len) id{2,2} AS 2 AT <1:247>
--- FUNCTION SOURCE (Vec2.len2) id{2,3} ---
() {
return this.x * this.x + this.y * this.y;
}
--- END ---
INLINE (Vec2.len2) id{2,3} AS 3 AT <2:31>
--- FUNCTION SOURCE (x) id{2,4} ---
() { return this._x; }
--- END ---
INLINE (x) id{2,4} AS 4 AT <3:20>
--- FUNCTION SOURCE (x) id{2,5} ---
() { return this._x; }
--- END ---
INLINE (x) id{2,5} AS 5 AT <3:29>
--- FUNCTION SOURCE (y) id{2,6} ---
() { return this._y; }
--- END ---
INLINE (y) id{2,6} AS 6 AT <3:38>
--- FUNCTION SOURCE (y) id{2,7} ---
() { return this._y; }
--- END ---
INLINE (y) id{2,7} AS 7 AT <3:47>
[deoptimizing (DEOPT eager): begin 0x19d4526432d9 <JS Function loop (SharedFunctionInfo 0x19d452642d19)> (opt #2) @4, FP to SP delta: 40]
;;; deoptimize at 1_247: wrong map
translating loop => node=20, height=16
0x7fff57f1ef18: [top + 56] <- 0x24b8170041a1 ; rcx 0x24b8170041a1 <JS Global Object>
0x7fff57f1ef10: [top + 48] <- 0x24b8170c0cd9 ; rdx 0x24b8170c0cd9 <a Vec2 with map 0x591d200e3f1>
0x7fff57f1ef08: [top + 40] <- 0x18e7e843e91d ; caller's pc
0x7fff57f1ef00: [top + 32] <- 0x7fff57f1ef40 ; caller's fp
0x7fff57f1eef8: [top + 24] <- 0x72389374189 ; rbx 0x72389374189 <FixedArray[115]>
0x7fff57f1eef8: [top + 24] <- 0x72389374189; context
0x7fff57f1eef0: [top + 16] <- 0x19d4526432d9; function
0x7fff57f1eee8: [top + 8] <- 0.000000e+00 ; xmm1
0x7fff57f1eee0: [top + 0] <- 0 ; rax (smi)
[deoptimizing (eager): end 0x19d4526432d9 <JS Function loop (SharedFunctionInfo 0x19d452642d19)> @4 => node=20, pc=0x18e7e843ed64, state=NO_REGISTERS, alignment=no padding, took 0.046 ms]
Materialized a new heap number 0x0 [0.000000e+00] in slot 0x7fff57f1eee8
[deoptimizing (DEOPT eager): begin 0x19d452643261 <JS Function len (SharedFunctionInfo 0x19d452642c89)> (opt #1) @2, FP to SP delta: 24]
translating len => node=3, height=0
0x7fff57f1eec8: [top + 40] <- 0x24b8170041a1 ; [sp + 48] 0x24b8170041a1 <JS Global Object>
0x7fff57f1eec0: [top + 32] <- 0x24b8170c0cd9 ; rax 0x24b8170c0cd9 <a Vec2 with map 0x591d200e3f1>
0x7fff57f1eeb8: [top + 24] <- 0x18e7e843eccf ; caller's pc
0x7fff57f1eeb0: [top + 16] <- 0x7fff57f1ef00 ; caller's fp
0x7fff57f1eea8: [top + 8] <- 0x72389374189 ; [sp + 0] 0x72389374189 <FixedArray[115]>
0x7fff57f1eea8: [top + 8] <- 0x72389374189; context
0x7fff57f1eea0: [top + 0] <- 0x19d452643261; function
[deoptimizing (eager): end 0x19d452643261 <JS Function len (SharedFunctionInfo 0x19d452642c89)> @2 => node=3, pc=0x18e7e843ee9e, state=NO_REGISTERS, alignment=no padding, took 0.029 ms]
--- FUNCTION SOURCE (Vec2.len) id{3,0} ---
() {
return Math.sqrt(this.len2());
}
--- END ---
--- FUNCTION SOURCE (Vec2.len2) id{3,1} ---
() {
return this.x * this.x + this.y * this.y;
}
--- END ---
INLINE (Vec2.len2) id{3,1} AS 1 AT <0:31>
--- FUNCTION SOURCE (x) id{3,2} ---
() { return this._x; }
--- END ---
INLINE (x) id{3,2} AS 2 AT <1:20>
--- FUNCTION SOURCE (x) id{3,3} ---
() { return this._x; }
--- END ---
INLINE (x) id{3,3} AS 3 AT <1:29>
--- FUNCTION SOURCE (y) id{3,4} ---
() { return this._y; }
--- END ---
INLINE (y) id{3,4} AS 4 AT <1:38>
--- FUNCTION SOURCE (y) id{3,5} ---
() { return this._y; }
--- END ---
INLINE (y) id{3,5} AS 5 AT <1:47>
[deoptimizing (DEOPT eager): begin 0x19d452643469 <JS Function Vec2.len (SharedFunctionInfo 0x19d452642ee9)> (opt #3) @2, FP to SP delta: 24]
translating Vec2.len => node=3, height=0
0x7fff57f1ee90: [top + 32] <- 0x24b8170c0cd9 ; rax 0x24b8170c0cd9 <a Vec2 with map 0x591d200e3f1>
0x7fff57f1ee88: [top + 24] <- 0x18e7e843eede ; caller's pc
0x7fff57f1ee80: [top + 16] <- 0x7fff57f1eeb0 ; caller's fp
0x7fff57f1ee78: [top + 8] <- 0x72389374189 ; [sp + 0] 0x72389374189 <FixedArray[115]>
0x7fff57f1ee78: [top + 8] <- 0x72389374189; context
0x7fff57f1ee70: [top + 0] <- 0x19d452643469; function
[deoptimizing (eager): end 0x19d452643469 <JS Function Vec2.len (SharedFunctionInfo 0x19d452642ee9)> @2 => node=3, pc=0x18e7e843f0fe, state=NO_REGISTERS, alignment=no padding, took 0.055 ms]
--- FUNCTION SOURCE (Vec2.len2) id{4,0} ---
() {
return this.x * this.x + this.y * this.y;
}
--- END ---
--- FUNCTION SOURCE (x) id{4,1} ---
() { return this._x; }
--- END ---
INLINE (x) id{4,1} AS 1 AT <0:20>
--- FUNCTION SOURCE (x) id{4,2} ---
() { return this._x; }
--- END ---
INLINE (x) id{4,2} AS 2 AT <0:29>
--- FUNCTION SOURCE (y) id{4,3} ---
() { return this._y; }
--- END ---
INLINE (y) id{4,3} AS 3 AT <0:38>
--- FUNCTION SOURCE (y) id{4,4} ---
() { return this._y; }
--- END ---
INLINE (y) id{4,4} AS 4 AT <0:47>
[deoptimizing (DEOPT eager): begin 0x19d452643421 <JS Function Vec2.len2 (SharedFunctionInfo 0x19d452642e59)> (opt #4) @2, FP to SP delta: 24]
translating Vec2.len2 => node=3, height=0
0x7fff57f1ee50: [top + 32] <- 0x24b8170c0cd9 ; rax 0x24b8170c0cd9 <a Vec2 with map 0x591d200e3f1>
0x7fff57f1ee48: [top + 24] <- 0x18e7e843f16d ; caller's pc
0x7fff57f1ee40: [top + 16] <- 0x7fff57f1ee80 ; caller's fp
0x7fff57f1ee38: [top + 8] <- 0x72389374189 ; [sp + 0] 0x72389374189 <FixedArray[115]>
0x7fff57f1ee38: [top + 8] <- 0x72389374189; context
0x7fff57f1ee30: [top + 0] <- 0x19d452643421; function
[deoptimizing (eager): end 0x19d452643421 <JS Function Vec2.len2 (SharedFunctionInfo 0x19d452642e59)> @2 => node=3, pc=0x18e7e843f25e, state=NO_REGISTERS, alignment=no padding, took 0.029 ms]
--- FUNCTION SOURCE (x) id{5,0} ---
() { return this._x; }
--- END ---
[deoptimizing (DEOPT eager): begin 0x19d452643511 <JS Function x (SharedFunctionInfo 0x19d452643009)> (opt #5) @2, FP to SP delta: 24]
translating x => node=3, height=0
0x7fff57f1eae0: [top + 32] <- 0x24b8170c0cd9 ; rax 0x24b8170c0cd9 <a Vec2 with map 0x591d200e3f1>
0x7fff57f1ead8: [top + 24] <- 0x18e7e842f263 ; caller's pc
0x7fff57f1ead0: [top + 16] <- 0x7fff57f1eb08 ; caller's fp
0x7fff57f1eac8: [top + 8] <- 0x72389374189 ; [sp + 0] 0x72389374189 <FixedArray[115]>
0x7fff57f1eac8: [top + 8] <- 0x72389374189; context
0x7fff57f1eac0: [top + 0] <- 0x19d452643511; function
[deoptimizing (eager): end 0x19d452643511 <JS Function x (SharedFunctionInfo 0x19d452643009)> @2 => node=3, pc=0x18e7e843f3be, state=NO_REGISTERS, alignment=no padding, took 0.027 ms]
[deoptimizing (DEOPT eager): begin 0x19d4526434b1 <JS Function y (SharedFunctionInfo 0x19d452642f79)> (opt #0) @2, FP to SP delta: 24]
translating y => node=3, height=0
0x7fff57f1ead0: [top + 32] <- 0x24b8170c0cd9 ; rax 0x24b8170c0cd9 <a Vec2 with map 0x591d200e3f1>
0x7fff57f1eac8: [top + 24] <- 0x18e7e842f263 ; caller's pc
0x7fff57f1eac0: [top + 16] <- 0x7fff57f1eaf8 ; caller's fp
0x7fff57f1eab8: [top + 8] <- 0x72389374189 ; [sp + 0] 0x72389374189 <FixedArray[115]>
0x7fff57f1eab8: [top + 8] <- 0x72389374189; context
0x7fff57f1eab0: [top + 0] <- 0x19d4526434b1; function
[deoptimizing (eager): end 0x19d4526434b1 <JS Function y (SharedFunctionInfo 0x19d452642f79)> @2 => node=3, pc=0x18e7e843f85e, state=NO_REGISTERS, alignment=no padding, took 0.024 ms]
--- FUNCTION SOURCE (sqrt) id{6,0} ---
(c){
return %_MathSqrt(+c);
}
--- END ---
--- FUNCTION SOURCE (y) id{7,0} ---
() { return this._y; }
--- END ---
--- FUNCTION SOURCE (len) id{8,0} ---
(v) {
// We are going to deoptimize here when we call
// loop the second time because hidden class of
// v2 does not match hidden class of v.
// We changed by adding a new property "name" to
// the object allocated with Vec2.
return v.len();
}
--- END ---
--- FUNCTION SOURCE (Vec2.len) id{8,1} ---
() {
return Math.sqrt(this.len2());
}
--- END ---
INLINE (Vec2.len) id{8,1} AS 1 AT <0:247>
--- FUNCTION SOURCE (Vec2.len2) id{8,2} ---
() {
return this.x * this.x + this.y * this.y;
}
--- END ---
INLINE (Vec2.len2) id{8,2} AS 2 AT <1:31>
--- FUNCTION SOURCE (x) id{8,3} ---
() { return this._x; }
--- END ---
INLINE (x) id{8,3} AS 3 AT <2:20>
--- FUNCTION SOURCE (x) id{8,4} ---
() { return this._x; }
--- END ---
INLINE (x) id{8,4} AS 4 AT <2:29>
--- FUNCTION SOURCE (y) id{8,5} ---
() { return this._y; }
--- END ---
INLINE (y) id{8,5} AS 5 AT <2:38>
--- FUNCTION SOURCE (y) id{8,6} ---
() { return this._y; }
--- END ---
INLINE (y) id{8,6} AS 6 AT <2:47>
--- FUNCTION SOURCE (loop) id{9,0} ---
(v) {
var sum = 0;
for (var i = 0; i < 1e5; i++) sum += len(v);
return sum;
}
--- END ---
--- FUNCTION SOURCE (len) id{9,1} ---
(v) {
// We are going to deoptimize here when we call
// loop the second time because hidden class of
// v2 does not match hidden class of v.
// We changed by adding a new property "name" to
// the object allocated with Vec2.
return v.len();
}
--- END ---
INLINE (len) id{9,1} AS 1 AT <0:60>
--- FUNCTION SOURCE (Vec2.len) id{9,2} ---
() {
return Math.sqrt(this.len2());
}
--- END ---
INLINE (Vec2.len) id{9,2} AS 2 AT <1:247>
--- FUNCTION SOURCE (Vec2.len2) id{9,3} ---
() {
return this.x * this.x + this.y * this.y;
}
--- END ---
INLINE (Vec2.len2) id{9,3} AS 3 AT <2:31>
--- FUNCTION SOURCE (x) id{9,4} ---
() { return this._x; }
--- END ---
INLINE (x) id{9,4} AS 4 AT <3:20>
--- FUNCTION SOURCE (x) id{9,5} ---
() { return this._x; }
--- END ---
INLINE (x) id{9,5} AS 5 AT <3:29>
--- FUNCTION SOURCE (y) id{9,6} ---
() { return this._y; }
--- END ---
INLINE (y) id{9,6} AS 6 AT <3:38>
--- FUNCTION SOURCE (y) id{9,7} ---
() { return this._y; }
--- END ---
INLINE (y) id{9,7} AS 7 AT <3:47>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment