Skip to content

Commit

Permalink
Version 3.7.8.
Browse files Browse the repository at this point in the history
Removed hidden prototype from builtins, i.e., deleting an overridden function on builtins will not make the original function reappear.

Added NetBSD support for scons build.

Performance improvements on all platforms.


git-svn-id: https://v8.googlecode.com/svn/trunk@10011 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
  • Loading branch information
[email protected] committed Nov 17, 2011
1 parent 4a4a96b commit 51f69e3
Show file tree
Hide file tree
Showing 62 changed files with 1,076 additions and 1,451 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2011-11-17: Version 3.7.8

Removed hidden prototype from builtins, i.e., deleting an overridden
function on builtins will not make the original function reappear.

Added NetBSD support for scons build.

Performance improvements on all platforms.


2011-11-14: Version 3.7.7

Fix missing fast property accessors in heap snapshots.
Expand Down
19 changes: 18 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ LIBRARY_FLAGS = {
'LIBPATH' : ['/usr/local/lib'],
'CCFLAGS': ['-ansi'],
},
'os:netbsd': {
'CPPPATH' : ['/usr/pkg/include'],
'LIBPATH' : ['/usr/pkg/lib'],
},
'os:win32': {
'CCFLAGS': ['-DWIN32'],
'CXXFLAGS': ['-DWIN32'],
Expand Down Expand Up @@ -364,6 +368,9 @@ MKSNAPSHOT_EXTRA_FLAGS = {
'os:win32': {
'LIBS': ['winmm', 'ws2_32'],
},
'os:netbsd': {
'LIBS': ['execinfo', 'pthread']
},
'compress_startup_data:bz2': {
'os:linux': {
'LIBS': ['bz2']
Expand Down Expand Up @@ -428,6 +435,9 @@ CCTEST_EXTRA_FLAGS = {
'os:win32': {
'LIBS': ['winmm', 'ws2_32']
},
'os:netbsd': {
'LIBS': ['execinfo', 'pthread']
},
'arch:arm': {
'LINKFLAGS': ARM_LINK_FLAGS
},
Expand Down Expand Up @@ -487,6 +497,10 @@ SAMPLE_FLAGS = {
'os:win32': {
'LIBS': ['winmm', 'ws2_32']
},
'os:netbsd': {
'LIBPATH' : ['/usr/pkg/lib'],
'LIBS': ['execinfo', 'pthread']
},
'arch:arm': {
'LINKFLAGS': ARM_LINK_FLAGS,
'armeabi:soft' : {
Expand Down Expand Up @@ -818,6 +832,9 @@ D8_FLAGS = {
'os:win32': {
'LIBS': ['winmm', 'ws2_32'],
},
'os:netbsd': {
'LIBS': ['pthread'],
},
'arch:arm': {
'LINKFLAGS': ARM_LINK_FLAGS
},
Expand Down Expand Up @@ -951,7 +968,7 @@ PLATFORM_OPTIONS = {
'help': 'the architecture to build for'
},
'os': {
'values': ['freebsd', 'linux', 'macos', 'win32', 'openbsd', 'solaris', 'cygwin'],
'values': ['freebsd', 'linux', 'macos', 'win32', 'openbsd', 'solaris', 'cygwin', 'netbsd'],
'guess': GuessOS,
'help': 'the os to build for'
},
Expand Down
93 changes: 68 additions & 25 deletions benchmarks/spinning-balls/v.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ var numberOfFrames = 0;
var sumOfSquaredPauses = 0;
var benchmarkStartTime = void 0;
var benchmarkTimeLimit = void 0;
var autoScale = void 0;
var pauseDistribution = [];


Expand Down Expand Up @@ -193,15 +194,22 @@ function ModifyPointsSet() {
}


function PausePlot(width, height, size) {
function PausePlot(width, height, size, scale) {
var canvas = document.createElement("canvas");
canvas.width = this.width = width;
canvas.height = this.height = height;
document.body.appendChild(canvas);

this.ctx = canvas.getContext('2d');

this.maxPause = 0;
if (typeof scale !== "number") {
this.autoScale = true;
this.maxPause = 0;
} else {
this.autoScale = false;
this.maxPause = scale;
}

this.size = size;

// Initialize cyclic buffer for pauses.
Expand Down Expand Up @@ -248,18 +256,21 @@ PausePlot.prototype.iteratePauses = function (f) {

PausePlot.prototype.draw = function () {
var first = null;
this.iteratePauses(function (i, v) {
if (first === null) {
first = v;
}
this.maxPause = Math.max(v, this.maxPause);
});

if (this.autoScale) {
this.iteratePauses(function (i, v) {
if (first === null) {
first = v;
}
this.maxPause = Math.max(v, this.maxPause);
});
}

var dx = this.width / this.size;
var dy = this.height / this.maxPause;

this.ctx.save();
this.ctx.clearRect(0, 0, 480, 240);
this.ctx.clearRect(0, 0, this.width, this.height);
this.ctx.beginPath();
this.ctx.moveTo(1, dy * this.pauses[this.start]);
var p = first;
Expand Down Expand Up @@ -414,23 +425,54 @@ function render() {
}


function renderForm() {
form = document.createElement("form");
form.setAttribute("action", "javascript:start()");
var label = document.createTextNode("Time limit in seconds ");
var input = document.createElement("input");
input.setAttribute("id", "timelimit");
input.setAttribute("value", "60");
var button = document.createElement("input");
function Form() {
function create(tag) { return document.createElement(tag); }
function text(value) { return document.createTextNode(value); }

this.form = create("form");
this.form.setAttribute("action", "javascript:start()");

var table = create("table");
table.setAttribute("style", "margin-left: auto; margin-right: auto;");

function col(a) {
var td = create("td");
td.appendChild(a);
return td;
}

function row(a, b) {
var tr = create("tr");
tr.appendChild(col(a));
tr.appendChild(col(b));
return tr;
}

this.timelimit = create("input");
this.timelimit.setAttribute("value", "60");

table.appendChild(row(text("Time limit in seconds"), this.timelimit));

this.autoscale = create("input");
this.autoscale.setAttribute("type", "checkbox");
this.autoscale.setAttribute("checked", "true");
table.appendChild(row(text("Autoscale pauses plot"), this.autoscale));

var button = create("input");
button.setAttribute("type", "submit");
button.setAttribute("value", "Start");
form.appendChild(label);
form.appendChild(input);
form.appendChild(button);
document.body.appendChild(form);
this.form.appendChild(table);
this.form.appendChild(button);

document.body.appendChild(this.form);
}


Form.prototype.remove = function () {
document.body.removeChild(this.form);
};


function init() {
livePoints = new PointsList;
dyingPoints = new PointsList;
Expand All @@ -442,14 +484,15 @@ function init() {
div = document.createElement("div");
document.body.appendChild(div);

pausePlot = new PausePlot(480, 240, 160);
pausePlot = new PausePlot(480, autoScale ? 240 : 500, 160, autoScale ? void 0 : 500);
}

function start() {
benchmarkTimeLimit = document.getElementById("timelimit").value * 1000;
document.body.removeChild(form);
benchmarkTimeLimit = form.timelimit.value * 1000;
autoScale = form.autoscale.checked;
form.remove();
init();
render();
}

renderForm();
var form = new Form();
2 changes: 1 addition & 1 deletion src/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ RegisteredExtension* RegisteredExtension::first_extension_ = NULL;


RegisteredExtension::RegisteredExtension(Extension* extension)
: extension_(extension), state_(UNVISITED) { }
: extension_(extension) { }


void RegisteredExtension::Register(RegisteredExtension* that) {
Expand Down
7 changes: 0 additions & 7 deletions src/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,6 @@ class ApiFunction {
};


enum ExtensionTraversalState {
UNVISITED, VISITED, INSTALLED
};


class RegisteredExtension {
public:
Expand All @@ -149,14 +145,11 @@ class RegisteredExtension {
Extension* extension() { return extension_; }
RegisteredExtension* next() { return next_; }
RegisteredExtension* next_auto() { return next_auto_; }
ExtensionTraversalState state() { return state_; }
void set_state(ExtensionTraversalState value) { state_ = value; }
static RegisteredExtension* first_extension() { return first_extension_; }
private:
Extension* extension_;
RegisteredExtension* next_;
RegisteredExtension* next_auto_;
ExtensionTraversalState state_;
static RegisteredExtension* first_extension_;
};

Expand Down
76 changes: 22 additions & 54 deletions src/arm/deoptimizer-arm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ int Deoptimizer::patch_size() {
}


void Deoptimizer::EnsureRelocSpaceForLazyDeoptimization(Handle<Code> code) {
// Nothing to do. No new relocation information is written for lazy
// deoptimization on ARM.
}


void Deoptimizer::DeoptimizeFunction(JSFunction* function) {
HandleScope scope;
AssertNoAllocation no_allocation;
Expand All @@ -58,58 +52,37 @@ void Deoptimizer::DeoptimizeFunction(JSFunction* function) {

// Get the optimized code.
Code* code = function->code();
Address code_start_address = code->instruction_start();

// Invalidate the relocation information, as it will become invalid by the
// code patching below, and is not needed any more.
code->InvalidateRelocation();

// For each return after a safepoint insert an absolute call to the
// corresponding deoptimization entry.
unsigned last_pc_offset = 0;
SafepointTable table(function->code());
for (unsigned i = 0; i < table.length(); i++) {
unsigned pc_offset = table.GetPcOffset(i);
SafepointEntry safepoint_entry = table.GetEntry(i);
int deoptimization_index = safepoint_entry.deoptimization_index();
int gap_code_size = safepoint_entry.gap_code_size();
// Check that we did not shoot past next safepoint.
CHECK(pc_offset >= last_pc_offset);
// For each LLazyBailout instruction insert a call to the corresponding
// deoptimization entry.
DeoptimizationInputData* deopt_data =
DeoptimizationInputData::cast(code->deoptimization_data());
#ifdef DEBUG
// Destroy the code which is not supposed to be run again.
int instructions = (pc_offset - last_pc_offset) / Assembler::kInstrSize;
CodePatcher destroyer(code->instruction_start() + last_pc_offset,
instructions);
for (int x = 0; x < instructions; x++) {
destroyer.masm()->bkpt(0);
}
Address prev_call_address = NULL;
#endif
last_pc_offset = pc_offset;
if (deoptimization_index != Safepoint::kNoDeoptimizationIndex) {
Address deoptimization_entry = Deoptimizer::GetDeoptimizationEntry(
deoptimization_index, Deoptimizer::LAZY);
last_pc_offset += gap_code_size;
int call_size_in_bytes = MacroAssembler::CallSize(deoptimization_entry,
RelocInfo::NONE);
int call_size_in_words = call_size_in_bytes / Assembler::kInstrSize;
ASSERT(call_size_in_bytes % Assembler::kInstrSize == 0);
ASSERT(call_size_in_bytes <= patch_size());
CodePatcher patcher(code->instruction_start() + last_pc_offset,
call_size_in_words);
patcher.masm()->Call(deoptimization_entry, RelocInfo::NONE);
last_pc_offset += call_size_in_bytes;
}
}

for (int i = 0; i < deopt_data->DeoptCount(); i++) {
if (deopt_data->Pc(i)->value() == -1) continue;
Address call_address = code_start_address + deopt_data->Pc(i)->value();
Address deopt_entry = GetDeoptimizationEntry(i, LAZY);
int call_size_in_bytes = MacroAssembler::CallSize(deopt_entry,
RelocInfo::NONE);
int call_size_in_words = call_size_in_bytes / Assembler::kInstrSize;
ASSERT(call_size_in_bytes % Assembler::kInstrSize == 0);
ASSERT(call_size_in_bytes <= patch_size());
CodePatcher patcher(call_address, call_size_in_words);
patcher.masm()->Call(deopt_entry, RelocInfo::NONE);
ASSERT(prev_call_address == NULL ||
call_address >= prev_call_address + patch_size());
ASSERT(call_address + patch_size() <= code->instruction_end());
#ifdef DEBUG
// Destroy the code which is not supposed to be run again.
int instructions =
(code->safepoint_table_offset() - last_pc_offset) / Assembler::kInstrSize;
CodePatcher destroyer(code->instruction_start() + last_pc_offset,
instructions);
for (int x = 0; x < instructions; x++) {
destroyer.masm()->bkpt(0);
}
prev_call_address = call_address;
#endif
}

Isolate* isolate = code->GetIsolate();

Expand All @@ -131,11 +104,6 @@ void Deoptimizer::DeoptimizeFunction(JSFunction* function) {
PrintF("[forced deoptimization: ");
function->PrintName();
PrintF(" / %x]\n", reinterpret_cast<uint32_t>(function));
#ifdef DEBUG
if (FLAG_print_code) {
code->PrintLn();
}
#endif
}
}

Expand Down
Loading

0 comments on commit 51f69e3

Please sign in to comment.