Skip to content

Commit b8f006e

Browse files
committed
Upgrade V8 to 3.0.9
1 parent e6e6e87 commit b8f006e

75 files changed

Lines changed: 4604 additions & 2076 deletions

Some content is hidden

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

deps/v8/ChangeLog

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
2011-01-19: Version 3.0.9
2+
3+
Added basic GDB JIT Interface integration.
4+
5+
Make invalid break/continue statements a syntax error instead of a
6+
runtime error.
7+
8+
19
2011-01-17: Version 3.0.8
210

311
Exposed heap size limit to the heap statistics gathered by
4-
the GetHeapStatistics API.
12+
the GetHeapStatistics API.
513

614
Wrapped external pointers more carefully (issue 1037).
715

deps/v8/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ are:
2424
These libraries have their own licenses; we recommend you read them,
2525
as their terms may differ from the terms below.
2626

27-
Copyright 2006-2009, Google Inc. All rights reserved.
27+
Copyright 2006-2011, the V8 project authors. All rights reserved.
2828
Redistribution and use in source and binary forms, with or without
2929
modification, are permitted provided that the following conditions are
3030
met:

deps/v8/SConstruct

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,15 @@ LIBRARY_FLAGS = {
124124
},
125125
'debuggersupport:on': {
126126
'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT'],
127+
},
128+
'inspector:on': {
129+
'CPPDEFINES': ['INSPECTOR'],
127130
}
128131
},
129132
'gcc': {
130133
'all': {
131134
'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
132-
'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions', '-fno-builtin-memcpy'],
135+
'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'],
133136
},
134137
'visibility:hidden': {
135138
# Use visibility=default to disable this.
@@ -229,6 +232,9 @@ LIBRARY_FLAGS = {
229232
},
230233
'prof:oprofile': {
231234
'CPPDEFINES': ['ENABLE_OPROFILE_AGENT']
235+
},
236+
'gdbjit:on': {
237+
'CPPDEFINES': ['ENABLE_GDB_JIT_INTERFACE']
232238
}
233239
},
234240
'msvc': {
@@ -705,6 +711,11 @@ SIMPLE_OPTIONS = {
705711
'default': 'off',
706712
'help': 'enable profiling of build target'
707713
},
714+
'gdbjit': {
715+
'values': ['on', 'off'],
716+
'default': 'off',
717+
'help': 'enable GDB JIT interface'
718+
},
708719
'library': {
709720
'values': ['static', 'shared'],
710721
'default': 'static',
@@ -735,6 +746,11 @@ SIMPLE_OPTIONS = {
735746
'default': 'on',
736747
'help': 'enable debugging of JavaScript code'
737748
},
749+
'inspector': {
750+
'values': ['on', 'off'],
751+
'default': 'off',
752+
'help': 'enable inspector features'
753+
},
738754
'soname': {
739755
'values': ['on', 'off'],
740756
'default': 'off',
@@ -871,6 +887,8 @@ def VerifyOptions(env):
871887
return False
872888
if env['os'] == 'win32' and env['library'] == 'shared' and env['prof'] == 'on':
873889
Abort("Profiling on windows only supported for static library.")
890+
if env['gdbjit'] == 'on' and (env['os'] != 'linux' or (env['arch'] != 'ia32' and env['arch'] != 'x64')):
891+
Abort("GDBJIT interface is supported only for Intel-compatible (ia32 or x64) Linux target.")
874892
if env['prof'] == 'oprofile' and env['os'] != 'linux':
875893
Abort("OProfile is only supported on Linux.")
876894
if env['os'] == 'win32' and env['soname'] == 'on':

deps/v8/src/SConscript

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ SOURCES = {
7171
frames.cc
7272
full-codegen.cc
7373
func-name-inferrer.cc
74+
gdb-jit.cc
7475
global-handles.cc
7576
fast-dtoa.cc
7677
fixed-dtoa.cc
@@ -81,6 +82,7 @@ SOURCES = {
8182
hydrogen.cc
8283
hydrogen-instructions.cc
8384
ic.cc
85+
inspector.cc
8486
interpreter-irregexp.cc
8587
jsregexp.cc
8688
jump-target.cc
@@ -190,6 +192,7 @@ SOURCES = {
190192
ia32/ic-ia32.cc
191193
ia32/jump-target-ia32.cc
192194
ia32/lithium-codegen-ia32.cc
195+
ia32/lithium-gap-resolver-ia32.cc
193196
ia32/lithium-ia32.cc
194197
ia32/macro-assembler-ia32.cc
195198
ia32/regexp-macro-assembler-ia32.cc

deps/v8/src/arm/assembler-arm.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,13 +2495,21 @@ void Assembler::GrowBuffer() {
24952495

24962496

24972497
void Assembler::db(uint8_t data) {
2498+
// No relocation info should be pending while using db. db is used
2499+
// to write pure data with no pointers and the constant pool should
2500+
// be emitted before using db.
2501+
ASSERT(num_prinfo_ == 0);
24982502
CheckBuffer();
24992503
*reinterpret_cast<uint8_t*>(pc_) = data;
25002504
pc_ += sizeof(uint8_t);
25012505
}
25022506

25032507

25042508
void Assembler::dd(uint32_t data) {
2509+
// No relocation info should be pending while using dd. dd is used
2510+
// to write pure data with no pointers and the constant pool should
2511+
// be emitted before using dd.
2512+
ASSERT(num_prinfo_ == 0);
25052513
CheckBuffer();
25062514
*reinterpret_cast<uint32_t*>(pc_) = data;
25072515
pc_ += sizeof(uint32_t);

deps/v8/src/arm/assembler-arm.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,8 +1240,10 @@ class Assembler : public Malloced {
12401240
// Use --code-comments to enable.
12411241
void RecordComment(const char* msg);
12421242

1243-
// Writes a single byte or word of data in the code stream. Used for
1244-
// inline tables, e.g., jump-tables.
1243+
// Writes a single byte or word of data in the code stream. Used
1244+
// for inline tables, e.g., jump-tables. The constant pool should be
1245+
// emitted before any use of db and dd to ensure that constant pools
1246+
// are not emitted as part of the tables generated.
12451247
void db(uint8_t data);
12461248
void dd(uint32_t data);
12471249

deps/v8/src/arm/ic-arm.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,12 @@ static void GenerateMonomorphicCacheProbe(MacroAssembler* masm,
542542
Label number, non_number, non_string, boolean, probe, miss;
543543

544544
// Probe the stub cache.
545-
Code::Flags flags =
546-
Code::ComputeFlags(kind, NOT_IN_LOOP, MONOMORPHIC, NORMAL, argc);
545+
Code::Flags flags = Code::ComputeFlags(kind,
546+
NOT_IN_LOOP,
547+
MONOMORPHIC,
548+
Code::kNoExtraICState,
549+
NORMAL,
550+
argc);
547551
StubCache::GenerateProbe(masm, flags, r1, r2, r3, r4, r5);
548552

549553
// If the stub cache probing failed, the receiver might be a value.

deps/v8/src/arm/lithium-arm.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,13 @@ LOperand* LChunkBuilder::UseRegisterOrConstantAtStart(HValue* value) {
576576
}
577577

578578

579+
LOperand* LChunkBuilder::UseAny(HValue* value) {
580+
return value->IsConstant()
581+
? chunk_->DefineConstantOperand(HConstant::cast(value))
582+
: Use(value, new LUnallocated(LUnallocated::ANY));
583+
}
584+
585+
579586
LOperand* LChunkBuilder::Use(HValue* value, LUnallocated* operand) {
580587
if (value->EmitAtUses()) {
581588
HInstruction* instr = HInstruction::cast(value);
@@ -907,11 +914,7 @@ LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) {
907914
} else if (value->IsPushArgument()) {
908915
op = new LArgument(argument_index++);
909916
} else {
910-
op = UseOrConstant(value);
911-
if (op->IsUnallocated()) {
912-
LUnallocated* unalloc = LUnallocated::cast(op);
913-
unalloc->set_policy(LUnallocated::ANY);
914-
}
917+
op = UseAny(value);
915918
}
916919
result->AddValue(op, value->representation());
917920
}

deps/v8/src/arm/lithium-arm.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1887,15 +1887,25 @@ class LChunkBuilder BASE_EMBEDDED {
18871887
LOperand* UseRegister(HValue* value);
18881888
LOperand* UseRegisterAtStart(HValue* value);
18891889

1890-
// A value in a register that may be trashed.
1890+
// An input operand in a register that may be trashed.
18911891
LOperand* UseTempRegister(HValue* value);
1892+
1893+
// An input operand in a register or stack slot.
18921894
LOperand* Use(HValue* value);
18931895
LOperand* UseAtStart(HValue* value);
1896+
1897+
// An input operand in a register, stack slot or a constant operand.
18941898
LOperand* UseOrConstant(HValue* value);
18951899
LOperand* UseOrConstantAtStart(HValue* value);
1900+
1901+
// An input operand in a register or a constant operand.
18961902
LOperand* UseRegisterOrConstant(HValue* value);
18971903
LOperand* UseRegisterOrConstantAtStart(HValue* value);
18981904

1905+
// An input operand in register, stack slot or a constant operand.
1906+
// Will not be moved to a register even if one is freely available.
1907+
LOperand* UseAny(HValue* value);
1908+
18991909
// Methods for setting up define-use relationships.
19001910
// Return the same instruction that they are passed.
19011911
LInstruction* Define(LInstruction* instr, LUnallocated* result);

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

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,13 @@ bool LGapResolver::CanReach(LGapNode* a, LGapNode* b) {
172172

173173

174174
void LGapResolver::RegisterMove(LMoveOperands move) {
175-
if (move.from()->IsConstantOperand()) {
175+
if (move.source()->IsConstantOperand()) {
176176
// Constant moves should be last in the machine code. Therefore add them
177177
// first to the result set.
178-
AddResultMove(move.from(), move.to());
178+
AddResultMove(move.source(), move.destination());
179179
} else {
180-
LGapNode* from = LookupNode(move.from());
181-
LGapNode* to = LookupNode(move.to());
180+
LGapNode* from = LookupNode(move.source());
181+
LGapNode* to = LookupNode(move.destination());
182182
if (to->IsAssigned() && to->assigned_from() == from) {
183183
move.Eliminate();
184184
return;
@@ -341,6 +341,11 @@ bool LCodeGen::GenerateDeferredCode() {
341341
__ jmp(code->exit());
342342
}
343343

344+
// Force constant pool emission at the end of deferred code to make
345+
// sure that no constant pools are emitted after the official end of
346+
// the instruction sequence.
347+
masm()->CheckConstPool(true, false);
348+
344349
// Deferred code is the last part of the instruction sequence. Mark
345350
// the generated code as done unless we bailed out.
346351
if (!is_aborted()) status_ = DONE;
@@ -816,8 +821,8 @@ void LCodeGen::DoParallelMove(LParallelMove* move) {
816821
resolver_.Resolve(move->move_operands(), &marker_operand);
817822
for (int i = moves->length() - 1; i >= 0; --i) {
818823
LMoveOperands move = moves->at(i);
819-
LOperand* from = move.from();
820-
LOperand* to = move.to();
824+
LOperand* from = move.source();
825+
LOperand* to = move.destination();
821826
ASSERT(!from->IsDoubleRegister() ||
822827
!ToDoubleRegister(from).is(dbl_scratch));
823828
ASSERT(!to->IsDoubleRegister() || !ToDoubleRegister(to).is(dbl_scratch));
@@ -999,7 +1004,6 @@ void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) {
9991004

10001005

10011006
void LCodeGen::DoModI(LModI* instr) {
1002-
Abort("ModI not implemented");
10031007
class DeferredModI: public LDeferredCode {
10041008
public:
10051009
DeferredModI(LCodeGen* codegen, LModI* instr)
@@ -1055,7 +1059,6 @@ void LCodeGen::DoModI(LModI* instr) {
10551059

10561060

10571061
void LCodeGen::DoDivI(LDivI* instr) {
1058-
Abort("DivI not implemented");
10591062
class DeferredDivI: public LDeferredCode {
10601063
public:
10611064
DeferredDivI(LCodeGen* codegen, LDivI* instr)
@@ -1293,7 +1296,10 @@ void LCodeGen::DoConstantI(LConstantI* instr) {
12931296

12941297

12951298
void LCodeGen::DoConstantD(LConstantD* instr) {
1296-
Abort("DoConstantD unimplemented.");
1299+
ASSERT(instr->result()->IsDoubleRegister());
1300+
DwVfpRegister result = ToDoubleRegister(instr->result());
1301+
double v = instr->value();
1302+
__ vmov(result, v);
12971303
}
12981304

12991305

@@ -2336,6 +2342,15 @@ void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) {
23362342

23372343
// Move the result back to general purpose register r0.
23382344
__ vmov(result, single_scratch);
2345+
2346+
// Test for -0.
2347+
Label done;
2348+
__ cmp(result, Operand(0));
2349+
__ b(ne, &done);
2350+
__ vmov(scratch, input.high());
2351+
__ tst(scratch, Operand(HeapNumber::kSignMask));
2352+
DeoptimizeIf(ne, instr->environment());
2353+
__ bind(&done);
23392354
}
23402355

23412356

0 commit comments

Comments
 (0)