Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2e24ded

Browse files
committed
Upgrade v8 to 3.9.11
1 parent fde2600 commit 2e24ded

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+6248
-824
lines changed

deps/v8/ChangeLog

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
2012-02-27: Version 3.9.11
2+
3+
Make 'module' a context-sensitive keyword (V8 issue 1957).
4+
5+
6+
2012-02-24: Version 3.9.10
7+
8+
Fixed V8 issues 1322, 1772 and 1969.
9+
10+
Conformance improvements.
11+
12+
Performance and stability improvements on all platforms.
13+
14+
115
2012-02-23: Version 3.9.9
216

317
Supported fast case for-in in Crankshaft.

deps/v8/build/common.gypi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
'v8_use_snapshot%': 'true',
8484
'host_os%': '<(OS)',
8585
'v8_use_liveobjectlist%': 'false',
86+
'werror%': '-Werror',
8687

8788
# With post mortem support enabled, metadata is embedded into libv8 that
8889
# describes various parameters of the VM for use by debuggers. See
@@ -304,7 +305,7 @@
304305
'cflags': [ '-I/usr/pkg/include' ],
305306
}],
306307
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
307-
'cflags': [ '<(werror)', '-W', '-Wno-unused-parameter',
308+
'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
308309
'-Wnon-virtual-dtor', '-Woverloaded-virtual' ],
309310
}],
310311
],
@@ -351,6 +352,7 @@
351352
}], # OS=="mac"
352353
['OS=="win"', {
353354
'msvs_configuration_attributes': {
355+
'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
354356
'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
355357
'CharacterSet': '1',
356358
},

deps/v8/build/standalone.gypi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
'host_arch%': '<(host_arch)',
6262
'target_arch%': '<(target_arch)',
6363
'v8_target_arch%': '<(v8_target_arch)',
64+
'werror%': '-Werror',
6465
'conditions': [
6566
['(v8_target_arch=="arm" and host_arch!="arm") or \
6667
(v8_target_arch=="mips" and host_arch!="mips") or \
@@ -83,7 +84,7 @@
8384
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
8485
or OS=="netbsd"', {
8586
'target_defaults': {
86-
'cflags': [ '-W', '-Wno-unused-parameter',
87+
'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
8788
'-Wnon-virtual-dtor', '-pthread', '-fno-rtti',
8889
'-fno-exceptions', '-pedantic' ],
8990
'ldflags': [ '-pthread', ],

deps/v8/include/v8.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3850,7 +3850,7 @@ class Internals {
38503850
static const int kFullStringRepresentationMask = 0x07;
38513851
static const int kExternalTwoByteRepresentationTag = 0x02;
38523852

3853-
static const int kJSObjectType = 0xa8;
3853+
static const int kJSObjectType = 0xa9;
38543854
static const int kFirstNonstringType = 0x80;
38553855
static const int kForeignType = 0x85;
38563856

deps/v8/src/SConscript

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2011 the V8 project authors. All rights reserved.
1+
# Copyright 2012 the V8 project authors. All rights reserved.
22
# Redistribution and use in source and binary forms, with or without
33
# modification, are permitted provided that the following conditions are
44
# met:
@@ -78,7 +78,6 @@ SOURCES = {
7878
fast-dtoa.cc
7979
fixed-dtoa.cc
8080
handles.cc
81-
hashmap.cc
8281
heap-profiler.cc
8382
heap.cc
8483
hydrogen.cc
@@ -246,7 +245,6 @@ PREPARSER_SOURCES = {
246245
dtoa.cc
247246
fast-dtoa.cc
248247
fixed-dtoa.cc
249-
hashmap.cc
250248
preparse-data.cc
251249
preparser.cc
252250
preparser-api.cc

deps/v8/src/api.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2760,6 +2760,7 @@ bool v8::Object::Set(uint32_t index, v8::Handle<Value> value) {
27602760
self,
27612761
index,
27622762
value_obj,
2763+
NONE,
27632764
i::kNonStrictMode);
27642765
has_pending_exception = obj.is_null();
27652766
EXCEPTION_BAILOUT_CHECK(isolate, false);

deps/v8/src/arm/full-codegen-arm.cc

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ class JumpPatchSite BASE_EMBEDDED {
109109
};
110110

111111

112+
int FullCodeGenerator::self_optimization_header_size() {
113+
return 24;
114+
}
115+
116+
112117
// Generate code for a JS function. On entry to the function the receiver
113118
// and arguments have been pushed on the stack left to right. The actual
114119
// argument count matches the formal parameter count expected by the
@@ -130,20 +135,14 @@ void FullCodeGenerator::Generate() {
130135
SetFunctionPosition(function());
131136
Comment cmnt(masm_, "[ function compiled by full code generator");
132137

133-
#ifdef DEBUG
134-
if (strlen(FLAG_stop_at) > 0 &&
135-
info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
136-
__ stop("stop-at");
137-
}
138-
#endif
139-
140138
// We can optionally optimize based on counters rather than statistical
141139
// sampling.
142140
if (info->ShouldSelfOptimize()) {
143141
if (FLAG_trace_opt_verbose) {
144142
PrintF("[adding self-optimization header to %s]\n",
145143
*info->function()->debug_name()->ToCString());
146144
}
145+
has_self_optimization_header_ = true;
147146
MaybeObject* maybe_cell = isolate()->heap()->AllocateJSGlobalPropertyCell(
148147
Smi::FromInt(Compiler::kCallsUntilPrimitiveOpt));
149148
JSGlobalPropertyCell* cell;
@@ -155,9 +154,17 @@ void FullCodeGenerator::Generate() {
155154
Handle<Code> compile_stub(
156155
isolate()->builtins()->builtin(Builtins::kLazyRecompile));
157156
__ Jump(compile_stub, RelocInfo::CODE_TARGET, eq);
157+
ASSERT(masm_->pc_offset() == self_optimization_header_size());
158158
}
159159
}
160160

161+
#ifdef DEBUG
162+
if (strlen(FLAG_stop_at) > 0 &&
163+
info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
164+
__ stop("stop-at");
165+
}
166+
#endif
167+
161168
// Strict mode functions and builtins need to replace the receiver
162169
// with undefined when called as functions (without an explicit
163170
// receiver object). r5 is zero for method calls and non-zero for

deps/v8/src/ast.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ bool IsEqualNumber(void* first, void* second) {
237237

238238

239239
void ObjectLiteral::CalculateEmitStore() {
240-
HashMap properties(&IsEqualString);
241-
HashMap elements(&IsEqualNumber);
240+
ZoneHashMap properties(&IsEqualString);
241+
ZoneHashMap elements(&IsEqualNumber);
242242
for (int i = this->properties()->length() - 1; i >= 0; i--) {
243243
ObjectLiteral::Property* property = this->properties()->at(i);
244244
Literal* literal = property->key();
@@ -249,7 +249,7 @@ void ObjectLiteral::CalculateEmitStore() {
249249
}
250250

251251
uint32_t hash;
252-
HashMap* table;
252+
ZoneHashMap* table;
253253
void* key;
254254
Factory* factory = Isolate::Current()->factory();
255255
if (handle->IsSymbol()) {

deps/v8/src/bootstrapper.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,12 @@ class Genesis BASE_EMBEDDED {
214214
};
215215

216216
class ExtensionStates {
217-
public:
217+
public:
218218
ExtensionStates();
219219
ExtensionTraversalState get_state(RegisteredExtension* extension);
220220
void set_state(RegisteredExtension* extension,
221221
ExtensionTraversalState state);
222-
private:
223-
Allocator allocator_;
222+
private:
224223
HashMap map_;
225224
DISALLOW_COPY_AND_ASSIGN(ExtensionStates);
226225
};
@@ -1961,9 +1960,7 @@ static bool MatchRegisteredExtensions(void* key1, void* key2) {
19611960
}
19621961

19631962
Genesis::ExtensionStates::ExtensionStates()
1964-
: allocator_(),
1965-
map_(MatchRegisteredExtensions, &allocator_, 8)
1966-
{}
1963+
: map_(MatchRegisteredExtensions, 8) { }
19671964

19681965
Genesis::ExtensionTraversalState Genesis::ExtensionStates::get_state(
19691966
RegisteredExtension* extension) {

deps/v8/src/compilation-cache.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2011 the V8 project authors. All rights reserved.
1+
// Copyright 2012 the V8 project authors. All rights reserved.
22
// Redistribution and use in source and binary forms, with or without
33
// modification, are permitted provided that the following conditions are
44
// met:
@@ -31,8 +31,6 @@
3131
namespace v8 {
3232
namespace internal {
3333

34-
class HashMap;
35-
3634
// The compilation cache consists of several generational sub-caches which uses
3735
// this class as a base class. A sub-cache contains a compilation cache tables
3836
// for each generation of the sub-cache. Since the same source code string has

deps/v8/src/compiler.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ bool CompilationInfo::ShouldSelfOptimize() {
118118
FLAG_crankshaft &&
119119
!Serializer::enabled() &&
120120
!function()->flags()->Contains(kDontSelfOptimize) &&
121+
!function()->flags()->Contains(kDontOptimize) &&
121122
(shared_info().is_null() || !shared_info()->optimization_disabled());
122123
}
123124

deps/v8/src/cpu-profiler.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2010 the V8 project authors. All rights reserved.
1+
// Copyright 2012 the V8 project authors. All rights reserved.
22
// Redistribution and use in source and binary forms, with or without
33
// modification, are permitted provided that the following conditions are
44
// met:
@@ -41,7 +41,6 @@ class CodeEntry;
4141
class CodeMap;
4242
class CpuProfile;
4343
class CpuProfilesCollection;
44-
class HashMap;
4544
class ProfileGenerator;
4645
class TokenEnumerator;
4746

deps/v8/src/d8.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,15 @@ Debug.State = {
122122
};
123123
var trace_compile = false; // Tracing all compile events?
124124
var trace_debug_json = false; // Tracing all debug json packets?
125-
var last_cmd_line = '';
125+
var last_cmd = '';
126126
//var lol_is_enabled; // Set to true in d8.cc if LIVE_OBJECT_LIST is defined.
127127
var lol_next_dump_index = 0;
128128
var kDefaultLolLinesToPrintAtATime = 10;
129129
var kMaxLolLinesToPrintAtATime = 1000;
130130
var repeat_cmd_line = '';
131131
var is_running = true;
132+
// Global variable used to store whether a handle was requested.
133+
var lookup_handle = null;
132134

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

157159
function DebugEventDetails(response) {
158-
details = {text:'', running:false};
160+
var details = {text:'', running:false};
159161

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

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

594595
if (lol_is_enabled) {
@@ -1948,7 +1949,7 @@ function roundNumber(num, length) {
19481949

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

19531954
try {
19541955
if (!response.success()) {

deps/v8/src/debug.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "debug.h"
3838
#include "deoptimizer.h"
3939
#include "execution.h"
40+
#include "full-codegen.h"
4041
#include "global-handles.h"
4142
#include "ic.h"
4243
#include "ic-inl.h"
@@ -1752,7 +1753,6 @@ static bool CompileFullCodeForDebugging(Handle<SharedFunctionInfo> shared,
17521753
ASSERT(new_code->has_debug_break_slots());
17531754
ASSERT(current_code->is_compiled_optimizable() ==
17541755
new_code->is_compiled_optimizable());
1755-
ASSERT(current_code->instruction_size() <= new_code->instruction_size());
17561756
}
17571757
#endif
17581758
return result;
@@ -1830,6 +1830,13 @@ static void RedirectActivationsToRecompiledCodeOnThread(
18301830
// break slots.
18311831
debug_break_slot_count++;
18321832
}
1833+
if (frame_code->has_self_optimization_header() &&
1834+
!new_code->has_self_optimization_header()) {
1835+
delta -= FullCodeGenerator::self_optimization_header_size();
1836+
} else {
1837+
ASSERT(frame_code->has_self_optimization_header() ==
1838+
new_code->has_self_optimization_header());
1839+
}
18331840
int debug_break_slot_bytes =
18341841
debug_break_slot_count * Assembler::kDebugBreakSlotLength;
18351842
if (FLAG_trace_deopt) {

deps/v8/src/deoptimizer.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ Address Deoptimizer::GetDeoptimizationEntry(int id, BailoutType type) {
451451
base = data->lazy_deoptimization_entry_code_;
452452
}
453453
return
454-
static_cast<Address>(base->body()) + (id * table_entry_size_);
454+
static_cast<Address>(base->area_start()) + (id * table_entry_size_);
455455
}
456456

457457

@@ -464,14 +464,14 @@ int Deoptimizer::GetDeoptimizationId(Address addr, BailoutType type) {
464464
base = data->lazy_deoptimization_entry_code_;
465465
}
466466
if (base == NULL ||
467-
addr < base->body() ||
468-
addr >= base->body() +
467+
addr < base->area_start() ||
468+
addr >= base->area_start() +
469469
(kNumberOfEntries * table_entry_size_)) {
470470
return kNotDeoptimizationEntry;
471471
}
472472
ASSERT_EQ(0,
473-
static_cast<int>(addr - base->body()) % table_entry_size_);
474-
return static_cast<int>(addr - base->body()) / table_entry_size_;
473+
static_cast<int>(addr - base->area_start()) % table_entry_size_);
474+
return static_cast<int>(addr - base->area_start()) / table_entry_size_;
475475
}
476476

477477

@@ -1152,11 +1152,12 @@ MemoryChunk* Deoptimizer::CreateCode(BailoutType type) {
11521152
Isolate::Current()->memory_allocator()->AllocateChunk(desc.instr_size,
11531153
EXECUTABLE,
11541154
NULL);
1155+
ASSERT(chunk->area_size() >= desc.instr_size);
11551156
if (chunk == NULL) {
11561157
V8::FatalProcessOutOfMemory("Not enough memory for deoptimization table");
11571158
}
1158-
memcpy(chunk->body(), desc.buffer, desc.instr_size);
1159-
CPU::FlushICache(chunk->body(), desc.instr_size);
1159+
memcpy(chunk->area_start(), desc.buffer, desc.instr_size);
1160+
CPU::FlushICache(chunk->area_start(), desc.instr_size);
11601161
return chunk;
11611162
}
11621163

deps/v8/src/elements.cc

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -705,10 +705,20 @@ class NonStrictArgumentsElementsAccessor
705705
} else {
706706
// Object is not mapped, defer to the arguments.
707707
FixedArray* arguments = FixedArray::cast(parameter_map->get(1));
708-
return ElementsAccessor::ForArray(arguments)->Get(arguments,
709-
key,
710-
obj,
711-
receiver);
708+
MaybeObject* maybe_result = ElementsAccessor::ForArray(arguments)->Get(
709+
arguments, key, obj, receiver);
710+
Object* result;
711+
if (!maybe_result->ToObject(&result)) return maybe_result;
712+
// Elements of the arguments object in slow mode might be slow aliases.
713+
if (result->IsAliasedArgumentsEntry()) {
714+
AliasedArgumentsEntry* entry = AliasedArgumentsEntry::cast(result);
715+
Context* context = Context::cast(parameter_map->get(0));
716+
int context_index = entry->aliased_context_slot();
717+
ASSERT(!context->get(context_index)->IsTheHole());
718+
return context->get(context_index);
719+
} else {
720+
return result;
721+
}
712722
}
713723
}
714724

deps/v8/src/flag-definitions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ DEFINE_int(stress_runs, 0, "number of stress runs")
169169
DEFINE_bool(optimize_closures, true, "optimize closures")
170170
DEFINE_int(loop_weight, 1, "loop weight for representation inference")
171171

172+
DEFINE_bool(optimize_for_in, false,
173+
"optimize functions containing for-in loops")
174+
172175
// Experimental profiler changes.
173176
DEFINE_bool(experimental_profiler, false, "enable all profiler experiments")
174177
DEFINE_bool(watch_ic_patching, false, "profiler considers IC stability")

0 commit comments

Comments
 (0)