Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Cleanups and optimizations #22

Merged
merged 18 commits into from
Feb 28, 2017
Merged

Cleanups and optimizations #22

merged 18 commits into from
Feb 28, 2017

Conversation

pinepain
Copy link
Member

@pinepain pinepain commented Feb 25, 2017

This PR adds low-level optimizations, simplify some internal methods and fix few bugs. For more details see change list below.

  • * Replace V8\Isolate::GetCurrentContext with V8\Isolate::GetEnteredContext();
  • * Remove V8\ObjectValue::CreationContext(), use V8\ObjectValue::GetContext();
  • Add V8\PropertyCallbackInfo::ShouldThrowOnError() method;
  • Add V8\FunctionCallbackInfo::NewTarget() method;
  • V8\ReturnValue now explicitly holds isolate and context which could be accessed outside of calling context, though ReturnValue::{Get,Set} could be accessed only within calling context as before;
  • Fix potential problems with V8\FunctionCallbackInfo and V8\PropertyCallbackInfo, now they are fully build, properly stores owning isolate and context and could be safely used outside calling scope;
  • Fix leak when V8\ScriptCompiler::CompileFunctionInContext() invoked with arguments or arguments and context extensions;
  • Fix segfault under when abruptly exiting (die(), exit(), uncaught exception) from isolate which entered multiple time or from multiple nested isolates (quite rare use case).

Notes:

  • Add V8\Exceptions\ValueException to stubs. It support was in extension for ages but for some reason it was missed from stubs.
  • Removed $global_template and $global_object private props from V8\Context were never exposed to end-user.

* - BC-breaking or potentially BC-breaking changes

Ther rationale for that as it may hold older context which zval was already destroyed and we do not want to cover this case at this time as it adds more ambiguity then practical benefit
This fixes segfaults when isolate entered multiple time or when multiple isolates entered and unclean shutdown performed (when die/exit called or uncaught exception occurs).
@pinepain pinepain force-pushed the optimization branch 2 times, most recently from b6bc66d to b4de00b Compare February 26, 2017 19:37
@pinepain pinepain merged commit f53130e into master Feb 28, 2017
@pinepain pinepain deleted the optimization branch February 28, 2017 07:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant