v8

Mac node-sass 安装失败“v8::String::Utf8Value”

天大地大妈咪最大 提交于 2020-01-23 23:00:53
基本报错 ../src/create_string.cpp:17:25: error: no matching constructor for initialization of 'v8::String::Utf8Value' v8::String::Utf8Value string(value); ^ ~~~~~ /Users/hongsen.ren/.node-gyp/12.1.0/include/node/v8.h:3002:5: note: candidate constructor not viable: no known conversion from 'v8::Local<v8::Value>' to 'const v8::String::Utf8Value' for 1st argument Utf8Value(const Utf8Value&) = delete; ^ /Users/hongsen.ren/.node-gyp/12.1.0/include/node/v8.h:2995:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided Utf8Value(Isolate* isolate, Local<v8::Value> obj); ^ 1

How can I install pyv8 in Ubuntu 14.04?

荒凉一梦 提交于 2020-01-23 13:49:50
问题 I installed the libv8 and libboost-all-dev Ubuntu packages, then ran sudo pip install pyv8 And got: building '_PyV8' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/src x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DBOOST_PYTHON_STATIC_LIB -Ilib/python/inc -Ilib/boost/inc -Ilib/v8/inc -I/usr/include/python2.7 -c src/Exception.cpp -o build/temp.linux-x86_64-2.7/src/Exception.o cc1plus: warning:

After what exact number of execution function gets hot in V8?

帅比萌擦擦* 提交于 2020-01-22 04:01:51
问题 I was learning the inner workings of V8 and found out that there is JIT compiler which, on the fly, optimizes the hot functions with inline caching technique. I have only two questions, firstly, is function considered as hot function as long as it is executed repeatedly one after another several times? Secondly, after what exact number of repeated execution function gets hot in V8? 回答1: V8 developer here. Function "hotness" is not simply determined by the number of calls to it. Instead, V8

.forEach vs Object.keys().forEach performance on sparse arrays

烂漫一生 提交于 2020-01-21 09:07:05
问题 Tell me if I'm wrong: array.forEach(callbackFunction) is suited for sparse arrays. It executes callbackFunction not for each index between zero and the array length, but only for the keys which are actually in the array. And (tell me if I'm wrong) those keys are exactly what Object.keys(array) will give me. Hence (tell me why I'm wrong) it shouldn't make a difference if the .forEach method is called on array itself or on Object.keys(array) . So, why on earth is there this performance

.forEach vs Object.keys().forEach performance on sparse arrays

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-21 09:06:50
问题 Tell me if I'm wrong: array.forEach(callbackFunction) is suited for sparse arrays. It executes callbackFunction not for each index between zero and the array length, but only for the keys which are actually in the array. And (tell me if I'm wrong) those keys are exactly what Object.keys(array) will give me. Hence (tell me why I'm wrong) it shouldn't make a difference if the .forEach method is called on array itself or on Object.keys(array) . So, why on earth is there this performance

JavaScript 引擎「V8」发布 8.0 版本,内存占用量大幅下降

拥有回忆 提交于 2020-01-16 20:40:37
上周,JavaScript 引擎「V8」的开发团队在该项目官方网站上正式宣布推出最新的 8.0 版本。这次更新的重点主要集中在错误修复及性能改善上,正式的版本将在数周后随着谷歌 Chrome 80 稳定版一起发布。 V8 是谷歌公司推出的开源高性能 JavaScript 引擎,主要用于提升 Web 浏览器内部 JavaScript 脚本执行的性能。V8 通过 C++ 语言编写,主要用在 Chrome 浏览器以及 Node.js 上,实现了对 ECMAScript 与 WebAssembly 的支持,可运行于 Windows 7、macOS 10.12 以及使用 x64、IA-32、ARM、MIPS 处理器的 Linux 系统,或更新版本的操作系统环境下。V8 既可以单独运行,也能够内嵌到任何基于 C++ 的应用中。V8 项目开发至今已拥有超过 11 年的历史。 性能 指针压缩 V8 引擎的这次更新,对内存占用量与速度都进行了优化。V8 堆包含了很多东西,例如浮点值、字符串字符、编译代码以及标定值,开发团队发现这些标记值占据了堆的很大一部分空间。 标定值与系统指针一样大,32 位宽度对应 32 位架构,64 位宽度对应 64 位架构。当开发团队对比 32 位版本与 64 位版本时发现,每个标记值使用了两倍的堆内存。 因为高位可以由低位合成

V8 内存浅析

☆樱花仙子☆ 提交于 2020-01-16 06:26:24
总结 V8 使用 c++ 开发,主要应用于 Google chrome 和 node.js 中。 内存构成为: new space :大多数对象,小,回收频繁 old space :只保存原始数据对象,没有指向其它对象的指针 large object space :有自己的内存,不会移动大对象区 code space :代码对象,唯一拥有执行权限的内存 map :cell 和 map,每个区域都存放同样大小的元素,结构简单 内存清理优化 :GC 会停止其它响应操作,V8 优化:先将变量存到 new space,new space 存满后,将 ns 的活跃区和非活跃区调换,清理非活跃区,超过两次未清理的变量加入到 old space,其它没超过两次的替换到活跃区。old space 满了,用标记清除,清除从根开始无法访问的变量。 V8 内存浅析 V8 是谷歌开发的高性能 JavaScript 引擎,该引擎使用 C++ 开发。目前主要应用在 Google Chrome 浏览器和 node.js 当中。 V8 内存构成 一个 V8 进程的内存通常由以下几个块构成: 新生代内存区(new space) : 大多数的对象都会被分配在这里,这个区域很小但是垃圾回收比较频繁; 老生代内存区(old space) : 属于老生代,这里只保存原始数据对象,这些对象没有指向其他对象的指针; 大对象区

SegFault in v8 on Windows in HandleScope constructor

梦想与她 提交于 2020-01-15 10:49:48
问题 I developed a Windows Service in C++ that has V8 embedded. The Debug version is working good. The problem is that the Release version is not working at all. I compiled the V8 engine using VisualStudio 2010 into a static-lib file. I linked the Debug version of the service with V8 debug libs and the Release version of the service with V8 release libs. The Release version give SegmFault at the first line of the program which is HandleScope v8Scope; . (I instantiated the local scope for the v8

XCTF logmein

混江龙づ霸主 提交于 2020-01-15 07:09:03
一.查壳 发现是64位的Linux文件(ELF可以看出是linux的文件) 二.拖入ida64,静态分析 注意这里两个坑: 1.strcpy是复制字符串的意思,前面定义的v8数组只有8个,但是后面的字符串是超过8个的,所以有可能这个v8定义是反编译错误的(算了一遍,确实是错的,不需要管这个数组,直接用原字符串就好了) 2._int 64 v7 先将v7转换成字符串,这步个人理解是BYTE是字节型的指针,刚好对应的是一个字符,同时这个字符需要倒过来,因为是小端存储。 三。算法分析,写出脚本 v7 = "harambe" v6 = 7 v8 = ":\"AL_RT^L*.?+6/46" str = "" for i in range ( 0 , len ( v8 ) ) : str += chr ( ord ( ( v7 [ i % 7 ] ) ) ^ ord ( v8 [ i ] ) ) print ( str ) 得到flag 来源: CSDN 作者: YenKoc 链接: https://blog.csdn.net/YenKoc/article/details/103963881

How to inject javascript in existing HTML response with node.js and cloudflare workers

夙愿已清 提交于 2020-01-13 06:36:47
问题 I have a vanity URL pointing to a GitBook. GitBook doesn't support the insertion of arbitrary javascript snippets. At the moment GitBook has 4 "integrations" only. I could route through my own VM server to accomplish this, but I have CloudFlare and I want to try out workers. (Javascript running at the CDN edge). The CloudFlare worker environment makes header injection very easy, but there is no obvious way to do this. 回答1: It's important to process with a TransformStream so that processing is