v8

HTML Service does not open a sidebar in V8 runtime

感情迁移 提交于 2020-07-09 13:24:26
问题 I have a very large project running on Rhino, but when I switch it to V8 one of the basic functionalities break - the sidebar in Google Sheets can no longer be opened. Basic architecture: A) Google Sheet A with a script (Rhino) importing a GAS Library (V8). The sidebar is in the Library. versus B) Google Sheet B with a script (V8) importing a GAS Library (V8). The sidebar is in the Library. This code is in the Library (standalone script file, running in V8): // called from parent script as

Why is the execution time of this function call changing?

大憨熊 提交于 2020-07-04 20:07:11
问题 Preface This issue seems to only affect Chrome/V8, and may not be reproducible in Firefox or other browsers . In summary, the execution time of a function callback increases by an order of magnitude or more if the function is called with a new callback anywhere else. Simplified Proof-of-Concept The same callback logic is stored in two different variables. Calling test(callback1) arbitrarily many times works as expected, but once you call test(callback2) , the execution time of the test

Very slow “Logs” with Google Apps Script V8 vs Rhino?

北城余情 提交于 2020-07-04 13:00:06
问题 With Rhino, Logs dialog ("command + Enter" or Logs from View menu) shows logs instantly. However, with test projects using V8 engine it takes 10-20 seconds to load even the simplest logs, with a message "Waiting for logs, please wait..." Both, "Logger.log" or "console.log" are slow to load logs. Is anyone else experiencing the same type of slowness? Is this expected with the new engine? Thank you in advance! Here's a basic function I used for testing: function logTest() { Logger.log("log test

Google Apps Script V8 assignment to null cancels debugging

。_饼干妹妹 提交于 2020-06-27 08:45:49
问题 A variable assignment to null causes debugging to cancel execution at that line. Here is a test script that reproduces the problem: function myFunction() { var a = "Hallo"; Logger.log("a=" + a); var b = null; Logger.log("b=" + b); } When debugging this script execution is cancelled on line "var b = null;". Log output is: Mar 11, 2020, 8:52:49 PM Info a=Hallo Mar 11, 2020, 8:52:54 PM Info Execution cancelled. The result is the same when stepping over the line and running past the line in debug

V8 engine no longer breaks on errors

一笑奈何 提交于 2020-05-31 04:46:36
问题 This issue has been reported to Google: https://issuetracker.google.com/issues/152948662 A short description of the issue In the Rhino runtime, the script debugger (script.google.com) would break on any line containing an error (handled or not) if the uses pressed the "debug" button on the toolbar. (It won't break if the user presses the "run" button). The watch windows would be activated and the user can inspect the variables in force at the time of the error. In the V8 runtime, the script

V8 native syntax in Chrome

风格不统一 提交于 2020-05-30 07:45:12
问题 Nodejs has special flag --allow-natives-syntax . Is it possible to pass such thing to Google Chrome? Or maybe devtools provide some other way to access such information? // running node with `--allow-natives-syntax` flag var obj = { a: true, b: false }; console.log(%HasFastProperties(obj)); // true (Fast mode) delete obj.a; console.log(%HasFastProperties(obj)); // false (Dictionary mode) 回答1: Yes, you can pass that flag to Google Chrome if you start Chrome with --js-flags="--allow-natives

V8 native syntax in Chrome

我只是一个虾纸丫 提交于 2020-05-30 07:44:05
问题 Nodejs has special flag --allow-natives-syntax . Is it possible to pass such thing to Google Chrome? Or maybe devtools provide some other way to access such information? // running node with `--allow-natives-syntax` flag var obj = { a: true, b: false }; console.log(%HasFastProperties(obj)); // true (Fast mode) delete obj.a; console.log(%HasFastProperties(obj)); // false (Dictionary mode) 回答1: Yes, you can pass that flag to Google Chrome if you start Chrome with --js-flags="--allow-natives

How to convert Javascript code to human-readable opcodes or asm?

末鹿安然 提交于 2020-05-28 09:55:02
问题 As far as I know, Javascript code can either result in JS bytecode or asm instructions (if the internal JIT-compiler was able to convert the code directly to machine instructions). Is there any way to convert Javascript code to human-readable JS byte code (or asm instructions) - depending on how the V8 engine converts it? 回答1: You can run d8 or node with --print-bytecode --print-opt-code to print both bytecode and optimized assembly code to stdout when it is generated. You can use --print

How to convert Javascript code to human-readable opcodes or asm?

时光毁灭记忆、已成空白 提交于 2020-05-28 09:51:47
问题 As far as I know, Javascript code can either result in JS bytecode or asm instructions (if the internal JIT-compiler was able to convert the code directly to machine instructions). Is there any way to convert Javascript code to human-readable JS byte code (or asm instructions) - depending on how the V8 engine converts it? 回答1: You can run d8 or node with --print-bytecode --print-opt-code to print both bytecode and optimized assembly code to stdout when it is generated. You can use --print

Copy data into v8::ArrayBuffer

假如想象 提交于 2020-05-26 05:56:38
问题 I'm writing a Javascript interpreter in C++ using v8. I need to pass a char buffer into an ArrayBuffer so that it gets garbage collected. Here is my code: QByteArray data_buffer(file.readAll().data(), file.size()); v8::Handle<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(args.GetIsolate(), data_buffer.size()); //insert code to copy data from data_buffer to ab args.GetReturnValue().Set(ab); If I use the constructor from the documentation in which I pass a pointer to the data, I'll have to deal