From 374300ca8d1a97989b9c50f8cc8f3ed893e3bdd8 Mon Sep 17 00:00:00 2001 From: Rasmus Andersson Date: Sat, 27 Feb 2010 18:18:41 +0100 Subject: [PATCH 01/11] Updated patch of node.cc for supporting reading of umask --- doc/api.txt | 9 +++++---- src/node.cc | 14 +++++++++----- test/simple/test-umask.js | 8 +++++++- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/doc/api.txt b/doc/api.txt index 1815dfd695..752eecf165 100644 --- a/doc/api.txt +++ b/doc/api.txt @@ -143,10 +143,11 @@ Gets/sets the group identity of the process. (See setgid(2).) +process.chdir(directory)+:: Changes the current working directory of the process. -+process.umask(mask)+ :: -Sets the process's file mode creation mask. Child processes inherit the mask -from the parent process. - - returns the old mask. ++process.umask([mask])+ :: +Sets or read the process's file mode creation mask. Child processes inherit +the mask from the parent process. + - returns the old mask if +mask+ argument is given, otherwise returns +the current mask. +process.kill(pid, signal="SIGTERM")+ :: Send a signal to a process. +pid+ is the process id and +signal+ is the diff --git a/src/node.cc b/src/node.cc index 4af11e2c48..f76e4267d7 100644 --- a/src/node.cc +++ b/src/node.cc @@ -471,14 +471,18 @@ static Handle Cwd(const Arguments& args) { static Handle Umask(const Arguments& args){ HandleScope scope; - - if(args.Length() < 1 || !args[0]->IsInt32()) { + unsigned int old; + if(args.Length() < 1) { + old = umask(0); + umask((mode_t)old); + } + else if(!args[0]->IsInt32()) { return ThrowException(Exception::TypeError( String::New("argument must be an integer."))); } - unsigned int mask = args[0]->Uint32Value(); - unsigned int old = umask((mode_t)mask); - + else { + old = umask((mode_t)args[0]->Uint32Value()); + } return scope.Close(Uint32::New(old)); } diff --git a/test/simple/test-umask.js b/test/simple/test-umask.js index 5509cd132c..8674642bae 100644 --- a/test/simple/test-umask.js +++ b/test/simple/test-umask.js @@ -3,4 +3,10 @@ process.mixin(require("../common")); var mask = 0664; var old = process.umask(mask); -assert.equal(true, mask === process.umask(old)); +assert.equal(mask, process.umask(old)); + +// confirm reading the umask does not modify it. +// 1. If the test fails, this call will succeed, but the mask will be set to 0 +assert.equal(old, process.umask()); +// 2. If the test fails, process.umask() will return 0 +assert.equal(old, process.umask()); From d67fdcc177622d8544163587d48de12bc74a6018 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sun, 7 Mar 2010 12:13:16 -0800 Subject: [PATCH 02/11] clean should not docclean --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 20a04926eb..244139dd12 100644 --- a/Makefile +++ b/Makefile @@ -66,12 +66,12 @@ website-upload: doc docclean: @-rm -f doc/node.1 doc/api.xml doc/api.html doc/changelog.html -clean: docclean +clean: @$(WAF) clean + @-find tools/ -name "*.pyc" -delete -distclean: docclean +distclean: clean docclean @-rm -rf build/ - @-find tools/ -name "*.pyc" -delete check: @tools/waf-light check From 209b219b10cde8e225660baea3653645e8c0571c Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 8 Mar 2010 08:33:10 -0800 Subject: [PATCH 03/11] Add environmental varibles to help text --- src/node.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/node.cc b/src/node.cc index f76e4267d7..315e6b4391 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1185,13 +1185,21 @@ static void ParseDebugOpt(const char* arg) { static void PrintHelp() { printf("Usage: node [options] script.js [arguments] \n" + "Options:\n" " -v, --version print node's version\n" " --debug[=port] enable remote debugging via given TCP port\n" " without stopping the execution\n" " --debug-brk[=port] as above, but break in script.js and\n" " wait for remote debugger to connect\n" " --cflags print pre-processor and compiler flags\n" - " --v8-options print v8 command line options\n\n" + " --v8-options print v8 command line options\n" + "\n" + "Enviromental variables:\n" + "NODE_PATH ':'-separated list of directories\n" + " prefixed to the module search path,\n" + " require.paths.\n" + "NODE_DEBUG Print additional debugging output.\n" + "\n" "Documentation can be found at http://nodejs.org/api.html" " or with 'man node'\n"); } From c47391526c171b1d9c3ce389197b9481ebf02fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Geisend=C3=B6rfer?= Date: Sun, 7 Mar 2010 15:33:02 +0100 Subject: [PATCH 04/11] Fix typo in fs.writeStream docs --- doc/api.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api.txt b/doc/api.txt index 752eecf165..6695699c14 100644 --- a/doc/api.txt +++ b/doc/api.txt @@ -845,7 +845,7 @@ Returns a new FileWriteStream object. +options+ is an object with the following defaults: + ---------------------------------------- -{ "flags": "r" +{ "flags": "w" , "encoding": "binary" , "mode": 0666 } From 9a9f08b1bc01edff0b66943334b2e34d3afb7016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Geisend=C3=B6rfer?= Date: Sun, 7 Mar 2010 16:33:21 +0100 Subject: [PATCH 05/11] Add callbacks to stream methods Allows for more fine graining, especially finding out about an individual chunk of data being flushed in a write stream rather than the whole queue. This commit also fixes a bug causing forceClose to fail on a readStream that did not finish opening yet. --- doc/api.txt | 11 ++-- lib/fs.js | 75 +++++++++++++++++++-------- test/simple/test-file-read-stream.js | 9 +++- test/simple/test-file-write-stream.js | 20 +++++-- 4 files changed, 84 insertions(+), 31 deletions(-) diff --git a/doc/api.txt b/doc/api.txt index 6695699c14..a6ca6bf11a 100644 --- a/doc/api.txt +++ b/doc/api.txt @@ -823,7 +823,7 @@ until the stream is resumed. +readStream.resume()+ :: Resumes the stream. Together with +pause()+ this useful to throttle reading. -+readStream.forceClose()+ :: ++readStream.forceClose([callback])+ :: Allows to close the stream before the +"end"+ is reached. No more events other than +"close"+ will be fired after this method has been called. @@ -855,15 +855,18 @@ Returns a new FileWriteStream object. A boolean that is +true+ by default, but turns +false+ after an +"error"+ occured or +close()+ / +forceClose()+ was called. -+writeStream.write(data)+ :: ++writeStream.write(data, [callback])+ :: Returns +true+ if the data was flushed to the kernel, and +false+ if it was queued up for being written later. A +"drain"+ will fire after all queued data has been written. ++ +You can also specify +callback+ to be notified when the data from this write +has been flushed. The first param is +err+, the second is +bytesWritten+. -+writeStream.close()+ :: ++writeStream.close([callback])+ :: Closes the stream right after all queued +write()+ calls have finished. -+writeStream.forceClose()+ :: ++writeStream.forceClose([callback])+ :: Allows to close the stream regardless of its current state. == HTTP diff --git a/lib/fs.js b/lib/fs.js index 74e1e3ef85..5b57b3603f 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -495,16 +495,31 @@ var FileReadStream = exports.FileReadStream = function(path, options) { read(); }); - this.forceClose = function() { + this.forceClose = function(cb) { this.readable = false; - fs.close(this.fd, function(err) { - if (err) { - self.emit('error', err); - return; - } - self.emit('close'); - }); + function close() { + fs.close(self.fd, function(err) { + if (err) { + if (cb) { + cb(err); + } + self.emit('error', err); + return; + } + + if (cb) { + cb(null); + } + self.emit('close'); + }); + } + + if (this.fd) { + close(); + } else { + this.addListener('open', close); + } }; this.pause = function() { @@ -546,7 +561,7 @@ var FileWriteStream = exports.FileWriteStream = function(path, options) { queue = [], busy = false; - queue.push([fs.open, this.path, this.flags, this.mode]); + queue.push([fs.open, this.path, this.flags, this.mode, undefined]); function flush() { if (busy) { @@ -560,29 +575,40 @@ var FileWriteStream = exports.FileWriteStream = function(path, options) { busy = true; - var method = args.shift(); + var + method = args.shift(), + cb = args.pop(); args.push(function(err) { busy = false; if (err) { self.writeable = false; + if (cb) { + cb(err); + } self.emit('error', err); return; } - // save reference for file pointer - if (method === fs.open) { - self.fd = arguments[1]; - self.emit('open', self.fd); - } - // stop flushing after close if (method === fs.close) { + if (cb) { + cb(null); + } self.emit('close'); return; } + // save reference for file pointer + if (method === fs.open) { + self.fd = arguments[1]; + self.emit('open', self.fd); + } else if (cb) { + // write callback + cb(null, arguments[1]); + } + flush(); }); @@ -594,30 +620,37 @@ var FileWriteStream = exports.FileWriteStream = function(path, options) { method.apply(null, args); }; - this.write = function(data) { + this.write = function(data, cb) { if (!this.writeable) { throw new Error('stream not writeable'); } - queue.push([fs.write, data, undefined, this.encoding]); + queue.push([fs.write, data, undefined, this.encoding, cb]); flush(); return false; }; - this.close = function() { + this.close = function(cb) { this.writeable = false; - queue.push([fs.close,]); + queue.push([fs.close, cb]); flush(); }; - this.forceClose = function() { + this.forceClose = function(cb) { this.writeable = false; fs.close(self.fd, function(err) { if (err) { + if (cb) { + cb(err); + } + self.emit('error', err); return; } + if (cb) { + cb(null); + } self.emit('close'); }); }; diff --git a/test/simple/test-file-read-stream.js b/test/simple/test-file-read-stream.js index 447629e41b..445957f6dc 100644 --- a/test/simple/test-file-read-stream.js +++ b/test/simple/test-file-read-stream.js @@ -7,7 +7,8 @@ var callbacks = { open: -1, end: -1, - close: -1 + close: -1, + forceClose: -1 }, paused = false, @@ -47,6 +48,12 @@ file assert.equal(fs.readFileSync(fn), fileContent); }); +var file2 = fs.createReadStream(fn); +file2.forceClose(function(err) { + assert.ok(!err); + callbacks.forceClose++; +}); + process.addListener('exit', function() { for (var k in callbacks) { assert.equal(0, callbacks[k], k+' count off by '+callbacks[k]); diff --git a/test/simple/test-file-write-stream.js b/test/simple/test-file-write-stream.js index 89059033ab..bb74db58a2 100644 --- a/test/simple/test-file-write-stream.js +++ b/test/simple/test-file-write-stream.js @@ -4,12 +4,14 @@ var fn = path.join(fixturesDir, "write.txt"), file = fs.createWriteStream(fn), - EXPECTED = '0123456789', + EXPECTED = '012345678910', callbacks = { open: -1, drain: -2, - close: -1 + close: -1, + closeCb: -1, + write: -11, }; file @@ -27,7 +29,10 @@ file file.write(EXPECTED); } else if (callbacks.drain == 0) { assert.equal(EXPECTED+EXPECTED, fs.readFileSync(fn)); - file.close(); + file.close(function(err) { + assert.ok(!err); + callbacks.closeCb++; + }); } }) .addListener('close', function() { @@ -39,8 +44,13 @@ file fs.unlinkSync(fn); }); -for (var i = 0; i < 10; i++) { - assert.strictEqual(false, file.write(i)); +for (var i = 0; i < 11; i++) { + (function(i) { + assert.strictEqual(false, file.write(i, function(err, bytesWritten) { + callbacks.write++; + assert.equal(new String(i).length, bytesWritten); + })); + })(i); } process.addListener('exit', function() { From 40e42e8107f9c580d83167305c42e8471e7b6259 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 8 Mar 2010 09:10:24 -0800 Subject: [PATCH 06/11] Replace --cflags with --vars --- src/node.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/node.cc b/src/node.cc index 315e6b4391..0911912fa6 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1191,8 +1191,8 @@ static void PrintHelp() { " without stopping the execution\n" " --debug-brk[=port] as above, but break in script.js and\n" " wait for remote debugger to connect\n" - " --cflags print pre-processor and compiler flags\n" " --v8-options print v8 command line options\n" + " --vars print various compiled-in variables\n" "\n" "Enviromental variables:\n" "NODE_PATH ':'-separated list of directories\n" @@ -1216,8 +1216,10 @@ static void ParseArgs(int *argc, char **argv) { } else if (strcmp(arg, "--version") == 0 || strcmp(arg, "-v") == 0) { printf("%s\n", NODE_VERSION); exit(0); - } else if (strcmp(arg, "--cflags") == 0) { - printf("%s\n", NODE_CFLAGS); + } else if (strcmp(arg, "--vars") == 0) { + printf("NODE_PREFIX: %s\n", NODE_PREFIX); + printf("NODE_LIBRARIES_PREFIX: %s/%s\n", NODE_PREFIX, "lib/node/libraries"); + printf("NODE_CFLAGS: %s\n", NODE_CFLAGS); exit(0); } else if (strcmp(arg, "--help") == 0 || strcmp(arg, "-h") == 0) { PrintHelp(); From c98b0799bf77cc5e01ae9a3c39d8180d8ee976d4 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 8 Mar 2010 09:33:11 -0800 Subject: [PATCH 07/11] Upgrade V8 to 2.1.2.6 --- deps/v8/SConstruct | 1 + deps/v8/include/v8.h | 16 +++ deps/v8/src/api.cc | 23 ++-- deps/v8/src/arm/codegen-arm.cc | 5 +- deps/v8/src/arm/codegen-arm.h | 2 +- deps/v8/src/arm/fast-codegen-arm.cc | 1 + deps/v8/src/arm/full-codegen-arm.cc | 1 + deps/v8/src/arm/jump-target-arm.cc | 1 + deps/v8/src/arm/virtual-frame-arm.cc | 1 + deps/v8/src/arm/virtual-frame-arm.h | 14 +-- deps/v8/src/ast.h | 4 - deps/v8/src/codegen-inl.h | 3 + deps/v8/src/codegen.cc | 1 + deps/v8/src/full-codegen.cc | 1 + deps/v8/src/heap.cc | 27 ++--- deps/v8/src/heap.h | 8 +- deps/v8/src/ia32/codegen-ia32.cc | 4 +- deps/v8/src/ia32/codegen-ia32.h | 2 +- deps/v8/src/ia32/full-codegen-ia32.cc | 1 + deps/v8/src/ia32/jump-target-ia32.cc | 1 + deps/v8/src/ia32/register-allocator-ia32.cc | 1 + deps/v8/src/ia32/stub-cache-ia32.cc | 34 +++--- deps/v8/src/ia32/virtual-frame-ia32.cc | 1 + deps/v8/src/ia32/virtual-frame-ia32.h | 16 ++- deps/v8/src/ic.cc | 14 --- deps/v8/src/jump-target-inl.h | 7 +- deps/v8/src/jump-target.cc | 3 +- deps/v8/src/register-allocator-inl.h | 1 - deps/v8/src/register-allocator.cc | 1 + deps/v8/src/version.cc | 2 +- deps/v8/src/virtual-frame-inl.h | 109 ++++++++++++++++++ deps/v8/src/virtual-frame.cc | 68 +---------- deps/v8/src/x64/codegen-x64.cc | 4 +- deps/v8/src/x64/codegen-x64.h | 2 +- deps/v8/src/x64/fast-codegen-x64.cc | 1 + deps/v8/src/x64/full-codegen-x64.cc | 1 + deps/v8/src/x64/jump-target-x64.cc | 1 + deps/v8/src/x64/register-allocator-x64.cc | 1 + deps/v8/src/x64/virtual-frame-x64.cc | 1 + deps/v8/src/x64/virtual-frame-x64.h | 14 +-- deps/v8/test/cctest/test-api.cc | 75 +++++++++++- .../v8/test/cctest/test-thread-termination.cc | 22 +++- deps/v8/tools/gyp/v8.gyp | 1 + deps/v8/tools/visual_studio/v8_base.vcproj | 4 + .../v8/tools/visual_studio/v8_base_arm.vcproj | 4 + .../v8/tools/visual_studio/v8_base_x64.vcproj | 4 + 46 files changed, 335 insertions(+), 174 deletions(-) create mode 100644 deps/v8/src/virtual-frame-inl.h diff --git a/deps/v8/SConstruct b/deps/v8/SConstruct index 5483663fd6..0b038039ef 100644 --- a/deps/v8/SConstruct +++ b/deps/v8/SConstruct @@ -267,6 +267,7 @@ V8_EXTRA_FLAGS = { 'gcc': { 'all': { 'WARNINGFLAGS': ['-Wall', + '-Werror', '-W', '-Wno-unused-parameter', '-Wnon-virtual-dtor'] diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 13f8191703..69b93c69c0 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -2441,6 +2441,16 @@ class V8EXPORT V8 { */ static void TerminateExecution(); + /** + * Is V8 terminating JavaScript execution. + * + * Returns true if JavaScript execution is currently terminating + * because of a call to TerminateExecution. In that case there are + * still JavaScript frames on the stack and the termination + * exception is still active. + */ + static bool IsExecutionTerminating(); + /** * Releases any resources used by v8 and stops any utility threads * that may be running. Note that disposing v8 is permanent, it @@ -2473,6 +2483,12 @@ class V8EXPORT V8 { */ static void LowMemoryNotification(); + /** + * Optional notification that a context has been disposed. V8 uses + * these notifications to guide the garbage collection heuristic. + */ + static void ContextDisposedNotification(); + private: V8(); diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index dbb3d8b741..22d2f4bc78 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -438,7 +438,6 @@ bool V8::IsGlobalWeak(i::Object** obj) { void V8::DisposeGlobal(i::Object** obj) { LOG_API("DisposeGlobal"); if (!i::V8::IsRunning()) return; - if ((*obj)->IsGlobalContext()) i::Heap::NotifyContextDisposed(); i::GlobalHandles::Destroy(obj); } @@ -2821,6 +2820,12 @@ void v8::V8::LowMemoryNotification() { } +void v8::V8::ContextDisposedNotification() { + if (!i::V8::IsRunning()) return; + i::Heap::NotifyContextDisposed(); +} + + const char* v8::V8::GetVersion() { static v8::internal::EmbeddedVector buffer; v8::internal::Version::GetString(buffer); @@ -2852,13 +2857,6 @@ Persistent v8::Context::New( i::Handle env; { ENTER_V8; -#if defined(ANDROID) - // On mobile device, full GC is expensive, leave it to the system to - // decide when should make a full GC. -#else - // Give the heap a chance to cleanup if we've disposed contexts. - i::Heap::CollectAllGarbageIfContextDisposed(); -#endif v8::Handle proxy_template = global_template; i::Handle proxy_constructor; i::Handle global_constructor; @@ -3561,6 +3559,15 @@ void V8::TerminateExecution() { } +bool V8::IsExecutionTerminating() { + if (!i::V8::IsRunning()) return false; + if (i::Top::has_scheduled_exception()) { + return i::Top::scheduled_exception() == i::Heap::termination_exception(); + } + return false; +} + + String::Utf8Value::Utf8Value(v8::Handle obj) { EnsureInitialized("v8::String::Utf8Value::Utf8Value()"); if (obj.IsEmpty()) { diff --git a/deps/v8/src/arm/codegen-arm.cc b/deps/v8/src/arm/codegen-arm.cc index 95c50f262f..6644d02487 100644 --- a/deps/v8/src/arm/codegen-arm.cc +++ b/deps/v8/src/arm/codegen-arm.cc @@ -35,7 +35,7 @@ #include "register-allocator-inl.h" #include "runtime.h" #include "scopes.h" - +#include "virtual-frame-inl.h" namespace v8 { namespace internal { @@ -133,9 +133,6 @@ CodeGenerator::CodeGenerator(MacroAssembler* masm) } -Scope* CodeGenerator::scope() { return info_->function()->scope(); } - - // Calling conventions: // fp: caller's frame pointer // sp: stack pointer diff --git a/deps/v8/src/arm/codegen-arm.h b/deps/v8/src/arm/codegen-arm.h index 1a2e5525a2..2bc482ed5e 100644 --- a/deps/v8/src/arm/codegen-arm.h +++ b/deps/v8/src/arm/codegen-arm.h @@ -203,7 +203,7 @@ class CodeGenerator: public AstVisitor { // Accessors inline bool is_eval(); - Scope* scope(); + inline Scope* scope(); // Generating deferred code. void ProcessDeferred(); diff --git a/deps/v8/src/arm/fast-codegen-arm.cc b/deps/v8/src/arm/fast-codegen-arm.cc index aa7128fcae..0d322d1a3e 100644 --- a/deps/v8/src/arm/fast-codegen-arm.cc +++ b/deps/v8/src/arm/fast-codegen-arm.cc @@ -29,6 +29,7 @@ #include "codegen-inl.h" #include "fast-codegen.h" +#include "scopes.h" namespace v8 { namespace internal { diff --git a/deps/v8/src/arm/full-codegen-arm.cc b/deps/v8/src/arm/full-codegen-arm.cc index 4896373802..c37e29f63c 100644 --- a/deps/v8/src/arm/full-codegen-arm.cc +++ b/deps/v8/src/arm/full-codegen-arm.cc @@ -32,6 +32,7 @@ #include "debug.h" #include "full-codegen.h" #include "parser.h" +#include "scopes.h" namespace v8 { namespace internal { diff --git a/deps/v8/src/arm/jump-target-arm.cc b/deps/v8/src/arm/jump-target-arm.cc index 3315f8381c..a84060d570 100644 --- a/deps/v8/src/arm/jump-target-arm.cc +++ b/deps/v8/src/arm/jump-target-arm.cc @@ -30,6 +30,7 @@ #include "codegen-inl.h" #include "jump-target-inl.h" #include "register-allocator-inl.h" +#include "virtual-frame-inl.h" namespace v8 { namespace internal { diff --git a/deps/v8/src/arm/virtual-frame-arm.cc b/deps/v8/src/arm/virtual-frame-arm.cc index 0f7c597120..6e1a47fb6e 100644 --- a/deps/v8/src/arm/virtual-frame-arm.cc +++ b/deps/v8/src/arm/virtual-frame-arm.cc @@ -30,6 +30,7 @@ #include "codegen-inl.h" #include "register-allocator-inl.h" #include "scopes.h" +#include "virtual-frame-inl.h" namespace v8 { namespace internal { diff --git a/deps/v8/src/arm/virtual-frame-arm.h b/deps/v8/src/arm/virtual-frame-arm.h index a45cfc6e16..f69bddf55f 100644 --- a/deps/v8/src/arm/virtual-frame-arm.h +++ b/deps/v8/src/arm/virtual-frame-arm.h @@ -62,7 +62,7 @@ class VirtualFrame : public ZoneObject { VirtualFrame(); // Construct a virtual frame as a clone of an existing one. - explicit VirtualFrame(VirtualFrame* original); + explicit inline VirtualFrame(VirtualFrame* original); CodeGenerator* cgen() { return CodeGeneratorScope::Current(); } MacroAssembler* masm() { return cgen()->masm(); } @@ -344,9 +344,9 @@ class VirtualFrame : public ZoneObject { void EmitPushMultiple(int count, int src_regs); // Push an element on the virtual frame. - void Push(Register reg, NumberInfo::Type info = NumberInfo::kUnknown); - void Push(Handle value); - void Push(Smi* value) { Push(Handle(value)); } + inline void Push(Register reg, NumberInfo::Type info = NumberInfo::kUnknown); + inline void Push(Handle value); + inline void Push(Smi* value); // Pushing a result invalidates it (its contents become owned by the frame). void Push(Result* result) { @@ -362,7 +362,7 @@ class VirtualFrame : public ZoneObject { // Nip removes zero or more elements from immediately below the top // of the frame, leaving the previous top-of-frame value on top of // the frame. Nip(k) is equivalent to x = Pop(), Drop(k), Push(x). - void Nip(int num_dropped); + inline void Nip(int num_dropped); private: static const int kLocal0Offset = JavaScriptFrameConstants::kLocal0Offset; @@ -457,7 +457,7 @@ class VirtualFrame : public ZoneObject { // Push a copy of a frame slot (typically a local or parameter) on top of // the frame. - void PushFrameSlotAt(int index); + inline void PushFrameSlotAt(int index); // Push a the value of a frame slot (typically a local or parameter) on // top of the frame and invalidate the slot. @@ -500,7 +500,7 @@ class VirtualFrame : public ZoneObject { // Register counts are correctly updated. int InvalidateFrameSlotAt(int index); - bool Equals(VirtualFrame* other); + inline bool Equals(VirtualFrame* other); // Classes that need raw access to the elements_ array. friend class DeferredCode; diff --git a/deps/v8/src/ast.h b/deps/v8/src/ast.h index 927a9f5035..f2171cc3ef 100644 --- a/deps/v8/src/ast.h +++ b/deps/v8/src/ast.h @@ -931,10 +931,6 @@ class VariableProxy: public Expression { return var()->is_global() || var()->rewrite()->IsLeaf(); } - // Reading from a mutable variable is a side effect, but 'this' is - // immutable. - virtual bool IsTrivial() { return is_this(); } - bool IsVariable(Handle n) { return !is_this() && name().is_identical_to(n); } diff --git a/deps/v8/src/codegen-inl.h b/deps/v8/src/codegen-inl.h index da8cbf7034..6534e7fd63 100644 --- a/deps/v8/src/codegen-inl.h +++ b/deps/v8/src/codegen-inl.h @@ -50,8 +50,11 @@ namespace v8 { namespace internal { Handle