Skip to content

Commit 6ed5ef5

Browse files
committed
Upgrade V8 to 3.9.24.9
1 parent c8bbd13 commit 6ed5ef5

File tree

8 files changed

+89
-9
lines changed

8 files changed

+89
-9
lines changed

deps/v8/build/common.gypi

+2-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@
314314
'cflags': [ '-I/usr/pkg/include' ],
315315
}],
316316
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
317-
'cflags': [ '-Wno-unused-parameter',
317+
'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
318318
'-Wnon-virtual-dtor', '-Woverloaded-virtual' ],
319319
}],
320320
],
@@ -361,6 +361,7 @@
361361
}], # OS=="mac"
362362
['OS=="win"', {
363363
'msvs_configuration_attributes': {
364+
'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
364365
'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
365366
'CharacterSet': '1',
366367
},

deps/v8/src/bootstrapper.cc

+12
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,12 @@ bool Genesis::CompileNative(Vector<const char> name, Handle<String> source) {
13011301
#ifdef ENABLE_DEBUGGER_SUPPORT
13021302
isolate->debugger()->set_compiling_natives(true);
13031303
#endif
1304+
// During genesis, the boilerplate for stack overflow won't work until the
1305+
// environment has been at least partially initialized. Add a stack check
1306+
// before entering JS code to catch overflow early.
1307+
StackLimitCheck check(Isolate::Current());
1308+
if (check.HasOverflowed()) return false;
1309+
13041310
bool result = CompileScriptCached(name,
13051311
source,
13061312
NULL,
@@ -2289,6 +2295,12 @@ Genesis::Genesis(Isolate* isolate,
22892295
HandleScope scope;
22902296
SaveContext saved_context(isolate);
22912297

2298+
// During genesis, the boilerplate for stack overflow won't work until the
2299+
// environment has been at least partially initialized. Add a stack check
2300+
// before entering JS code to catch overflow early.
2301+
StackLimitCheck check(Isolate::Current());
2302+
if (check.HasOverflowed()) return;
2303+
22922304
Handle<Context> new_context = Snapshot::NewContextFromSnapshot();
22932305
if (!new_context.is_null()) {
22942306
global_context_ =

deps/v8/src/debug.cc

+16-6
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:
@@ -767,15 +767,22 @@ bool Debug::CompileDebuggerScript(int index) {
767767
Handle<JSFunction> function =
768768
factory->NewFunctionFromSharedFunctionInfo(function_info, context);
769769

770-
Execution::TryCall(function, Handle<Object>(context->global()),
771-
0, NULL, &caught_exception);
770+
Handle<Object> exception =
771+
Execution::TryCall(function, Handle<Object>(context->global()),
772+
0, NULL, &caught_exception);
772773

773774
// Check for caught exceptions.
774775
if (caught_exception) {
776+
ASSERT(!isolate->has_pending_exception());
777+
MessageLocation computed_location;
778+
isolate->ComputeLocation(&computed_location);
775779
Handle<Object> message = MessageHandler::MakeMessageObject(
776-
"error_loading_debugger", NULL, Vector<Handle<Object> >::empty(),
777-
Handle<String>(), Handle<JSArray>());
780+
"error_loading_debugger", &computed_location,
781+
Vector<Handle<Object> >::empty(), Handle<String>(), Handle<JSArray>());
782+
ASSERT(!isolate->has_pending_exception());
783+
isolate->set_pending_exception(*exception);
778784
MessageHandler::ReportMessage(Isolate::Current(), NULL, message);
785+
isolate->clear_pending_exception();
779786
return false;
780787
}
781788

@@ -813,6 +820,9 @@ bool Debug::Load() {
813820
v8::Handle<ObjectTemplate>(),
814821
NULL);
815822

823+
// Fail if no context could be created.
824+
if (context.is_null()) return false;
825+
816826
// Use the debugger context.
817827
SaveContext save(isolate_);
818828
isolate_->set_context(*context);
@@ -3239,7 +3249,7 @@ EnterDebugger::~EnterDebugger() {
32393249
debug->SetBreak(break_frame_id_, break_id_);
32403250

32413251
// Check for leaving the debugger.
3242-
if (prev_ == NULL) {
3252+
if (!load_failed_ && prev_ == NULL) {
32433253
// Clear mirror cache when leaving the debugger. Skip this if there is a
32443254
// pending exception as clearing the mirror cache calls back into
32453255
// JavaScript. This can happen if the v8::Debug::Call is used in which

deps/v8/src/execution.cc

+10
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,11 @@ Object* Execution::DebugBreakHelper() {
826826
return isolate->heap()->undefined_value();
827827
}
828828

829+
StackLimitCheck check(isolate);
830+
if (check.HasOverflowed()) {
831+
return isolate->heap()->undefined_value();
832+
}
833+
829834
{
830835
JavaScriptFrameIterator it(isolate);
831836
ASSERT(!it.done());
@@ -862,6 +867,11 @@ void Execution::ProcessDebugMessages(bool debug_command_only) {
862867
// Clear the debug command request flag.
863868
isolate->stack_guard()->Continue(DEBUGCOMMAND);
864869

870+
StackLimitCheck check(isolate);
871+
if (check.HasOverflowed()) {
872+
return;
873+
}
874+
865875
HandleScope scope(isolate);
866876
// Enter the debugger. Just continue if we fail to enter the debugger.
867877
EnterDebugger debugger;

deps/v8/src/flag-definitions.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,9 @@ DEFINE_bool(enable_liveedit, true, "enable liveedit experimental feature")
310310
DEFINE_bool(break_on_abort, true, "always cause a debug break before aborting")
311311

312312
// execution.cc
313-
DEFINE_int(stack_size, kPointerSize * 128,
313+
// Slightly less than 1MB on 64-bit, since Windows' default stack size for
314+
// the main execution thread is 1MB for both 32 and 64-bit.
315+
DEFINE_int(stack_size, kPointerSize * 123,
314316
"default size of stack region v8 is allowed to use (in kBytes)")
315317

316318
// frames.cc

deps/v8/src/hydrogen.cc

+8
Original file line numberDiff line numberDiff line change
@@ -2454,6 +2454,10 @@ HGraph* HGraphBuilder::CreateGraph() {
24542454
Bailout("function with illegal redeclaration");
24552455
return NULL;
24562456
}
2457+
if (scope->calls_eval()) {
2458+
Bailout("function calls eval");
2459+
return NULL;
2460+
}
24572461
SetUpScope(scope);
24582462

24592463
// Add an edge to the body entry. This is warty: the graph's start
@@ -5865,6 +5869,10 @@ void HGraphBuilder::VisitCall(Call* expr) {
58655869
VariableProxy* proxy = expr->expression()->AsVariableProxy();
58665870
bool global_call = proxy != NULL && proxy->var()->IsUnallocated();
58675871

5872+
if (proxy != NULL && proxy->var()->is_possibly_eval()) {
5873+
return Bailout("possible direct call to eval");
5874+
}
5875+
58685876
if (global_call) {
58695877
Variable* var = proxy->var();
58705878
bool known_global_function = false;

deps/v8/src/version.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#define MAJOR_VERSION 3
3636
#define MINOR_VERSION 9
3737
#define BUILD_NUMBER 24
38-
#define PATCH_LEVEL 7
38+
#define PATCH_LEVEL 9
3939
// Use 1 for candidates and 0 otherwise.
4040
// (Boolean macro values are not supported by all preprocessors.)
4141
#define IS_CANDIDATE_VERSION 0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright 2012 the V8 project authors. All rights reserved.
2+
// Redistribution and use in source and binary forms, with or without
3+
// modification, are permitted provided that the following conditions are
4+
// met:
5+
//
6+
// * Redistributions of source code must retain the above copyright
7+
// notice, this list of conditions and the following disclaimer.
8+
// * Redistributions in binary form must reproduce the above
9+
// copyright notice, this list of conditions and the following
10+
// disclaimer in the documentation and/or other materials provided
11+
// with the distribution.
12+
// * Neither the name of Google Inc. nor the names of its
13+
// contributors may be used to endorse or promote products derived
14+
// from this software without specific prior written permission.
15+
//
16+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
28+
// Flags: --allow-natives-syntax
29+
30+
var d = 0;
31+
function recurse() {
32+
if (++d == 25135) { // A magic number just below stack overflow on ia32
33+
%DebugBreak();
34+
}
35+
recurse();
36+
}
37+
assertThrows(function() { recurse();} );

0 commit comments

Comments
 (0)