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

deps: v8 to 3.29.91 #8134

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ node_g
/.project
/.cproject

# jetbrains project files
.idea/

/out

# various stuff that VC++ produces/uses
Expand Down Expand Up @@ -53,11 +56,9 @@ deps/openssl/openssl.props
deps/openssl/openssl.targets
deps/openssl/openssl.xml

# generated by gyp on android
/*.target.mk
/*.host.mk
deps/openssl/openssl.target.mk
deps/zlib/zlib.target.mk
# generated by gyp on linux and such
*.target.mk
*.host.mk

# build/release artifacts
/*.tar.gz
Expand Down
26 changes: 15 additions & 11 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,18 @@
# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,

# Enable V8's post-mortem debugging only on unix flavors.
'conditions': [
['OS == "win"', {
'os_posix': 0,
'v8_postmortem_support': 'false'
}, {
'os_posix': 1,
'v8_postmortem_support': 'true'
}],
['GENERATOR == "ninja" or OS== "mac"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.<(target_arch).a',
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
}, {
'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.<(target_arch).a',
'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a',
}],
],
},
Expand Down Expand Up @@ -99,9 +96,6 @@
'EnableIntrinsicFunctions': 'true',
'RuntimeTypeInfo': 'false',
'ExceptionHandling': '0',
'AdditionalOptions': [
'/MP', # compile across multiple CPUs
],
},
'VCLibrarianTool': {
'AdditionalOptions': [
Expand Down Expand Up @@ -130,8 +124,13 @@
'ExceptionHandling': 1, # /EHsc
'SuppressStartupBanner': 'true',
'WarnAsError': 'false',
'MultiProcessorCompilation': 'true',
},
# 4221 - linker warning about object not exporting new symbols
'VCLibrarianTool': {
'AdditionalOptions': [
'/ignore:4221', # link time code generation
],
},
'VCLinkerTool': {
'conditions': [
Expand All @@ -151,7 +150,11 @@
],
},
},
'msvs_disabled_warnings': [4351, 4355, 4800],
# 4267 - when passing an int64 as int, and truncation might happen (depends on linkage)
# 4244 - when passing an int64 as int, and truncation will happen
# 4530 - No exception semantics (leaking from MS STL xlocale)
# 4996 - winsock ip4 calls deprecated
'msvs_disabled_warnings': [4351, 4355, 4800, 4267, 4244, 4530, 4996],
'conditions': [
['OS == "win"', {
'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
Expand All @@ -172,8 +175,9 @@
'ldflags': [ '-pthread' ],
}],
[ 'OS in "linux freebsd openbsd solaris android"', {
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
# flags reconciled with v8/build/standalone.gypi
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', '-fno-exceptions' ],
'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
'ldflags': [ '-rdynamic' ],
'target_conditions': [
['_type=="static_library"', {
Expand Down
16 changes: 14 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,11 @@ parser.add_option('--xcode',
dest='use_xcode',
help='generate build files for use with xcode')

parser.add_option('--verbose',
action='store_true',
dest='is_verbose',
help='will output some more info')

(options, args) = parser.parse_args()


Expand Down Expand Up @@ -619,6 +624,7 @@ def configure_v8(o):
o['variables']['v8_optimized_debug'] = 0 # Compile with -O0 in debug builds.
o['variables']['v8_random_seed'] = 0 # Use a random seed for hash tables.
o['variables']['v8_use_snapshot'] = b(not options.without_snapshot)
o['variables']['v8_postmortem_support'] = 'true' # Why not ?!

# assume shared_v8 if one of these is set?
if options.shared_v8_libpath:
Expand Down Expand Up @@ -728,11 +734,14 @@ output = {
'variables': variables,
'target_defaults': output
}
pprint.pprint(output, indent=2)

if options.is_verbose:
pprint.pprint(output, indent=2)

def write(filename, data):
filename = os.path.join(root_dir, filename)
print 'creating ', filename
if options.is_verbose:
print 'creating ', filename
f = open(filename, 'w+')
f.write(data)

Expand Down Expand Up @@ -767,4 +776,7 @@ else:

gyp_args += args

if options.is_verbose:
print(' '.join(gyp_args))

subprocess.call(gyp_args)
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "v8.h"
#include "debug.h"
#include "debug-agent.h"
#include "platform/socket.h"
#include "debug-agent-inl.h"

namespace v8 {
namespace internal {

// Public V8 debugger API message handler function. This function just delegates
// to the debugger agent through it's data parameter.
void DebuggerAgentMessageHandler(const v8::Debug::Message& message) {
Isolate* isolate = reinterpret_cast<Isolate*>(message.GetIsolate());
DebuggerAgent* agent = isolate->debugger_agent_instance();
ASSERT(agent != NULL);
agent->DebuggerMessage(message);
}
using i::Isolate;
using v8::base::Socket;
using v8::base::TimeDelta;
using v8::base::LockGuard;
using v8::base::OS;
using v8::internal::StrDup;
using v8::internal::PrintF;
using v8::internal::StrLength;
using v8::internal::NewArray;
using v8::internal::ScopedVector;



DebuggerAgent::DebuggerAgent(Isolate* isolate, const char* name, int port)
: Thread(name),
: Thread(Options(name, 64 * 1024)),
isolate_(isolate),
name_(StrDup(name)),
port_(port),
Expand All @@ -30,13 +30,10 @@ DebuggerAgent::DebuggerAgent(Isolate* isolate, const char* name, int port)
session_(NULL),
terminate_now_(0),
listening_(0) {
ASSERT(isolate_->debugger_agent_instance() == NULL);
isolate_->set_debugger_agent_instance(this);
}


DebuggerAgent::~DebuggerAgent() {
isolate_->set_debugger_agent_instance(NULL);
delete server_;
}

Expand Down Expand Up @@ -118,7 +115,7 @@ void DebuggerAgent::CreateSession(Socket* client) {

// Create a new session and hook up the debug message handler.
session_ = new DebuggerAgentSession(this, client);
isolate_->debugger()->SetMessageHandler(DebuggerAgentMessageHandler);
isolate_->debug()->SetMessageHandler(::DebuggerAgent::MessageHandler);
session_->Start();
}

Expand Down Expand Up @@ -161,7 +158,7 @@ void DebuggerAgent::OnSessionClosed(DebuggerAgentSession* session) {

// Terminate the session.
LockGuard<RecursiveMutex> session_access_guard(&session_access_);
ASSERT(session == session_);
DCHECK(session == session_);
if (session == session_) {
session_->Shutdown();
delete session_;
Expand Down Expand Up @@ -203,6 +200,8 @@ void DebuggerAgentSession::Run() {
ScopedVector<uint16_t> temp(utf16_length + 1);
decoder.WriteUtf16(temp.start(), utf16_length);

agent_->isolate_->logger()->DebugEvent("Recive", temp);

// Send the request received to the debugger.
v8::Debug::SendCommand(reinterpret_cast<v8::Isolate*>(agent_->isolate()),
temp.start(),
Expand All @@ -219,6 +218,7 @@ void DebuggerAgentSession::Run() {


void DebuggerAgentSession::DebuggerMessage(Vector<uint16_t> message) {
agent_->isolate_->logger()->DebugEvent("Send", message);
DebuggerAgentUtil::SendMessage(client_, message);
}

Expand Down Expand Up @@ -265,8 +265,8 @@ SmartArrayPointer<char> DebuggerAgentUtil::ReceiveMessage(Socket* conn) {
}

// Terminate header.
ASSERT(header_buffer_position > 1); // At least CRLF is received.
ASSERT(header_buffer_position <= kHeaderBufferSize);
DCHECK(header_buffer_position > 1); // At least CRLF is received.
DCHECK(header_buffer_position <= kHeaderBufferSize);
header_buffer[header_buffer_position - 2] = '\0';

// Split header.
Expand Down Expand Up @@ -328,35 +328,32 @@ bool DebuggerAgentUtil::SendConnectMessage(Socket* conn,
int len;

// Send the header.
len = OS::SNPrintF(Vector<char>(buffer, kBufferSize),
"Type: connect\r\n");
len = OS::SNPrintF(buffer, kBufferSize, "Type: connect\r\n");
ok = conn->Send(buffer, len);
if (!ok) return false;

len = OS::SNPrintF(Vector<char>(buffer, kBufferSize),
len = OS::SNPrintF(buffer, kBufferSize,
"V8-Version: %s\r\n", v8::V8::GetVersion());
ok = conn->Send(buffer, len);
if (!ok) return false;

len = OS::SNPrintF(Vector<char>(buffer, kBufferSize),
"Protocol-Version: 1\r\n");
len = OS::SNPrintF(buffer, kBufferSize, "Protocol-Version: 1\r\n");
ok = conn->Send(buffer, len);
if (!ok) return false;

if (embedding_host != NULL) {
len = OS::SNPrintF(Vector<char>(buffer, kBufferSize),
len = OS::SNPrintF(buffer, kBufferSize,
"Embedding-Host: %s\r\n", embedding_host);
ok = conn->Send(buffer, len);
if (!ok) return false;
}

len = OS::SNPrintF(Vector<char>(buffer, kBufferSize),
"%s: 0\r\n", kContentLength);
len = OS::SNPrintF(buffer, kBufferSize, "%s: 0\r\n", kContentLength);
ok = conn->Send(buffer, len);
if (!ok) return false;

// Terminate header with empty line.
len = OS::SNPrintF(Vector<char>(buffer, kBufferSize), "\r\n");
len = OS::SNPrintF(buffer, kBufferSize, "\r\n");
ok = conn->Send(buffer, len);
if (!ok) return false;

Expand All @@ -381,14 +378,14 @@ bool DebuggerAgentUtil::SendMessage(Socket* conn,
}

// Send the header.
int len = OS::SNPrintF(Vector<char>(buffer, kBufferSize),
int len = OS::SNPrintF(buffer, kBufferSize,
"%s: %d\r\n", kContentLength, utf8_len);
if (conn->Send(buffer, len) < len) {
return false;
}

// Terminate header with empty line.
len = OS::SNPrintF(Vector<char>(buffer, kBufferSize), "\r\n");
len = OS::SNPrintF(buffer, kBufferSize, "\r\n");
if (conn->Send(buffer, len) < len) {
return false;
}
Expand All @@ -401,7 +398,7 @@ bool DebuggerAgentUtil::SendMessage(Socket* conn,
uint16_t character = message[i];
buffer_position +=
unibrow::Utf8::Encode(buffer + buffer_position, character, previous);
ASSERT(buffer_position <= kBufferSize);
DCHECK(buffer_position <= kBufferSize);

// Send buffer if full or last character is encoded.
if (kBufferSize - buffer_position <
Expand All @@ -410,7 +407,7 @@ bool DebuggerAgentUtil::SendMessage(Socket* conn,
if (unibrow::Utf16::IsLeadSurrogate(character)) {
const int kEncodedSurrogateLength =
unibrow::Utf16::kUtf8BytesToCodeASurrogate;
ASSERT(buffer_position >= kEncodedSurrogateLength);
DCHECK(buffer_position >= kEncodedSurrogateLength);
len = buffer_position - kEncodedSurrogateLength;
if (conn->Send(buffer, len) < len) {
return false;
Expand All @@ -434,37 +431,6 @@ bool DebuggerAgentUtil::SendMessage(Socket* conn,
}


bool DebuggerAgentUtil::SendMessage(Socket* conn,
const v8::Handle<v8::String> request) {
static const int kBufferSize = 80;
char buffer[kBufferSize]; // Sending buffer both for header and body.

// Convert the request to UTF-8 encoding.
v8::String::Utf8Value utf8_request(request);

// Send the header.
int len = OS::SNPrintF(Vector<char>(buffer, kBufferSize),
"Content-Length: %d\r\n", utf8_request.length());
if (conn->Send(buffer, len) < len) {
return false;
}

// Terminate header with empty line.
len = OS::SNPrintF(Vector<char>(buffer, kBufferSize), "\r\n");
if (conn->Send(buffer, len) < len) {
return false;
}

// Send message body as UTF-8.
len = utf8_request.length();
if (conn->Send(*utf8_request, len) < len) {
return false;
}

return true;
}


// Receive the full buffer before returning unless an error occours.
int DebuggerAgentUtil::ReceiveAll(Socket* conn, char* data, int len) {
int total_received = 0;
Expand All @@ -478,4 +444,4 @@ int DebuggerAgentUtil::ReceiveAll(Socket* conn, char* data, int len) {
return total_received;
}

} } // namespace v8::internal
} // namespace internal
Loading