Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Upgrade v8 to 3.9.11
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Feb 27, 2012
1 parent fde2600 commit 2e24ded
Show file tree
Hide file tree
Showing 81 changed files with 6,248 additions and 824 deletions.
14 changes: 14 additions & 0 deletions deps/v8/ChangeLog
@@ -1,3 +1,17 @@
2012-02-27: Version 3.9.11

Make 'module' a context-sensitive keyword (V8 issue 1957).


2012-02-24: Version 3.9.10

Fixed V8 issues 1322, 1772 and 1969.

Conformance improvements.

Performance and stability improvements on all platforms.


2012-02-23: Version 3.9.9

Supported fast case for-in in Crankshaft.
Expand Down
4 changes: 3 additions & 1 deletion deps/v8/build/common.gypi
Expand Up @@ -83,6 +83,7 @@
'v8_use_snapshot%': 'true',
'host_os%': '<(OS)',
'v8_use_liveobjectlist%': 'false',
'werror%': '-Werror',

# With post mortem support enabled, metadata is embedded into libv8 that
# describes various parameters of the VM for use by debuggers. See
Expand Down Expand Up @@ -304,7 +305,7 @@
'cflags': [ '-I/usr/pkg/include' ],
}],
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
'cflags': [ '<(werror)', '-W', '-Wno-unused-parameter',
'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
'-Wnon-virtual-dtor', '-Woverloaded-virtual' ],
}],
],
Expand Down Expand Up @@ -351,6 +352,7 @@
}], # OS=="mac"
['OS=="win"', {
'msvs_configuration_attributes': {
'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
'CharacterSet': '1',
},
Expand Down
3 changes: 2 additions & 1 deletion deps/v8/build/standalone.gypi
Expand Up @@ -61,6 +61,7 @@
'host_arch%': '<(host_arch)',
'target_arch%': '<(target_arch)',
'v8_target_arch%': '<(v8_target_arch)',
'werror%': '-Werror',
'conditions': [
['(v8_target_arch=="arm" and host_arch!="arm") or \
(v8_target_arch=="mips" and host_arch!="mips") or \
Expand All @@ -83,7 +84,7 @@
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
or OS=="netbsd"', {
'target_defaults': {
'cflags': [ '-W', '-Wno-unused-parameter',
'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
'-Wnon-virtual-dtor', '-pthread', '-fno-rtti',
'-fno-exceptions', '-pedantic' ],
'ldflags': [ '-pthread', ],
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/include/v8.h
Expand Up @@ -3850,7 +3850,7 @@ class Internals {
static const int kFullStringRepresentationMask = 0x07;
static const int kExternalTwoByteRepresentationTag = 0x02;

static const int kJSObjectType = 0xa8;
static const int kJSObjectType = 0xa9;
static const int kFirstNonstringType = 0x80;
static const int kForeignType = 0x85;

Expand Down
4 changes: 1 addition & 3 deletions deps/v8/src/SConscript
@@ -1,4 +1,4 @@
# Copyright 2011 the V8 project authors. All rights reserved.
# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
Expand Down Expand Up @@ -78,7 +78,6 @@ SOURCES = {
fast-dtoa.cc
fixed-dtoa.cc
handles.cc
hashmap.cc
heap-profiler.cc
heap.cc
hydrogen.cc
Expand Down Expand Up @@ -246,7 +245,6 @@ PREPARSER_SOURCES = {
dtoa.cc
fast-dtoa.cc
fixed-dtoa.cc
hashmap.cc
preparse-data.cc
preparser.cc
preparser-api.cc
Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/api.cc
Expand Up @@ -2760,6 +2760,7 @@ bool v8::Object::Set(uint32_t index, v8::Handle<Value> value) {
self,
index,
value_obj,
NONE,
i::kNonStrictMode);
has_pending_exception = obj.is_null();
EXCEPTION_BAILOUT_CHECK(isolate, false);
Expand Down
21 changes: 14 additions & 7 deletions deps/v8/src/arm/full-codegen-arm.cc
Expand Up @@ -109,6 +109,11 @@ class JumpPatchSite BASE_EMBEDDED {
};


int FullCodeGenerator::self_optimization_header_size() {
return 24;
}


// Generate code for a JS function. On entry to the function the receiver
// and arguments have been pushed on the stack left to right. The actual
// argument count matches the formal parameter count expected by the
Expand All @@ -130,20 +135,14 @@ void FullCodeGenerator::Generate() {
SetFunctionPosition(function());
Comment cmnt(masm_, "[ function compiled by full code generator");

#ifdef DEBUG
if (strlen(FLAG_stop_at) > 0 &&
info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
__ stop("stop-at");
}
#endif

// We can optionally optimize based on counters rather than statistical
// sampling.
if (info->ShouldSelfOptimize()) {
if (FLAG_trace_opt_verbose) {
PrintF("[adding self-optimization header to %s]\n",
*info->function()->debug_name()->ToCString());
}
has_self_optimization_header_ = true;
MaybeObject* maybe_cell = isolate()->heap()->AllocateJSGlobalPropertyCell(
Smi::FromInt(Compiler::kCallsUntilPrimitiveOpt));
JSGlobalPropertyCell* cell;
Expand All @@ -155,9 +154,17 @@ void FullCodeGenerator::Generate() {
Handle<Code> compile_stub(
isolate()->builtins()->builtin(Builtins::kLazyRecompile));
__ Jump(compile_stub, RelocInfo::CODE_TARGET, eq);
ASSERT(masm_->pc_offset() == self_optimization_header_size());
}
}

#ifdef DEBUG
if (strlen(FLAG_stop_at) > 0 &&
info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
__ stop("stop-at");
}
#endif

// Strict mode functions and builtins need to replace the receiver
// with undefined when called as functions (without an explicit
// receiver object). r5 is zero for method calls and non-zero for
Expand Down
6 changes: 3 additions & 3 deletions deps/v8/src/ast.cc
Expand Up @@ -237,8 +237,8 @@ bool IsEqualNumber(void* first, void* second) {


void ObjectLiteral::CalculateEmitStore() {
HashMap properties(&IsEqualString);
HashMap elements(&IsEqualNumber);
ZoneHashMap properties(&IsEqualString);
ZoneHashMap elements(&IsEqualNumber);
for (int i = this->properties()->length() - 1; i >= 0; i--) {
ObjectLiteral::Property* property = this->properties()->at(i);
Literal* literal = property->key();
Expand All @@ -249,7 +249,7 @@ void ObjectLiteral::CalculateEmitStore() {
}

uint32_t hash;
HashMap* table;
ZoneHashMap* table;
void* key;
Factory* factory = Isolate::Current()->factory();
if (handle->IsSymbol()) {
Expand Down
9 changes: 3 additions & 6 deletions deps/v8/src/bootstrapper.cc
Expand Up @@ -214,13 +214,12 @@ class Genesis BASE_EMBEDDED {
};

class ExtensionStates {
public:
public:
ExtensionStates();
ExtensionTraversalState get_state(RegisteredExtension* extension);
void set_state(RegisteredExtension* extension,
ExtensionTraversalState state);
private:
Allocator allocator_;
private:
HashMap map_;
DISALLOW_COPY_AND_ASSIGN(ExtensionStates);
};
Expand Down Expand Up @@ -1961,9 +1960,7 @@ static bool MatchRegisteredExtensions(void* key1, void* key2) {
}

Genesis::ExtensionStates::ExtensionStates()
: allocator_(),
map_(MatchRegisteredExtensions, &allocator_, 8)
{}
: map_(MatchRegisteredExtensions, 8) { }

Genesis::ExtensionTraversalState Genesis::ExtensionStates::get_state(
RegisteredExtension* extension) {
Expand Down
4 changes: 1 addition & 3 deletions deps/v8/src/compilation-cache.h
@@ -1,4 +1,4 @@
// Copyright 2011 the V8 project authors. All rights reserved.
// Copyright 2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
Expand Down Expand Up @@ -31,8 +31,6 @@
namespace v8 {
namespace internal {

class HashMap;

// The compilation cache consists of several generational sub-caches which uses
// this class as a base class. A sub-cache contains a compilation cache tables
// for each generation of the sub-cache. Since the same source code string has
Expand Down
1 change: 1 addition & 0 deletions deps/v8/src/compiler.cc
Expand Up @@ -118,6 +118,7 @@ bool CompilationInfo::ShouldSelfOptimize() {
FLAG_crankshaft &&
!Serializer::enabled() &&
!function()->flags()->Contains(kDontSelfOptimize) &&
!function()->flags()->Contains(kDontOptimize) &&
(shared_info().is_null() || !shared_info()->optimization_disabled());
}

Expand Down
3 changes: 1 addition & 2 deletions deps/v8/src/cpu-profiler.h
@@ -1,4 +1,4 @@
// Copyright 2010 the V8 project authors. All rights reserved.
// Copyright 2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
Expand Down Expand Up @@ -41,7 +41,6 @@ class CodeEntry;
class CodeMap;
class CpuProfile;
class CpuProfilesCollection;
class HashMap;
class ProfileGenerator;
class TokenEnumerator;

Expand Down
9 changes: 5 additions & 4 deletions deps/v8/src/d8.js
Expand Up @@ -122,13 +122,15 @@ Debug.State = {
};
var trace_compile = false; // Tracing all compile events?
var trace_debug_json = false; // Tracing all debug json packets?
var last_cmd_line = '';
var last_cmd = '';
//var lol_is_enabled; // Set to true in d8.cc if LIVE_OBJECT_LIST is defined.
var lol_next_dump_index = 0;
var kDefaultLolLinesToPrintAtATime = 10;
var kMaxLolLinesToPrintAtATime = 1000;
var repeat_cmd_line = '';
var is_running = true;
// Global variable used to store whether a handle was requested.
var lookup_handle = null;

// Copied from debug-delay.js. This is needed below:
function ScriptTypeFlag(type) {
Expand All @@ -155,7 +157,7 @@ function DebugMessageDetails(message) {
}

function DebugEventDetails(response) {
details = {text:'', running:false};
var details = {text:'', running:false};

// Get the running state.
details.running = response.running();
Expand Down Expand Up @@ -588,7 +590,6 @@ DebugRequest.prototype.createLOLRequest = function(command,

// Create a JSON request for the evaluation command.
DebugRequest.prototype.makeEvaluateJSONRequest_ = function(expression) {
// Global varaible used to store whether a handle was requested.
lookup_handle = null;

if (lol_is_enabled) {
Expand Down Expand Up @@ -1948,7 +1949,7 @@ function roundNumber(num, length) {

// Convert a JSON response to text for display in a text based debugger.
function DebugResponseDetails(response) {
details = { text: '', running: false };
var details = { text: '', running: false };

try {
if (!response.success()) {
Expand Down
9 changes: 8 additions & 1 deletion deps/v8/src/debug.cc
Expand Up @@ -37,6 +37,7 @@
#include "debug.h"
#include "deoptimizer.h"
#include "execution.h"
#include "full-codegen.h"
#include "global-handles.h"
#include "ic.h"
#include "ic-inl.h"
Expand Down Expand Up @@ -1752,7 +1753,6 @@ static bool CompileFullCodeForDebugging(Handle<SharedFunctionInfo> shared,
ASSERT(new_code->has_debug_break_slots());
ASSERT(current_code->is_compiled_optimizable() ==
new_code->is_compiled_optimizable());
ASSERT(current_code->instruction_size() <= new_code->instruction_size());
}
#endif
return result;
Expand Down Expand Up @@ -1830,6 +1830,13 @@ static void RedirectActivationsToRecompiledCodeOnThread(
// break slots.
debug_break_slot_count++;
}
if (frame_code->has_self_optimization_header() &&
!new_code->has_self_optimization_header()) {
delta -= FullCodeGenerator::self_optimization_header_size();
} else {
ASSERT(frame_code->has_self_optimization_header() ==
new_code->has_self_optimization_header());
}
int debug_break_slot_bytes =
debug_break_slot_count * Assembler::kDebugBreakSlotLength;
if (FLAG_trace_deopt) {
Expand Down
15 changes: 8 additions & 7 deletions deps/v8/src/deoptimizer.cc
Expand Up @@ -451,7 +451,7 @@ Address Deoptimizer::GetDeoptimizationEntry(int id, BailoutType type) {
base = data->lazy_deoptimization_entry_code_;
}
return
static_cast<Address>(base->body()) + (id * table_entry_size_);
static_cast<Address>(base->area_start()) + (id * table_entry_size_);
}


Expand All @@ -464,14 +464,14 @@ int Deoptimizer::GetDeoptimizationId(Address addr, BailoutType type) {
base = data->lazy_deoptimization_entry_code_;
}
if (base == NULL ||
addr < base->body() ||
addr >= base->body() +
addr < base->area_start() ||
addr >= base->area_start() +
(kNumberOfEntries * table_entry_size_)) {
return kNotDeoptimizationEntry;
}
ASSERT_EQ(0,
static_cast<int>(addr - base->body()) % table_entry_size_);
return static_cast<int>(addr - base->body()) / table_entry_size_;
static_cast<int>(addr - base->area_start()) % table_entry_size_);
return static_cast<int>(addr - base->area_start()) / table_entry_size_;
}


Expand Down Expand Up @@ -1152,11 +1152,12 @@ MemoryChunk* Deoptimizer::CreateCode(BailoutType type) {
Isolate::Current()->memory_allocator()->AllocateChunk(desc.instr_size,
EXECUTABLE,
NULL);
ASSERT(chunk->area_size() >= desc.instr_size);
if (chunk == NULL) {
V8::FatalProcessOutOfMemory("Not enough memory for deoptimization table");
}
memcpy(chunk->body(), desc.buffer, desc.instr_size);
CPU::FlushICache(chunk->body(), desc.instr_size);
memcpy(chunk->area_start(), desc.buffer, desc.instr_size);
CPU::FlushICache(chunk->area_start(), desc.instr_size);
return chunk;
}

Expand Down
18 changes: 14 additions & 4 deletions deps/v8/src/elements.cc
Expand Up @@ -705,10 +705,20 @@ class NonStrictArgumentsElementsAccessor
} else {
// Object is not mapped, defer to the arguments.
FixedArray* arguments = FixedArray::cast(parameter_map->get(1));
return ElementsAccessor::ForArray(arguments)->Get(arguments,
key,
obj,
receiver);
MaybeObject* maybe_result = ElementsAccessor::ForArray(arguments)->Get(
arguments, key, obj, receiver);
Object* result;
if (!maybe_result->ToObject(&result)) return maybe_result;
// Elements of the arguments object in slow mode might be slow aliases.
if (result->IsAliasedArgumentsEntry()) {
AliasedArgumentsEntry* entry = AliasedArgumentsEntry::cast(result);
Context* context = Context::cast(parameter_map->get(0));
int context_index = entry->aliased_context_slot();
ASSERT(!context->get(context_index)->IsTheHole());
return context->get(context_index);
} else {
return result;
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions deps/v8/src/flag-definitions.h
Expand Up @@ -169,6 +169,9 @@ DEFINE_int(stress_runs, 0, "number of stress runs")
DEFINE_bool(optimize_closures, true, "optimize closures")
DEFINE_int(loop_weight, 1, "loop weight for representation inference")

DEFINE_bool(optimize_for_in, false,
"optimize functions containing for-in loops")

// Experimental profiler changes.
DEFINE_bool(experimental_profiler, false, "enable all profiler experiments")
DEFINE_bool(watch_ic_patching, false, "profiler considers IC stability")
Expand Down

0 comments on commit 2e24ded

Please sign in to comment.