On Mon, Jun 9, 2014 at 10:54 PM, Jane Chen wrote:
> It seems to me that FunctionTemplate::Inherit does not allow multiple
> inheritance, i.e., there is only one partent template and the last one wins.
> Is that right?
>
> Thanks!
That's correct, it's standard JS prototypal inheritance.
--
--
v
In terms of hidden classes, there shouldn't be a difference.
However, since you're setting valueA and valueB in the constructor, setting
them on the prototype too seems entirely pointless to me. The prototype's
values are never visible from instance objects, right? Unless you want to
delete them o
Hello everyone,
I'm trying to implement RequireJS on my JS Engine based on v8 (v8 3.21). I
have a problem with asynchronous loading and evaluation of scripts.
The main thread initialize v8 : create its isolate, context, script etc ..
When the main script is ready, the current isolate is locke
Hi,
When I create many objects new Machine like this
```
function Machine(power) {
var enabled = false;
this.enable = function() {
enabled = true;
};
this.disable = function() {
enabled = false;
};
}
var machines = []
for(var i=0; i<1; i++) machines.push(new Machine)
```
.
On Tue, Jun 10, 2014 at 9:58 PM, Ilya Kantor wrote:
> Hi,
>
> When I create many objects new Machine like this
> ```
> function Machine(power) {
> var enabled = false;
>
> this.enable = function() {
> enabled = true;
> };
> this.disable = function() {
> enabled = false;
> };
> }
Hi Ben,
Is that somehow related with "Hidden classes" for objects or that's a
completely another optimization technique?
среда, 11 июня 2014 г., 0:29:07 UTC+4 пользователь Ben Noordhuis написал:
>
> On Tue, Jun 10, 2014 at 9:58 PM, Ilya Kantor > wrote:
> > Hi,
> >
> > When I create many obje
The following drops the need for the closure, and lets v8 optimize nicely.
Unfortunately you lose the hidden aspect of the internal state.
function Machine(power) {
this.enabled = true;
}
Machine.prototype.enable = function() {
this.enabled = true;
};
Machine.prototype.disable() {
this.ena
Hi Stefan,
I'm asking to deeper understand V8.
What's going on in the original code (see first message) which leads to
single-function-per-many objects?
> The following drops the need for the closure, and lets v8 optimize nicely.
> Unfortunately you lose the hidden aspect of the internal sta
Understood.
This message just caught my attention, as I am often sad that state hidden
by closure comes with a relatively high price compared to the state
existing on "this".
Anyways, my tests also indicate the function bodies are correctly shared,
leaving only the captured context duplicated.
It
On Tue, Jun 10, 2014 at 10:31 PM, Ilya Kantor wrote:
> Hi Ben,
>
> Is that somehow related with "Hidden classes" for objects or that's a
> completely another optimization technique?
Hidden classes and closures are somewhat orthogonal, they don't
overlap much. See [1] and [2] for good write-ups o
Thanks, Ben!
I was following the example in test-api.cc and it seemed to have worked for
me. I just wanted to make sure that I understand the difference between
FunctionTemplate.InstanceTemplate() and
FunctionTemplate.PrototypeTemplate():
In order for something to be inherited by the children
Correction: I meant to say that "Internal field count needs to be set on
_instance_ template for it to take effect on the instances created on
instance template. Is that right?"
On Tuesday, June 10, 2014 5:28:27 PM UTC-7, Jane Chen wrote:
>
> Thanks, Ben!
>
> I was following the example in tes
12 matches
Mail list logo