Push version 1.2.2 to trunk.
Fixed bug in array sorting for sparse arrays (issue 326).
Added support for adding a soname when building a shared library on Linux (issue 151).
Fixed bug caused by morphing internal ASCII strings to external two-byte strings. Slices over ASCII strings have to forward ASCII checks to the underlying buffer string.
Allowed API call-as-function handlers to be called as constructors.
Fixed a crash bug where an external string was disposed but a slice of the external string survived as a symbol.
git-svn-id: http://v8.googlecode.com/svn/trunk@1853 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/ChangeLog b/ChangeLog
index d59c5be..3ff239c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2009-05-04: Version 1.2.2
+
+ Fixed bug in array sorting for sparse arrays (issue 326).
+
+ Added support for adding a soname when building a shared library
+ on Linux (issue 151).
+
+ Fixed bug caused by morphing internal ASCII strings to external
+ two-byte strings. Slices over ASCII strings have to forward ASCII
+ checks to the underlying buffer string.
+
+ Allowed API call-as-function handlers to be called as
+ constructors.
+
+ Fixed a crash bug where an external string was disposed but a
+ slice of the external string survived as a symbol.
+
+
2009-04-27: Version 1.2.1
Added EcmaScript 5 JSON object.
diff --git a/SConstruct b/SConstruct
index 05cb625..ac210d5 100644
--- a/SConstruct
+++ b/SConstruct
@@ -35,6 +35,7 @@
sys.path.append(join(root_dir, 'tools'))
import js2c, utils
+
# ANDROID_TOP is the top of the Android checkout, fetched from the environment
# variable 'TOP'. You will also need to set the CXX, CC, AR and RANLIB
# environment variables to the cross-compiling tools.
@@ -131,9 +132,30 @@
'-Wstrict-aliasing=2'],
'CPPPATH': ANDROID_INCLUDES,
},
+ 'wordsize:32': {
+ 'arch:x64': {
+ 'CCFLAGS': ['-m64'],
+ 'LINKFLAGS': ['-m64']
+ }
+ },
'wordsize:64': {
- 'CCFLAGS': ['-m32'],
- 'LINKFLAGS': ['-m32']
+ 'arch:ia32': {
+ 'CCFLAGS': ['-m32'],
+ 'LINKFLAGS': ['-m32']
+ },
+ 'arch:arm': {
+ 'CCFLAGS': ['-m32'],
+ 'LINKFLAGS': ['-m32']
+ }
+ },
+ 'arch:ia32': {
+ 'CPPDEFINES': ['V8_ARCH_IA32', 'ILP32']
+ },
+ 'arch:arm': {
+ 'CPPDEFINES': ['V8_ARCH_ARM', 'ILP32']
+ },
+ 'arch:x64': {
+ 'CPPDEFINES': ['V8_ARCH_X64', 'LP64']
},
'prof:oprofile': {
'CPPDEFINES': ['ENABLE_OPROFILE_AGENT']
@@ -150,6 +172,9 @@
'ARFLAGS': ['/NOLOGO'],
'CCPDBFLAGS': ['/Zi']
},
+ 'arch:ia32': {
+ 'CPPDEFINES': ['V8_ARCH_IA32']
+ },
'mode:debug': {
'CCFLAGS': ['/Od', '/Gm'],
'CPPDEFINES': ['_DEBUG', 'ENABLE_DISASSEMBLER', 'DEBUG'],
@@ -175,7 +200,7 @@
'LINKFLAGS': ['/LTCG'],
'ARFLAGS': ['/LTCG'],
}
- },
+ }
}
}
@@ -187,17 +212,16 @@
'WARNINGFLAGS': ['-Wall', '-Werror', '-W',
'-Wno-unused-parameter']
},
- 'arch:arm': {
- 'CPPDEFINES': ['ARM']
- },
- 'arch:android': {
- 'CPPDEFINES': ['ARM']
- },
'os:win32': {
'WARNINGFLAGS': ['-pedantic', '-Wno-long-long']
},
'os:linux': {
- 'WARNINGFLAGS': ['-pedantic']
+ 'WARNINGFLAGS': ['-pedantic'],
+ 'library:shared': {
+ 'soname:on': {
+ 'LINKFLAGS': ['-Wl,-soname,${SONAME}']
+ }
+ }
},
'os:macos': {
'WARNINGFLAGS': ['-pedantic']
@@ -215,7 +239,7 @@
'LIBS': ['winmm', 'ws2_32']
},
'arch:arm': {
- 'CPPDEFINES': ['ARM'],
+ 'CPPDEFINES': ['V8_ARCH_ARM'],
# /wd4996 is to silence the warning about sscanf
# used by the arm simulator.
'WARNINGFLAGS': ['/wd4996']
@@ -286,10 +310,34 @@
'os:win32': {
'LIBS': ['winmm', 'ws2_32']
},
- 'wordsize:64': {
- 'CCFLAGS': ['-m32'],
- 'LINKFLAGS': ['-m32']
+ 'os:android': {
+ 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__',
+ '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'],
+ 'CCFLAGS': ANDROID_FLAGS,
+ 'CPPPATH': ANDROID_INCLUDES,
+ 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'],
+ 'LINKFLAGS': ANDROID_LINKFLAGS,
+ 'LIBS': ['c', 'stdc++', 'm'],
+ 'mode:release': {
+ 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
+ }
},
+ 'wordsize:32': {
+ 'arch:x64': {
+ 'CCFLAGS': ['-m64'],
+ 'LINKFLAGS': ['-m64']
+ }
+ },
+ 'wordsize:64': {
+ 'arch:ia32': {
+ 'CCFLAGS': ['-m32'],
+ 'LINKFLAGS': ['-m32']
+ },
+ 'arch:arm': {
+ 'CCFLAGS': ['-m32'],
+ 'LINKFLAGS': ['-m32']
+ }
+ }
},
'msvc': {
'all': {
@@ -298,6 +346,9 @@
},
'library:shared': {
'CPPDEFINES': ['USING_V8_SHARED']
+ },
+ 'arch:ia32': {
+ 'CPPDEFINES': ['V8_ARCH_IA32']
}
}
}
@@ -337,9 +388,21 @@
'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
}
},
+ 'wordsize:32': {
+ 'arch:x64': {
+ 'CCFLAGS': ['-m64'],
+ 'LINKFLAGS': ['-m64']
+ }
+ },
'wordsize:64': {
- 'CCFLAGS': ['-m32'],
- 'LINKFLAGS': ['-m32']
+ 'arch:ia32': {
+ 'CCFLAGS': ['-m32'],
+ 'LINKFLAGS': ['-m32']
+ },
+ 'arch:arm': {
+ 'CCFLAGS': ['-m32'],
+ 'LINKFLAGS': ['-m32']
+ }
},
'mode:release': {
'CCFLAGS': ['-O2']
@@ -378,6 +441,9 @@
'LINKFLAGS': ['/LTCG'],
}
},
+ 'arch:ia32': {
+ 'CPPDEFINES': ['V8_ARCH_IA32']
+ },
'mode:debug': {
'CCFLAGS': ['/Od'],
'LINKFLAGS': ['/DEBUG'],
@@ -454,17 +520,17 @@
'toolchain': {
'values': ['gcc', 'msvc'],
'default': TOOLCHAIN_GUESS,
- 'help': 'the toolchain to use'
+ 'help': 'the toolchain to use (' + TOOLCHAIN_GUESS + ')'
},
'os': {
'values': ['freebsd', 'linux', 'macos', 'win32', 'android'],
'default': OS_GUESS,
- 'help': 'the os to build for'
+ 'help': 'the os to build for (' + OS_GUESS + ')'
},
'arch': {
- 'values':['arm', 'ia32'],
+ 'values':['arm', 'ia32', 'x64'],
'default': ARCH_GUESS,
- 'help': 'the architecture to build for'
+ 'help': 'the architecture to build for (' + ARCH_GUESS + ')'
},
'snapshot': {
'values': ['on', 'off', 'nobuild'],
@@ -481,6 +547,11 @@
'default': 'static',
'help': 'the type of library to produce'
},
+ 'soname': {
+ 'values': ['on', 'off'],
+ 'default': 'off',
+ 'help': 'turn on setting soname for Linux shared library'
+ },
'msvcrt': {
'values': ['static', 'shared'],
'default': 'static',
@@ -531,6 +602,49 @@
return result
+def GetVersionComponents():
+ MAJOR_VERSION_PATTERN = re.compile(r"#define\s+MAJOR_VERSION\s+(.*)")
+ MINOR_VERSION_PATTERN = re.compile(r"#define\s+MINOR_VERSION\s+(.*)")
+ BUILD_NUMBER_PATTERN = re.compile(r"#define\s+BUILD_NUMBER\s+(.*)")
+ PATCH_LEVEL_PATTERN = re.compile(r"#define\s+PATCH_LEVEL\s+(.*)")
+
+ patterns = [MAJOR_VERSION_PATTERN,
+ MINOR_VERSION_PATTERN,
+ BUILD_NUMBER_PATTERN,
+ PATCH_LEVEL_PATTERN]
+
+ source = open(join(root_dir, 'src', 'version.cc')).read()
+ version_components = []
+ for pattern in patterns:
+ match = pattern.search(source)
+ if match:
+ version_components.append(match.group(1).strip())
+ else:
+ version_components.append('0')
+
+ return version_components
+
+
+def GetVersion():
+ version_components = GetVersionComponents()
+
+ if version_components[len(version_components) - 1] == '0':
+ version_components.pop()
+ return '.'.join(version_components)
+
+
+def GetSpecificSONAME():
+ SONAME_PATTERN = re.compile(r"#define\s+SONAME\s+\"(.*)\"")
+
+ source = open(join(root_dir, 'src', 'version.cc')).read()
+ match = SONAME_PATTERN.search(source)
+
+ if match:
+ return match.group(1).strip()
+ else:
+ return ''
+
+
def SplitList(str):
return [ s for s in str.split(",") if len(s) > 0 ]
@@ -553,6 +667,12 @@
Abort("Profiling on windows only supported for static library.")
if env['prof'] == 'oprofile' and env['os'] != 'linux':
Abort("OProfile is only supported on Linux.")
+ if env['os'] == 'win32' and env['soname'] == 'on':
+ Abort("Shared Object soname not applicable for Windows.")
+ if env['soname'] == 'on' and env['library'] == 'static':
+ Abort("Shared Object soname not applicable for static library.")
+ if env['arch'] == 'x64' and env['os'] != 'linux':
+ Abort("X64 compilation only allowed on Linux OS.")
for (name, option) in SIMPLE_OPTIONS.iteritems():
if (not option.get('default')) and (name not in ARGUMENTS):
message = ("A value for option %s must be specified (%s)." %
@@ -683,11 +803,23 @@
'd8': d8_flags
}
+ # Generate library base name.
target_id = mode
suffix = SUFFIXES[target_id]
library_name = 'v8' + suffix
+ version = GetVersion()
+ if context.options['soname'] == 'on':
+ # When building shared object with SONAME version the library name.
+ library_name += '-' + version
env['LIBRARY'] = library_name
+ # Generate library SONAME if required by the build.
+ if context.options['soname'] == 'on':
+ soname = GetSpecificSONAME()
+ if soname == '':
+ soname = 'lib' + library_name + '.so'
+ env['SONAME'] = soname
+
# Build the object files by invoking SCons recursively.
(object_files, shell_files, mksnapshot) = env.SConscript(
join('src', 'SConscript'),
diff --git a/include/v8-debug.h b/include/v8-debug.h
index 5235495..3adc0a0 100644
--- a/include/v8-debug.h
+++ b/include/v8-debug.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_DEBUG_H_
-#define V8_DEBUG_H_
+#ifndef V8_V8_DEBUG_H_
+#define V8_V8_DEBUG_H_
#include "v8.h"
@@ -92,6 +92,57 @@
/**
+ * A message object passed to the debug message handler.
+ */
+ class Message {
+ public:
+ /**
+ * Check type of message.
+ */
+ virtual bool IsEvent() const = 0;
+ virtual bool IsResponse() const = 0;
+ virtual DebugEvent GetEvent() const = 0;
+
+ /**
+ * Indicate whether this is a response to a continue command which will
+ * start the VM running after this is processed.
+ */
+ virtual bool WillStartRunning() const = 0;
+
+ /**
+ * Access to execution state and event data. Don't store these cross
+ * callbacks as their content becomes invalid. These objects are from the
+ * debugger event that started the debug message loop.
+ */
+ virtual Handle<Object> GetExecutionState() const = 0;
+ virtual Handle<Object> GetEventData() const = 0;
+
+ /**
+ * Get the debugger protocol JSON.
+ */
+ virtual Handle<String> GetJSON() const = 0;
+
+ /**
+ * Get the context active when the debug event happened. Note this is not
+ * the current active context as the JavaScript part of the debugger is
+ * running in it's own context which is entered at this point.
+ */
+ virtual Handle<Context> GetEventContext() const = 0;
+
+ /**
+ * Client data passed with the corresponding request if any. This is the
+ * client_data data value passed into Debug::SendCommand along with the
+ * request that led to the message or NULL if the message is an event. The
+ * debugger takes ownership of the data and will delete it even if there is
+ * no message handler.
+ */
+ virtual ClientData* GetClientData() const = 0;
+
+ virtual ~Message() {}
+ };
+
+
+ /**
* Debug event callback function.
*
* \param event the type of the debug event that triggered the callback
@@ -101,26 +152,35 @@
* \param data value passed by the user to SetDebugEventListener
*/
typedef void (*EventCallback)(DebugEvent event,
- Handle<Object> exec_state,
- Handle<Object> event_data,
- Handle<Value> data);
+ Handle<Object> exec_state,
+ Handle<Object> event_data,
+ Handle<Value> data);
/**
* Debug message callback function.
*
- * \param message the debug message
+ * \param message the debug message handler message object
* \param length length of the message
- * \param data the data value passed when registering the message handler
- * \param client_data the data value passed into Debug::SendCommand along
- * with the request that led to the message or NULL if the message is an
- * asynchronous event. The debugger takes ownership of the data and will
- * delete it before dying even if there is no message handler.
+ * \param client_data the data value passed when registering the message handler
+
* A MessageHandler does not take posession of the message string,
* and must not rely on the data persisting after the handler returns.
+ *
+ * This message handler is deprecated. Use MessageHandler2 instead.
*/
typedef void (*MessageHandler)(const uint16_t* message, int length,
- ClientData* client_data);
+ ClientData* client_data);
+
+ /**
+ * Debug message callback function.
+ *
+ * \param message the debug message handler message object
+
+ * A MessageHandler does not take posession of the message data,
+ * and must not rely on the data persisting after the handler returns.
+ */
+ typedef void (*MessageHandler2)(const Message& message);
/**
* Debug host dispatch callback function.
@@ -142,6 +202,7 @@
// handler thread is not supported any more parameter must be false.
static void SetMessageHandler(MessageHandler handler,
bool message_handler_thread = false);
+ static void SetMessageHandler2(MessageHandler2 handler);
static void SendCommand(const uint16_t* command, int length,
ClientData* client_data = NULL);
@@ -185,4 +246,4 @@
#undef EXPORT
-#endif // V8_DEBUG_H_
+#endif // V8_V8_DEBUG_H_
diff --git a/include/v8.h b/include/v8.h
index 1013cab..068a1cd 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -41,10 +41,15 @@
#include <stdio.h>
#ifdef _WIN32
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef short int16_t; // NOLINT
+typedef unsigned short uint16_t; // NOLINT
typedef int int32_t;
typedef unsigned int uint32_t;
-typedef unsigned short uint16_t; // NOLINT
-typedef long long int64_t; // NOLINT
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+// intptr_t is defined in crtdefs.h through stdio.h.
// Setup for Windows DLL export/import. When building the V8 DLL the
// BUILDING_V8_SHARED needs to be defined. When building a program which uses
@@ -1121,7 +1126,10 @@
/**
* Returns the identity hash for this object. The current implemenation uses
- * a hidden property on the object to store the identity hash.
+ * a hidden property on the object to store the identity hash.
+ *
+ * The return value will never be 0. Also, it is not guaranteed to be
+ * unique.
*/
int GetIdentityHash();
diff --git a/src/SConscript b/src/SConscript
old mode 100644
new mode 100755
index b0a2933..59c452b
--- a/src/SConscript
+++ b/src/SConscript
@@ -50,23 +50,34 @@
'scopeinfo.cc', 'scopes.cc', 'serialize.cc', 'snapshot-common.cc',
'spaces.cc', 'string-stream.cc', 'stub-cache.cc', 'token.cc', 'top.cc',
'unicode.cc', 'usage-analyzer.cc', 'utils.cc', 'v8-counters.cc',
- 'v8.cc', 'v8threads.cc', 'variables.cc', 'virtual-frame.cc', 'zone.cc'
+ 'v8.cc', 'v8threads.cc', 'variables.cc', 'version.cc',
+ 'virtual-frame.cc', 'zone.cc'
],
'arch:arm': [
'arm/assembler-arm.cc', 'arm/builtins-arm.cc',
'arm/codegen-arm.cc', 'arm/cpu-arm.cc', 'arm/disasm-arm.cc',
'arm/debug-arm.cc', 'arm/frames-arm.cc', 'arm/ic-arm.cc',
'arm/jump-target-arm.cc', 'arm/macro-assembler-arm.cc',
+ 'arm/regexp-macro-assembler-arm.cc',
'arm/register-allocator-arm.cc', 'arm/stub-cache-arm.cc',
- 'arm/regexp-macro-assembler-arm.cc', 'arm/virtual-frame-arm.cc'
+ 'arm/virtual-frame-arm.cc'
],
'arch:ia32': [
'ia32/assembler-ia32.cc', 'ia32/builtins-ia32.cc',
'ia32/codegen-ia32.cc', 'ia32/cpu-ia32.cc', 'ia32/disasm-ia32.cc',
'ia32/debug-ia32.cc', 'ia32/frames-ia32.cc', 'ia32/ic-ia32.cc',
'ia32/jump-target-ia32.cc', 'ia32/macro-assembler-ia32.cc',
+ 'ia32/regexp-macro-assembler-ia32.cc',
'ia32/register-allocator-ia32.cc', 'ia32/stub-cache-ia32.cc',
- 'ia32/regexp-macro-assembler-ia32.cc', 'ia32/virtual-frame-ia32.cc'
+ 'ia32/virtual-frame-ia32.cc'
+ ],
+ 'arch:x64': [
+ 'x64/assembler-x64.cc', 'x64/builtins-x64.cc',
+ 'x64/codegen-x64.cc', 'x64/cpu-x64.cc', 'x64/disasm-x64.cc',
+ 'x64/debug-x64.cc', 'x64/frames-x64.cc', 'x64/ic-x64.cc',
+ 'x64/jump-target-x64.cc', 'x64/macro-assembler-x64.cc',
+ # 'x64/regexp-macro-assembler-x64.cc',
+ 'x64/stub-cache-x64.cc'
],
'simulator:arm': ['arm/simulator-arm.cc'],
'os:freebsd': ['platform-freebsd.cc', 'platform-posix.cc'],
diff --git a/src/api.cc b/src/api.cc
index 860317d..058b246 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -37,6 +37,7 @@
#include "serialize.h"
#include "snapshot.h"
#include "v8threads.h"
+#include "version.h"
#define LOG_API(expr) LOG(ApiEntryCall(expr))
@@ -2072,7 +2073,12 @@
if (hash->IsSmi()) {
hash_value = i::Smi::cast(*hash)->value();
} else {
- hash_value = random() & i::Smi::kMaxValue; // Limit range to fit a smi.
+ int attempts = 0;
+ do {
+ hash_value = random() & i::Smi::kMaxValue; // Limit range to fit a smi.
+ attempts++;
+ } while (hash_value == 0 && attempts < 30);
+ hash_value = hash_value != 0 ? hash_value : 1; // never return 0
i::SetProperty(hidden_props,
hash_symbol,
i::Handle<i::Object>(i::Smi::FromInt(hash_value)),
@@ -2422,7 +2428,9 @@
const char* v8::V8::GetVersion() {
- return "1.2.1";
+ static v8::internal::EmbeddedVector<char, 128> buffer;
+ v8::internal::Version::GetString(buffer);
+ return buffer.start();
}
@@ -3260,6 +3268,16 @@
}
+static v8::Debug::MessageHandler message_handler = NULL;
+
+static void MessageHandlerWrapper(const v8::Debug::Message& message) {
+ if (message_handler) {
+ v8::String::Value json(message.GetJSON());
+ message_handler(*json, json.length(), message.GetClientData());
+ }
+}
+
+
void Debug::SetMessageHandler(v8::Debug::MessageHandler handler,
bool message_handler_thread) {
EnsureInitialized("v8::Debug::SetMessageHandler");
@@ -3267,6 +3285,20 @@
// Message handler thread not supported any more. Parameter temporally left in
// the API for client compatability reasons.
CHECK(!message_handler_thread);
+
+ // TODO(sgjesse) support the old message handler API through a simple wrapper.
+ message_handler = handler;
+ if (message_handler != NULL) {
+ i::Debugger::SetMessageHandler(MessageHandlerWrapper);
+ } else {
+ i::Debugger::SetMessageHandler(NULL);
+ }
+}
+
+
+void Debug::SetMessageHandler2(v8::Debug::MessageHandler2 handler) {
+ EnsureInitialized("v8::Debug::SetMessageHandler");
+ ENTER_V8;
i::Debugger::SetMessageHandler(handler);
}
diff --git a/src/arm/assembler-arm-inl.h b/src/arm/assembler-arm-inl.h
index 65757e7..fe64761 100644
--- a/src/arm/assembler-arm-inl.h
+++ b/src/arm/assembler-arm-inl.h
@@ -34,8 +34,8 @@
// significantly by Google Inc.
// Copyright 2006-2008 the V8 project authors. All rights reserved.
-#ifndef V8_ASSEMBLER_ARM_INL_H_
-#define V8_ASSEMBLER_ARM_INL_H_
+#ifndef V8_ARM_ASSEMBLER_ARM_INL_H_
+#define V8_ARM_ASSEMBLER_ARM_INL_H_
#include "arm/assembler-arm.h"
#include "cpu.h"
@@ -246,4 +246,4 @@
} } // namespace v8::internal
-#endif // V8_ASSEMBLER_ARM_INL_H_
+#endif // V8_ARM_ASSEMBLER_ARM_INL_H_
diff --git a/src/arm/assembler-arm.h b/src/arm/assembler-arm.h
index 5edccbc..d7535e0 100644
--- a/src/arm/assembler-arm.h
+++ b/src/arm/assembler-arm.h
@@ -37,8 +37,8 @@
// A light-weight ARM Assembler
// Generates user mode instructions for the ARM architecture up to version 5
-#ifndef V8_ASSEMBLER_ARM_H_
-#define V8_ASSEMBLER_ARM_H_
+#ifndef V8_ARM_ASSEMBLER_ARM_H_
+#define V8_ARM_ASSEMBLER_ARM_H_
#include "assembler.h"
@@ -786,4 +786,4 @@
} } // namespace v8::internal
-#endif // V8_ASSEMBLER_ARM_H_
+#endif // V8_ARM_ASSEMBLER_ARM_H_
diff --git a/src/arm/codegen-arm.h b/src/arm/codegen-arm.h
index 48b92ea..a5f77fe 100644
--- a/src/arm/codegen-arm.h
+++ b/src/arm/codegen-arm.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_CODEGEN_ARM_H_
-#define V8_CODEGEN_ARM_H_
+#ifndef V8_ARM_CODEGEN_ARM_H_
+#define V8_ARM_CODEGEN_ARM_H_
namespace v8 { namespace internal {
@@ -443,4 +443,4 @@
} } // namespace v8::internal
-#endif // V8_CODEGEN_ARM_H_
+#endif // V8_ARM_CODEGEN_ARM_H_
diff --git a/src/arm/constants-arm.h b/src/arm/constants-arm.h
index 919a892..66c6a8d 100644
--- a/src/arm/constants-arm.h
+++ b/src/arm/constants-arm.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_CONSTANTS_ARM_H_
-#define V8_CONSTANTS_ARM_H_
+#ifndef V8_ARM_CONSTANTS_ARM_H_
+#define V8_ARM_CONSTANTS_ARM_H_
namespace assembler { namespace arm {
@@ -237,4 +237,4 @@
} } // namespace assembler::arm
-#endif // V8_CONSTANTS_ARM_H_
+#endif // V8_ARM_CONSTANTS_ARM_H_
diff --git a/src/arm/frames-arm.h b/src/arm/frames-arm.h
index 930f6e0..9a18f3d 100644
--- a/src/arm/frames-arm.h
+++ b/src/arm/frames-arm.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_FRAMES_ARM_H_
-#define V8_FRAMES_ARM_H_
+#ifndef V8_ARM_FRAMES_ARM_H_
+#define V8_ARM_FRAMES_ARM_H_
namespace v8 { namespace internal {
@@ -376,4 +376,4 @@
} } // namespace v8::internal
-#endif // V8_FRAMES_ARM_H_
+#endif // V8_ARM_FRAMES_ARM_H_
diff --git a/src/arm/ic-arm.cc b/src/arm/ic-arm.cc
index e418556..b07c474 100644
--- a/src/arm/ic-arm.cc
+++ b/src/arm/ic-arm.cc
@@ -497,12 +497,18 @@
}
-// TODO(181): Implement map patching once loop nesting is tracked on
-// the ARM platform so we can generate inlined fast-case code for
-// array indexing in loops.
-bool KeyedLoadIC::HasInlinedVersion(Address address) { return false; }
-void KeyedLoadIC::ClearInlinedVersion(Address address) { }
-void KeyedLoadIC::PatchInlinedMapCheck(Address address, Object* value) { }
+// TODO(181): Implement map patching once loop nesting is tracked on the
+// ARM platform so we can generate inlined fast-case code loads in
+// loops.
+void LoadIC::ClearInlinedVersion(Address address) {}
+bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) {
+ return false;
+}
+
+void KeyedLoadIC::ClearInlinedVersion(Address address) {}
+bool KeyedLoadIC::PatchInlinedLoad(Address address, Object* map) {
+ return false;
+}
Object* KeyedLoadIC_Miss(Arguments args);
diff --git a/src/arm/macro-assembler-arm.h b/src/arm/macro-assembler-arm.h
index d3835be..e336757 100644
--- a/src/arm/macro-assembler-arm.h
+++ b/src/arm/macro-assembler-arm.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_MACRO_ASSEMBLER_ARM_H_
-#define V8_MACRO_ASSEMBLER_ARM_H_
+#ifndef V8_ARM_MACRO_ASSEMBLER_ARM_H_
+#define V8_ARM_MACRO_ASSEMBLER_ARM_H_
#include "assembler.h"
@@ -310,4 +310,4 @@
} } // namespace v8::internal
-#endif // V8_MACRO_ASSEMBLER_ARM_H_
+#endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_
diff --git a/src/arm/regexp-macro-assembler-arm.h b/src/arm/regexp-macro-assembler-arm.h
index 51352bc..2f38bb7 100644
--- a/src/arm/regexp-macro-assembler-arm.h
+++ b/src/arm/regexp-macro-assembler-arm.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef REGEXP_MACRO_ASSEMBLER_ARM_H_
-#define REGEXP_MACRO_ASSEMBLER_ARM_H_
+#ifndef V8_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_
+#define V8_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_
namespace v8 { namespace internal {
@@ -38,4 +38,4 @@
}} // namespace v8::internal
-#endif /* REGEXP_MACRO_ASSEMBLER_ARM_H_ */
+#endif // V8_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_
diff --git a/src/arm/simulator-arm.h b/src/arm/simulator-arm.h
index 5553ab2..2029fd3 100644
--- a/src/arm/simulator-arm.h
+++ b/src/arm/simulator-arm.h
@@ -33,14 +33,14 @@
// which will start execution in the Simulator or forwards to the real entry
// on a ARM HW platform.
-#ifndef V8_SIMULATOR_ARM_H_
-#define V8_SIMULATOR_ARM_H_
+#ifndef V8_ARM_SIMULATOR_ARM_H_
+#define V8_ARM_SIMULATOR_ARM_H_
#if defined(__arm__)
// When running without a simulator we call the entry directly.
#define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
- entry(p0, p1, p2, p3, p4)
+ reinterpret_cast<Object*>(entry(p0, p1, p2, p3, p4))
// Calculated the stack limit beyond which we will throw stack overflow errors.
// This macro must be called from a C++ method. It relies on being able to take
@@ -201,4 +201,4 @@
#endif // defined(__arm__)
-#endif // V8_SIMULATOR_ARM_H_
+#endif // V8_ARM_SIMULATOR_ARM_H_
diff --git a/src/arm/virtual-frame-arm.h b/src/arm/virtual-frame-arm.h
index af3c08c..371a23e 100644
--- a/src/arm/virtual-frame-arm.h
+++ b/src/arm/virtual-frame-arm.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_VIRTUAL_FRAME_ARM_H_
-#define V8_VIRTUAL_FRAME_ARM_H_
+#ifndef V8_ARM_VIRTUAL_FRAME_ARM_H_
+#define V8_ARM_VIRTUAL_FRAME_ARM_H_
#include "register-allocator.h"
@@ -477,4 +477,4 @@
} } // namespace v8::internal
-#endif // V8_VIRTUAL_FRAME_ARM_H_
+#endif // V8_ARM_VIRTUAL_FRAME_ARM_H_
diff --git a/src/array.js b/src/array.js
index 0adbf9d..bee73e4 100644
--- a/src/array.js
+++ b/src/array.js
@@ -709,32 +709,91 @@
QuickSort(a, high_start, to);
}
- var old_length = ToUint32(this.length);
- if (old_length < 2) return this;
+ // Copies elements in the range 0..length from obj's prototype chain
+ // to obj itself, if obj has holes. Returns one more than the maximal index
+ // of a prototype property.
+ function CopyFromPrototype(obj, length) {
+ var max = 0;
+ for (var proto = obj.__proto__; proto; proto = proto.__proto__) {
+ var indices = %GetArrayKeys(proto, length);
+ if (indices.length > 0) {
+ if (indices[0] == -1) {
+ // It's an interval.
+ var proto_length = indices[1];
+ for (var i = 0; i < proto_length; i++) {
+ if (!obj.hasOwnProperty(i) && proto.hasOwnProperty(i)) {
+ obj[i] = proto[i];
+ if (i >= max) { max = i + 1; }
+ }
+ }
+ } else {
+ for (var i = 0; i < indices.length; i++) {
+ var index = indices[i];
+ if (!IS_UNDEFINED(index) &&
+ !obj.hasOwnProperty(index) && proto.hasOwnProperty(index)) {
+ obj[index] = proto[index];
+ if (index >= max) { max = index + 1; }
+ }
+ }
+ }
+ }
+ }
+ return max;
+ }
- %RemoveArrayHoles(this);
-
- var length = ToUint32(this.length);
-
- // Move undefined elements to the end of the array.
- for (var i = 0; i < length; ) {
- if (IS_UNDEFINED(this[i])) {
- length--;
- this[i] = this[length];
- this[length] = void 0;
- } else {
- i++;
+ // Set a value of "undefined" on all indices in the range from..to
+ // where a prototype of obj has an element. I.e., shadow all prototype
+ // elements in that range.
+ function ShadowPrototypeElements(obj, from, to) {
+ for (var proto = obj.__proto__; proto; proto = proto.__proto__) {
+ var indices = %GetArrayKeys(proto, to);
+ if (indices.length > 0) {
+ if (indices[0] == -1) {
+ // It's an interval.
+ var proto_length = indices[1];
+ for (var i = from; i < proto_length; i++) {
+ if (proto.hasOwnProperty(i)) {
+ obj[i] = void 0;
+ }
+ }
+ } else {
+ for (var i = 0; i < indices.length; i++) {
+ var index = indices[i];
+ if (!IS_UNDEFINED(index) && from <= index &&
+ proto.hasOwnProperty(index)) {
+ obj[index] = void 0;
+ }
+ }
+ }
+ }
}
}
- QuickSort(this, 0, length);
+ var length = ToUint32(this.length);
+ if (length < 2) return this;
- // We only changed the length of the this object (in
- // RemoveArrayHoles) if it was an array. We are not allowed to set
- // the length of the this object if it is not an array because this
- // might introduce a new length property.
- if (IS_ARRAY(this)) {
- this.length = old_length;
+ var is_array = IS_ARRAY(this);
+ var max_prototype_element;
+ if (!is_array) {
+ // For compatibility with JSC, we also sort elements inherited from
+ // the prototype chain on non-Array objects.
+ // We do this by copying them to this object and sorting only
+ // local elements. This is not very efficient, but sorting with
+ // inherited elements happens very, very rarely, if at all.
+ // The specification allows "implementation dependent" behavior
+ // if an element on the prototype chain has an element that
+ // might interact with sorting.
+ max_prototype_element = CopyFromPrototype(this, length);
+ }
+
+ var num_non_undefined = %RemoveArrayHoles(this, length);
+
+ QuickSort(this, 0, num_non_undefined);
+
+ if (!is_array && (num_non_undefined + 1 < max_prototype_element)) {
+ // For compatibility with JSC, we shadow any elements in the prototype
+ // chain that has become exposed by sort moving a hole to its position.
+ ShadowPrototypeElements(this, num_non_undefined, max_prototype_element);
}
return this;
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index c434207..e4962ef 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -870,9 +870,7 @@
// If we can't find the function in the cache, we compile a new
// function and insert it into the cache.
if (!cache->Lookup(name, &boilerplate)) {
-#ifdef DEBUG
- ASSERT(StringShape(*source).IsAsciiRepresentation());
-#endif
+ ASSERT(source->IsAsciiRepresentation());
Handle<String> script_name = Factory::NewStringFromUtf8(name);
boilerplate =
Compiler::Compile(source, script_name, 0, 0, extension, NULL);
diff --git a/src/checks.h b/src/checks.h
index 0ff79af..b302e5b 100644
--- a/src/checks.h
+++ b/src/checks.h
@@ -254,7 +254,7 @@
#define ASSERT_TAG_ALIGNED(address) \
- ASSERT((reinterpret_cast<int>(address) & kHeapObjectTagMask) == 0)
+ ASSERT((reinterpret_cast<intptr_t>(address) & kHeapObjectTagMask) == 0)
#define ASSERT_SIZE_TAG_ALIGNED(size) ASSERT((size & kHeapObjectTagMask) == 0)
diff --git a/src/codegen.h b/src/codegen.h
index e9a5edd..3d45995 100644
--- a/src/codegen.h
+++ b/src/codegen.h
@@ -76,9 +76,15 @@
enum OverwriteMode { NO_OVERWRITE, OVERWRITE_LEFT, OVERWRITE_RIGHT };
-#ifdef ARM
+#ifdef V8_ARCH_ARM
#include "arm/codegen-arm.h"
-#else
+#endif
+
+#ifdef V8_ARCH_X64
+#include "x64/codegen-x64.h"
+#endif
+
+#ifdef V8_ARCH_IA32
#include "ia32/codegen-ia32.h"
#endif
@@ -116,6 +122,9 @@
JumpTarget* enter() { return &enter_; }
void BindExit() { exit_.Bind(0); }
void BindExit(Result* result) { exit_.Bind(result, 1); }
+ void BindExit(Result* result0, Result* result1) {
+ exit_.Bind(result0, result1, 2);
+ }
void BindExit(Result* result0, Result* result1, Result* result2) {
exit_.Bind(result0, result1, result2, 3);
}
diff --git a/src/dateparser-inl.h b/src/dateparser-inl.h
index 734c151..61a8c72 100644
--- a/src/dateparser-inl.h
+++ b/src/dateparser-inl.h
@@ -25,6 +25,9 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#ifndef V8_DATEPARSER_INL_H_
+#define V8_DATEPARSER_INL_H_
+
namespace v8 { namespace internal {
template <typename Char>
@@ -104,3 +107,5 @@
}
} } // namespace v8::internal
+
+#endif // V8_DATEPARSER_INL_H_
diff --git a/src/debug-agent.cc b/src/debug-agent.cc
index 0fab188..63f143a 100644
--- a/src/debug-agent.cc
+++ b/src/debug-agent.cc
@@ -34,9 +34,8 @@
// Public V8 debugger API message handler function. This function just delegates
// to the debugger agent through it's data parameter.
-void DebuggerAgentMessageHandler(const uint16_t* message, int length,
- v8::Debug::ClientData* client_data) {
- DebuggerAgent::instance_->DebuggerMessage(message, length);
+void DebuggerAgentMessageHandler(const v8::Debug::Message& message) {
+ DebuggerAgent::instance_->DebuggerMessage(message);
}
// static
@@ -107,7 +106,7 @@
// Create a new session and hook up the debug message handler.
session_ = new DebuggerAgentSession(this, client);
- v8::Debug::SetMessageHandler(DebuggerAgentMessageHandler);
+ v8::Debug::SetMessageHandler2(DebuggerAgentMessageHandler);
session_->Start();
}
@@ -125,13 +124,14 @@
}
-void DebuggerAgent::DebuggerMessage(const uint16_t* message, int length) {
+void DebuggerAgent::DebuggerMessage(const v8::Debug::Message& message) {
ScopedLock with(session_access_);
// Forward the message handling to the session.
if (session_ != NULL) {
- session_->DebuggerMessage(Vector<uint16_t>(const_cast<uint16_t*>(message),
- length));
+ v8::String::Value val(message.GetJSON());
+ session_->DebuggerMessage(Vector<uint16_t>(const_cast<uint16_t*>(*val),
+ val.length()));
}
}
diff --git a/src/debug-agent.h b/src/debug-agent.h
index 08f1372..a3c6025 100644
--- a/src/debug-agent.h
+++ b/src/debug-agent.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_V8_DEBUG_AGENT_H_
-#define V8_V8_DEBUG_AGENT_H_
+#ifndef V8_DEBUG_AGENT_H_
+#define V8_DEBUG_AGENT_H_
#ifdef ENABLE_DEBUGGER_SUPPORT
#include "../include/v8-debug.h"
@@ -60,7 +60,7 @@
private:
void Run();
void CreateSession(Socket* socket);
- void DebuggerMessage(const uint16_t* message, int length);
+ void DebuggerMessage(const v8::Debug::Message& message);
void CloseSession();
void OnSessionClosed(DebuggerAgentSession* session);
@@ -75,8 +75,7 @@
static DebuggerAgent* instance_;
friend class DebuggerAgentSession;
- friend void DebuggerAgentMessageHandler(const uint16_t* message, int length,
- v8::Debug::ClientData* client_data);
+ friend void DebuggerAgentMessageHandler(const v8::Debug::Message& message);
DISALLOW_COPY_AND_ASSIGN(DebuggerAgent);
};
@@ -123,4 +122,4 @@
#endif // ENABLE_DEBUGGER_SUPPORT
-#endif // V8_V8_DEBUG_AGENT_H_
+#endif // V8_DEBUG_AGENT_H_
diff --git a/src/debug-delay.js b/src/debug-delay.js
index 961f304..4a8663b 100644
--- a/src/debug-delay.js
+++ b/src/debug-delay.js
@@ -977,6 +977,7 @@
CompileEvent.prototype.toJSONProtocol = function() {
var o = new ProtocolMessage();
+ o.running = true;
if (this.before_) {
o.event = "beforeCompile";
} else {
diff --git a/src/debug.cc b/src/debug.cc
index 239a373..1688443 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -41,6 +41,8 @@
#include "stub-cache.h"
#include "log.h"
+#include "../include/v8-debug.h"
+
namespace v8 { namespace internal {
#ifdef ENABLE_DEBUGGER_SUPPORT
@@ -377,9 +379,7 @@
// is set the patching performed by the runtime system will take place in
// the code copy and will therefore have no effect on the running code
// keeping it from using the inlined code.
- if (code->is_keyed_load_stub() && KeyedLoadIC::HasInlinedVersion(pc())) {
- KeyedLoadIC::ClearInlinedVersion(pc());
- }
+ if (code->is_keyed_load_stub()) KeyedLoadIC::ClearInlinedVersion(pc());
}
}
@@ -1420,7 +1420,7 @@
bool Debugger::compiling_natives_ = false;
bool Debugger::is_loading_debugger_ = false;
bool Debugger::never_unload_debugger_ = false;
-v8::Debug::MessageHandler Debugger::message_handler_ = NULL;
+v8::Debug::MessageHandler2 Debugger::message_handler_ = NULL;
bool Debugger::message_handler_cleared_ = false;
v8::Debug::HostDispatchHandler Debugger::host_dispatch_handler_ = NULL;
int Debugger::host_dispatch_micros_ = 100 * 1000;
@@ -1554,8 +1554,8 @@
return;
}
- // Process debug event
- ProcessDebugEvent(v8::Exception, event_data, false);
+ // Process debug event.
+ ProcessDebugEvent(v8::Exception, Handle<JSObject>::cast(event_data), false);
// Return to continue execution from where the exception was thrown.
}
@@ -1586,8 +1586,10 @@
return;
}
- // Process debug event
- ProcessDebugEvent(v8::Break, event_data, auto_continue);
+ // Process debug event.
+ ProcessDebugEvent(v8::Break,
+ Handle<JSObject>::cast(event_data),
+ auto_continue);
}
@@ -1611,8 +1613,10 @@
return;
}
- // Process debug event
- ProcessDebugEvent(v8::BeforeCompile, event_data, false);
+ // Process debug event.
+ ProcessDebugEvent(v8::BeforeCompile,
+ Handle<JSObject>::cast(event_data),
+ true);
}
@@ -1672,8 +1676,10 @@
if (caught_exception) {
return;
}
- // Process debug event
- ProcessDebugEvent(v8::AfterCompile, event_data, false);
+ // Process debug event.
+ ProcessDebugEvent(v8::AfterCompile,
+ Handle<JSObject>::cast(event_data),
+ true);
}
@@ -1698,12 +1704,12 @@
return;
}
// Process debug event.
- ProcessDebugEvent(v8::NewFunction, event_data, false);
+ ProcessDebugEvent(v8::NewFunction, Handle<JSObject>::cast(event_data), true);
}
void Debugger::ProcessDebugEvent(v8::DebugEvent event,
- Handle<Object> event_data,
+ Handle<JSObject> event_data,
bool auto_continue) {
HandleScope scope;
@@ -1715,7 +1721,10 @@
}
// First notify the message handler if any.
if (message_handler_ != NULL) {
- NotifyMessageHandler(event, exec_state, event_data, auto_continue);
+ NotifyMessageHandler(event,
+ Handle<JSObject>::cast(exec_state),
+ event_data,
+ auto_continue);
}
// Notify registered debug event listener. This can be either a C or a
// JavaScript function.
@@ -1727,7 +1736,7 @@
FUNCTION_CAST<v8::Debug::EventCallback>(callback_obj->proxy());
callback(event,
v8::Utils::ToLocal(Handle<JSObject>::cast(exec_state)),
- v8::Utils::ToLocal(Handle<JSObject>::cast(event_data)),
+ v8::Utils::ToLocal(event_data),
v8::Utils::ToLocal(Handle<Object>::cast(event_listener_data_)));
} else {
// JavaScript debug event listener.
@@ -1738,7 +1747,7 @@
const int argc = 4;
Object** argv[argc] = { Handle<Object>(Smi::FromInt(event)).location(),
exec_state.location(),
- event_data.location(),
+ Handle<Object>::cast(event_data).location(),
event_listener_data_.location() };
Handle<Object> result = Execution::TryCall(fun, Top::global(),
argc, argv, &caught_exception);
@@ -1768,25 +1777,26 @@
void Debugger::NotifyMessageHandler(v8::DebugEvent event,
- Handle<Object> exec_state,
- Handle<Object> event_data,
+ Handle<JSObject> exec_state,
+ Handle<JSObject> event_data,
bool auto_continue) {
HandleScope scope;
if (!Debug::Load()) return;
// Process the individual events.
- bool interactive = false;
+ bool sendEventMessage = false;
switch (event) {
case v8::Break:
- interactive = true; // Break event is always interactive
+ sendEventMessage = !auto_continue;
break;
case v8::Exception:
- interactive = true; // Exception event is always interactive
+ sendEventMessage = true;
break;
case v8::BeforeCompile:
break;
case v8::AfterCompile:
+ sendEventMessage = true;
break;
case v8::NewFunction:
break;
@@ -1794,8 +1804,25 @@
UNREACHABLE();
}
- // Done if not interactive.
- if (!interactive) return;
+ // The debug command interrupt flag might have been set when the command was
+ // added. It should be enough to clear the flag only once while we are in the
+ // debugger.
+ ASSERT(Debug::InDebugger());
+ StackGuard::Continue(DEBUGCOMMAND);
+
+ // Notify the debugger that a debug event has occurred unless auto continue is
+ // active in which case no event is send.
+ if (sendEventMessage) {
+ MessageImpl message = MessageImpl::NewEvent(
+ event,
+ auto_continue,
+ Handle<JSObject>::cast(exec_state),
+ Handle<JSObject>::cast(event_data));
+ InvokeMessageHandler(message);
+ }
+ if (auto_continue && !HasCommands()) {
+ return;
+ }
// Get the DebugCommandProcessor.
v8::Local<v8::Object> api_exec_state =
@@ -1812,16 +1839,6 @@
return;
}
- // Notify the debugger that a debug event has occurred unless auto continue is
- // active in which case no event is send.
- if (!auto_continue) {
- bool success = InvokeMessageHandlerWithEvent(event_data);
- if (!success) {
- // If failed to notify debugger just continue running.
- return;
- }
- }
-
// Process requests from the debugger.
while (true) {
// Wait for new command in the queue.
@@ -1837,10 +1854,6 @@
command_received_->Wait();
}
- // The debug command interrupt flag might have been set when the command was
- // added.
- StackGuard::Continue(DEBUGCOMMAND);
-
// Get the command from the queue.
CommandMessage command = command_queue_.Get();
Logger::DebugTag("Got request from command queue, in interactive loop.");
@@ -1860,7 +1873,6 @@
request = v8::String::New(command.text().start(),
command.text().length());
- command.text().Dispose();
static const int kArgc = 1;
v8::Handle<Value> argv[kArgc] = { request };
v8::Local<v8::Value> response_val = fun->Call(cmd_processor, kArgc, argv);
@@ -1897,7 +1909,15 @@
}
// Return the result.
- InvokeMessageHandler(response, command.client_data());
+ MessageImpl message = MessageImpl::NewResponse(
+ event,
+ running,
+ Handle<JSObject>::cast(exec_state),
+ Handle<JSObject>::cast(event_data),
+ Handle<String>(Utils::OpenHandle(*response)),
+ command.client_data());
+ InvokeMessageHandler(message);
+ command.Dispose();
// Return from debug event processing if either the VM is put into the
// runnning state (through a continue command) or auto continue is active
@@ -1943,7 +1963,7 @@
}
-void Debugger::SetMessageHandler(v8::Debug::MessageHandler handler) {
+void Debugger::SetMessageHandler(v8::Debug::MessageHandler2 handler) {
ScopedLock with(debugger_access_);
message_handler_ = handler;
@@ -1968,54 +1988,13 @@
// Calls the registered debug message handler. This callback is part of the
-// public API. Messages are kept internally as Vector<uint16_t> strings, which
-// are allocated in various places and deallocated by the calling function
-// sometime after this call.
-void Debugger::InvokeMessageHandler(v8::Handle<v8::String> output,
- v8::Debug::ClientData* data) {
+// public API.
+void Debugger::InvokeMessageHandler(MessageImpl message) {
ScopedLock with(debugger_access_);
if (message_handler_ != NULL) {
- Vector<uint16_t> text = Vector<uint16_t>::New(output->Length());
- output->Write(text.start(), 0, output->Length());
-
- message_handler_(text.start(),
- text.length(),
- data);
-
- text.Dispose();
+ message_handler_(message);
}
- delete data;
-}
-
-
-bool Debugger::InvokeMessageHandlerWithEvent(Handle<Object> event_data) {
- v8::HandleScope scope;
- // Call toJSONProtocol on the debug event object.
- v8::Local<v8::Object> api_event_data =
- v8::Utils::ToLocal(Handle<JSObject>::cast(event_data));
- v8::Local<v8::String> fun_name = v8::String::New("toJSONProtocol");
- v8::Local<v8::Function> fun =
- v8::Function::Cast(*api_event_data->Get(fun_name));
- v8::TryCatch try_catch;
- v8::Local<v8::Value> json_event = *fun->Call(api_event_data, 0, NULL);
- v8::Local<v8::String> json_event_string;
- if (!try_catch.HasCaught()) {
- if (!json_event->IsUndefined()) {
- json_event_string = json_event->ToString();
- if (FLAG_trace_debug_json) {
- PrintLn(json_event_string);
- }
- InvokeMessageHandler(json_event_string,
- NULL /* no user data since there was no request */);
- } else {
- InvokeMessageHandler(v8::String::Empty(), NULL);
- }
- } else {
- PrintLn(try_catch.Exception());
- return false;
- }
- return true;
}
@@ -2101,6 +2080,107 @@
}
+MessageImpl MessageImpl::NewEvent(DebugEvent event,
+ bool running,
+ Handle<JSObject> exec_state,
+ Handle<JSObject> event_data) {
+ MessageImpl message(true, event, running,
+ exec_state, event_data, Handle<String>(), NULL);
+ return message;
+}
+
+
+MessageImpl MessageImpl::NewResponse(DebugEvent event,
+ bool running,
+ Handle<JSObject> exec_state,
+ Handle<JSObject> event_data,
+ Handle<String> response_json,
+ v8::Debug::ClientData* client_data) {
+ MessageImpl message(false, event, running,
+ exec_state, event_data, response_json, client_data);
+ return message;
+}
+
+
+MessageImpl::MessageImpl(bool is_event,
+ DebugEvent event,
+ bool running,
+ Handle<JSObject> exec_state,
+ Handle<JSObject> event_data,
+ Handle<String> response_json,
+ v8::Debug::ClientData* client_data)
+ : is_event_(is_event),
+ event_(event),
+ running_(running),
+ exec_state_(exec_state),
+ event_data_(event_data),
+ response_json_(response_json),
+ client_data_(client_data) {}
+
+
+bool MessageImpl::IsEvent() const {
+ return is_event_;
+}
+
+
+bool MessageImpl::IsResponse() const {
+ return !is_event_;
+}
+
+
+DebugEvent MessageImpl::GetEvent() const {
+ return event_;
+}
+
+
+bool MessageImpl::WillStartRunning() const {
+ return running_;
+}
+
+
+v8::Handle<v8::Object> MessageImpl::GetExecutionState() const {
+ return v8::Utils::ToLocal(exec_state_);
+}
+
+
+v8::Handle<v8::Object> MessageImpl::GetEventData() const {
+ return v8::Utils::ToLocal(event_data_);
+}
+
+
+v8::Handle<v8::String> MessageImpl::GetJSON() const {
+ v8::HandleScope scope;
+
+ if (IsEvent()) {
+ // Call toJSONProtocol on the debug event object.
+ Handle<Object> fun = GetProperty(event_data_, "toJSONProtocol");
+ if (!fun->IsJSFunction()) {
+ return v8::Handle<v8::String>();
+ }
+ bool caught_exception;
+ Handle<Object> json = Execution::TryCall(Handle<JSFunction>::cast(fun),
+ event_data_,
+ 0, NULL, &caught_exception);
+ if (caught_exception || !json->IsString()) {
+ return v8::Handle<v8::String>();
+ }
+ return scope.Close(v8::Utils::ToLocal(Handle<String>::cast(json)));
+ } else {
+ return v8::Utils::ToLocal(response_json_);
+ }
+}
+
+
+v8::Handle<v8::Context> MessageImpl::GetEventContext() const {
+ return v8::Handle<v8::Context>();
+}
+
+
+v8::Debug::ClientData* MessageImpl::GetClientData() const {
+ return client_data_;
+}
+
+
CommandMessage::CommandMessage() : text_(Vector<uint16_t>::empty()),
client_data_(NULL) {
}
diff --git a/src/debug.h b/src/debug.h
index 8a50cd2..cc76567 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_V8_DEBUG_H_
-#define V8_V8_DEBUG_H_
+#ifndef V8_DEBUG_H_
+#define V8_DEBUG_H_
#include "assembler.h"
#include "code-stubs.h"
@@ -401,6 +401,54 @@
};
+// Message delivered to the message handler callback. This is either a debugger
+// event or the response to a command.
+class MessageImpl: public v8::Debug::Message {
+ public:
+ // Create a message object for a debug event.
+ static MessageImpl NewEvent(DebugEvent event,
+ bool running,
+ Handle<JSObject> exec_state,
+ Handle<JSObject> event_data);
+
+ // Create a message object for the response to a debug command.
+ static MessageImpl NewResponse(DebugEvent event,
+ bool running,
+ Handle<JSObject> exec_state,
+ Handle<JSObject> event_data,
+ Handle<String> response_json,
+ v8::Debug::ClientData* client_data);
+
+ // Implementation of interface v8::Debug::Message.
+ virtual bool IsEvent() const;
+ virtual bool IsResponse() const;
+ virtual DebugEvent GetEvent() const;
+ virtual bool WillStartRunning() const;
+ virtual v8::Handle<v8::Object> GetExecutionState() const;
+ virtual v8::Handle<v8::Object> GetEventData() const;
+ virtual v8::Handle<v8::String> GetJSON() const;
+ virtual v8::Handle<v8::Context> GetEventContext() const;
+ virtual v8::Debug::ClientData* GetClientData() const;
+
+ private:
+ MessageImpl(bool is_event,
+ DebugEvent event,
+ bool running,
+ Handle<JSObject> exec_state,
+ Handle<JSObject> event_data,
+ Handle<String> response_json,
+ v8::Debug::ClientData* client_data);
+
+ bool is_event_; // Does this message represent a debug event?
+ DebugEvent event_; // Debug event causing the break.
+ bool running_; // Will the VM start running after this event?
+ Handle<JSObject> exec_state_; // Current execution state.
+ Handle<JSObject> event_data_; // Data associated with the event.
+ Handle<String> response_json_; // Response JSON if message holds a response.
+ v8::Debug::ClientData* client_data_; // Client data passed with the request.
+};
+
+
// Message send by user to v8 debugger or debugger output message.
// In addition to command text it may contain a pointer to some user data
// which are expected to be passed along with the command reponse to message
@@ -491,23 +539,19 @@
Handle<JSFunction> fun);
static void OnNewFunction(Handle<JSFunction> fun);
static void ProcessDebugEvent(v8::DebugEvent event,
- Handle<Object> event_data,
+ Handle<JSObject> event_data,
bool auto_continue);
static void NotifyMessageHandler(v8::DebugEvent event,
- Handle<Object> exec_state,
- Handle<Object> event_data,
+ Handle<JSObject> exec_state,
+ Handle<JSObject> event_data,
bool auto_continue);
static void SetEventListener(Handle<Object> callback, Handle<Object> data);
- static void SetMessageHandler(v8::Debug::MessageHandler handler);
+ static void SetMessageHandler(v8::Debug::MessageHandler2 handler);
static void SetHostDispatchHandler(v8::Debug::HostDispatchHandler handler,
int period);
// Invoke the message handler function.
- static void InvokeMessageHandler(v8::Handle<v8::String> output,
- v8::Debug::ClientData* data);
-
- // Send the JSON message for a debug event.
- static bool InvokeMessageHandlerWithEvent(Handle<Object> event_data);
+ static void InvokeMessageHandler(MessageImpl message);
// Add a debugger command to the command queue.
static void ProcessCommand(Vector<const uint16_t> command,
@@ -558,7 +602,7 @@
static bool compiling_natives_; // Are we compiling natives?
static bool is_loading_debugger_; // Are we loading the debugger?
static bool never_unload_debugger_; // Can we unload the debugger?
- static v8::Debug::MessageHandler message_handler_;
+ static v8::Debug::MessageHandler2 message_handler_;
static bool message_handler_cleared_; // Was message handler cleared?
static v8::Debug::HostDispatchHandler host_dispatch_handler_;
static int host_dispatch_micros_;
@@ -718,4 +762,4 @@
#endif // ENABLE_DEBUGGER_SUPPORT
-#endif // V8_V8_DEBUG_H_
+#endif // V8_DEBUG_H_
diff --git a/src/execution.cc b/src/execution.cc
index 8fa059a..eb39d64 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -32,9 +32,15 @@
#include "api.h"
#include "codegen-inl.h"
-#ifdef ARM
+#ifdef V8_ARCH_ARM
#include "arm/simulator-arm.h"
-#else // ia32
+#endif
+
+#ifdef V8_ARCH_X64
+#include "x64/simulator-x64.h"
+#endif
+
+#ifdef V8_ARCH_IA32
#include "ia32/simulator-ia32.h"
#endif
diff --git a/src/frames-inl.h b/src/frames-inl.h
index 481b83b..8244c67 100644
--- a/src/frames-inl.h
+++ b/src/frames-inl.h
@@ -29,9 +29,15 @@
#define V8_FRAMES_INL_H_
#include "frames.h"
-#ifdef ARM
+#ifdef V8_ARCH_ARM
#include "arm/frames-arm.h"
-#else
+#endif
+
+#ifdef V8_ARCH_X64
+#include "x64/frames-x64.h"
+#endif
+
+#ifdef V8_ARCH_IA32
#include "ia32/frames-ia32.h"
#endif
diff --git a/src/globals.h b/src/globals.h
index fbbe7c9..35208c4 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -28,25 +28,6 @@
#ifndef V8_GLOBALS_H_
#define V8_GLOBALS_H_
-// -----------------------------------------------------------------------------
-// Types
-// Visual Studio C++ is missing the stdint.h header file. Instead we define
-// standard integer types for Windows here.
-
-#ifdef _MSC_VER
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef short int16_t; // NOLINT
-typedef unsigned short uint16_t; // NOLINT
-typedef int int32_t;
-typedef unsigned int uint32_t;
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-#else // _MSC_VER
-#include <stdint.h> // for intptr_t
-#endif // _MSC_VER
-
-
namespace v8 { namespace internal {
// Support for alternative bool type. This is only enabled if the code is
@@ -69,11 +50,20 @@
typedef uint8_t byte;
typedef byte* Address;
+// Define macros for writing 64-bit constants and pointer-size constants.
+#ifdef _MSC_VER
+#define UINT64_C(x) (x ## UI64)
+#define INT64_C(x) (x ## I64)
+#else
+#define UINT64_C(x) (x ## ULL)
+#define INT64_C(x) (x ## LL)
+#endif
+
// Code-point values in Unicode 4.0 are 21 bits wide.
typedef uint16_t uc16;
-typedef signed int uc32;
+typedef int32_t uc32;
-#ifndef ARM
+#if defined(V8_ARCH_IA32) || defined(V8_ARCH_X64)
#define CAN_READ_UNALIGNED 1
#endif
@@ -86,35 +76,41 @@
const int kMaxInt = 0x7FFFFFFF;
const int kMinInt = -kMaxInt - 1;
+const uint32_t kMaxUInt32 = 0xFFFFFFFFu;
+
const int kCharSize = sizeof(char); // NOLINT
const int kShortSize = sizeof(short); // NOLINT
const int kIntSize = sizeof(int); // NOLINT
const int kDoubleSize = sizeof(double); // NOLINT
const int kPointerSize = sizeof(void*); // NOLINT
+#ifdef V8_ARCH_X64
+const int kPointerSizeLog2 = 3;
+#else
const int kPointerSizeLog2 = 2;
+#endif
-const int kObjectAlignmentBits = 2;
-const int kObjectAlignmentMask = (1 << kObjectAlignmentBits) - 1;
-const int kObjectAlignment = 1 << kObjectAlignmentBits;
+const int kObjectAlignmentBits = kPointerSizeLog2;
+const intptr_t kObjectAlignmentMask = (1 << kObjectAlignmentBits) - 1;
+const intptr_t kObjectAlignment = 1 << kObjectAlignmentBits;
// Tag information for HeapObject.
const int kHeapObjectTag = 1;
const int kHeapObjectTagSize = 2;
-const int kHeapObjectTagMask = (1 << kHeapObjectTagSize) - 1;
+const intptr_t kHeapObjectTagMask = (1 << kHeapObjectTagSize) - 1;
// Tag information for Smi.
const int kSmiTag = 0;
const int kSmiTagSize = 1;
-const int kSmiTagMask = (1 << kSmiTagSize) - 1;
+const intptr_t kSmiTagMask = (1 << kSmiTagSize) - 1;
// Tag information for Failure.
const int kFailureTag = 3;
const int kFailureTagSize = 2;
-const int kFailureTagMask = (1 << kFailureTagSize) - 1;
+const intptr_t kFailureTagMask = (1 << kFailureTagSize) - 1;
const int kBitsPerByte = 8;
@@ -123,11 +119,21 @@
const int kBitsPerInt = kIntSize * kBitsPerByte;
-// Zap-value: The value used for zapping dead objects. Should be a recognizable
-// illegal heap object pointer.
+// Zap-value: The value used for zapping dead objects.
+// Should be a recognizable hex value tagged as a heap object pointer.
+#ifdef V8_ARCH_X64
+const Address kZapValue =
+ reinterpret_cast<Address>(UINT64_C(0xdeadbeedbeadbeed));
+const Address kHandleZapValue =
+ reinterpret_cast<Address>(UINT64_C(0x1baddead0baddead));
+const Address kFromSpaceZapValue =
+ reinterpret_cast<Address>(UINT64_C(0x1beefdad0beefdad));
+#else
const Address kZapValue = reinterpret_cast<Address>(0xdeadbeed);
const Address kHandleZapValue = reinterpret_cast<Address>(0xbaddead);
const Address kFromSpaceZapValue = reinterpret_cast<Address>(0xbeefdad);
+#endif
+
// -----------------------------------------------------------------------------
// Forward declarations for frequently used classes
@@ -370,13 +376,13 @@
// Testers for test.
#define HAS_SMI_TAG(value) \
- ((reinterpret_cast<int>(value) & kSmiTagMask) == kSmiTag)
+ ((reinterpret_cast<intptr_t>(value) & kSmiTagMask) == kSmiTag)
#define HAS_FAILURE_TAG(value) \
- ((reinterpret_cast<int>(value) & kFailureTagMask) == kFailureTag)
+ ((reinterpret_cast<intptr_t>(value) & kFailureTagMask) == kFailureTag)
#define HAS_HEAP_OBJECT_TAG(value) \
- ((reinterpret_cast<int>(value) & kHeapObjectTagMask) == kHeapObjectTag)
+ ((reinterpret_cast<intptr_t>(value) & kHeapObjectTagMask) == kHeapObjectTag)
// OBJECT_SIZE_ALIGN returns the value aligned HeapObject size
#define OBJECT_SIZE_ALIGN(value) \
diff --git a/src/heap.cc b/src/heap.cc
index 0775a5d..fa225f7 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -1423,8 +1423,8 @@
int first_length = first->length();
int second_length = second->length();
int length = first_length + second_length;
- bool is_ascii = StringShape(first).IsAsciiRepresentation()
- && StringShape(second).IsAsciiRepresentation();
+ bool is_ascii = first->IsAsciiRepresentation()
+ && second->IsAsciiRepresentation();
// If the resulting string is small make a flat string.
if (length < String::kMinNonFlatLength) {
@@ -1484,15 +1484,15 @@
Map* map;
if (length <= String::kMaxShortStringSize) {
- map = StringShape(buffer).IsAsciiRepresentation() ?
+ map = buffer->IsAsciiRepresentation() ?
short_sliced_ascii_string_map() :
short_sliced_string_map();
} else if (length <= String::kMaxMediumStringSize) {
- map = StringShape(buffer).IsAsciiRepresentation() ?
+ map = buffer->IsAsciiRepresentation() ?
medium_sliced_ascii_string_map() :
medium_sliced_string_map();
} else {
- map = StringShape(buffer).IsAsciiRepresentation() ?
+ map = buffer->IsAsciiRepresentation() ?
long_sliced_ascii_string_map() :
long_sliced_string_map();
}
@@ -1524,7 +1524,7 @@
buffer->TryFlatten();
}
- Object* result = StringShape(buffer).IsAsciiRepresentation()
+ Object* result = buffer->IsAsciiRepresentation()
? AllocateRawAsciiString(length)
: AllocateRawTwoByteString(length);
if (result->IsFailure()) return result;
diff --git a/src/ia32/assembler-ia32-inl.h b/src/ia32/assembler-ia32-inl.h
index c5213a7..a3d24b2 100644
--- a/src/ia32/assembler-ia32-inl.h
+++ b/src/ia32/assembler-ia32-inl.h
@@ -34,8 +34,8 @@
// A light-weight IA32 Assembler.
-#ifndef V8_ASSEMBLER_IA32_INL_H_
-#define V8_ASSEMBLER_IA32_INL_H_
+#ifndef V8_IA32_ASSEMBLER_IA32_INL_H_
+#define V8_IA32_ASSEMBLER_IA32_INL_H_
#include "cpu.h"
@@ -299,4 +299,4 @@
} } // namespace v8::internal
-#endif // V8_ASSEMBLER_IA32_INL_H_
+#endif // V8_IA32_ASSEMBLER_IA32_INL_H_
diff --git a/src/ia32/assembler-ia32.h b/src/ia32/assembler-ia32.h
index a664093..4c99588 100644
--- a/src/ia32/assembler-ia32.h
+++ b/src/ia32/assembler-ia32.h
@@ -34,8 +34,8 @@
// A light-weight IA32 Assembler.
-#ifndef V8_ASSEMBLER_IA32_H_
-#define V8_ASSEMBLER_IA32_H_
+#ifndef V8_IA32_ASSEMBLER_IA32_H_
+#define V8_IA32_ASSEMBLER_IA32_H_
namespace v8 { namespace internal {
@@ -860,4 +860,4 @@
} } // namespace v8::internal
-#endif // V8_ASSEMBLER_IA32_H_
+#endif // V8_IA32_ASSEMBLER_IA32_H_
diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc
index 9baeb5e..5c7ba8e 100644
--- a/src/ia32/builtins-ia32.cc
+++ b/src/ia32/builtins-ia32.cc
@@ -54,6 +54,14 @@
// -- edi: constructor function
// -----------------------------------
+ Label non_function_call;
+ // Check that function is not a smi.
+ __ test(edi, Immediate(kSmiTagMask));
+ __ j(zero, &non_function_call);
+ // Check that function is a JSFunction.
+ __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx);
+ __ j(not_equal, &non_function_call);
+
// Enter a construct frame.
__ EnterConstructFrame();
@@ -75,12 +83,6 @@
__ cmp(Operand::StaticVariable(debug_step_in_fp), Immediate(0));
__ j(not_equal, &rt_call);
#endif
- // Check that function is not a Smi.
- __ test(edi, Immediate(kSmiTagMask));
- __ j(zero, &rt_call);
- // Check that function is a JSFunction
- __ CmpObjectType(edi, JS_FUNCTION_TYPE, eax);
- __ j(not_equal, &rt_call);
// Verified that the constructor is a JSFunction.
// Load the initial map and verify that it is in fact a map.
@@ -302,6 +304,16 @@
__ lea(esp, Operand(esp, ebx, times_2, 1 * kPointerSize)); // 1 ~ receiver
__ push(ecx);
__ ret(0);
+
+ // edi: called object
+ // eax: number of arguments
+ __ bind(&non_function_call);
+
+ // Set expected number of arguments to zero (not changing eax).
+ __ Set(ebx, Immediate(0));
+ __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION);
+ __ jmp(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
+ RelocInfo::CODE_TARGET);
}
diff --git a/src/ia32/codegen-ia32.cc b/src/ia32/codegen-ia32.cc
index 2d6fe83..8135e85 100644
--- a/src/ia32/codegen-ia32.cc
+++ b/src/ia32/codegen-ia32.cc
@@ -30,6 +30,7 @@
#include "bootstrapper.h"
#include "codegen-inl.h"
#include "debug.h"
+#include "ic-inl.h"
#include "parser.h"
#include "register-allocator-inl.h"
#include "runtime.h"
@@ -3410,7 +3411,10 @@
? RelocInfo::CODE_TARGET
: RelocInfo::CODE_TARGET_CONTEXT;
Result answer = frame_->CallLoadIC(mode);
-
+ // A test eax instruction following the call signals that the inobject
+ // property case was inlined. Ensure that there is not a test eax
+ // instruction here.
+ __ nop();
// Discard the global object. The result is in answer.
frame_->Drop();
return answer;
@@ -5233,6 +5237,48 @@
#endif
+class DeferredReferenceGetNamedValue: public DeferredCode {
+ public:
+ DeferredReferenceGetNamedValue(CodeGenerator* cgen, Handle<String> name)
+ : DeferredCode(cgen), name_(name) {
+ set_comment("[ DeferredReferenceGetNamedValue");
+ }
+
+ virtual void Generate();
+
+ Label* patch_site() { return &patch_site_; }
+
+ private:
+ Label patch_site_;
+ Handle<String> name_;
+};
+
+
+void DeferredReferenceGetNamedValue::Generate() {
+ CodeGenerator* cgen = generator();
+ Result receiver(cgen);
+ enter()->Bind(&receiver);
+
+ cgen->frame()->Push(&receiver);
+ cgen->frame()->Push(name_);
+ Result answer = cgen->frame()->CallLoadIC(RelocInfo::CODE_TARGET);
+ // The call must be followed by a test eax instruction to indicate
+ // that the inobject property case was inlined.
+ ASSERT(answer.is_register() && answer.reg().is(eax));
+ // Store the delta to the map check instruction here in the test instruction.
+ // Use masm_-> instead of the double underscore macro since the latter can't
+ // return a value.
+ int delta_to_patch_site = masm_->SizeOfCodeGeneratedSince(patch_site());
+ // Here we use masm_-> instead of the double underscore macro because
+ // this is the instruction that gets patched and coverage code gets in
+ // the way.
+ masm_->test(answer.reg(), Immediate(-delta_to_patch_site));
+ __ IncrementCounter(&Counters::named_load_inline_miss, 1);
+ receiver = cgen->frame()->Pop();
+ exit_.Jump(&receiver, &answer);
+}
+
+
class DeferredReferenceGetKeyedValue: public DeferredCode {
public:
DeferredReferenceGetKeyedValue(CodeGenerator* generator, bool is_global)
@@ -5334,16 +5380,66 @@
// thrown below, we must distinguish between the two kinds of
// loads (typeof expression loads must not throw a reference
// error).
- Comment cmnt(masm, "[ Load from named Property");
- cgen_->frame()->Push(GetName());
-
Variable* var = expression_->AsVariableProxy()->AsVariable();
- ASSERT(var == NULL || var->is_global());
- RelocInfo::Mode mode = (var == NULL)
- ? RelocInfo::CODE_TARGET
- : RelocInfo::CODE_TARGET_CONTEXT;
- Result answer = cgen_->frame()->CallLoadIC(mode);
- cgen_->frame()->Push(&answer);
+ bool is_global = var != NULL;
+ ASSERT(!is_global || var->is_global());
+
+ if (is_global || cgen_->scope()->is_global_scope()) {
+ // Do not inline the inobject property case for loads from the
+ // global object or loads in toplevel code.
+ Comment cmnt(masm, "[ Load from named Property");
+ cgen_->frame()->Push(GetName());
+
+ RelocInfo::Mode mode = is_global
+ ? RelocInfo::CODE_TARGET_CONTEXT
+ : RelocInfo::CODE_TARGET;
+ Result answer = cgen_->frame()->CallLoadIC(mode);
+ // A test eax instruction following the call signals that the
+ // inobject property case was inlined. Ensure that there is not
+ // a test eax instruction here.
+ __ nop();
+ cgen_->frame()->Push(&answer);
+ } else {
+ // Inline the inobject property case.
+ Comment cmnt(masm, "[ Inlined named property load");
+ DeferredReferenceGetNamedValue* deferred =
+ new DeferredReferenceGetNamedValue(cgen_, GetName());
+ Result receiver = cgen_->frame()->Pop();
+ receiver.ToRegister();
+ // Check that the receiver is a heap object.
+ __ test(receiver.reg(), Immediate(kSmiTagMask));
+ deferred->enter()->Branch(zero, &receiver, not_taken);
+
+ // Preallocate the value register to ensure that there is no
+ // spill emitted between the patch site label and the offset in
+ // the load instruction.
+ Result value = cgen_->allocator()->Allocate();
+ ASSERT(value.is_valid());
+ __ bind(deferred->patch_site());
+ // This is the map check instruction that will be patched (so we can't
+ // use the double underscore macro that may insert instructions).
+ // Initially use an invalid map to force a failure.
+ masm->cmp(FieldOperand(receiver.reg(), HeapObject::kMapOffset),
+ Immediate(Factory::null_value()));
+ // This branch is always a forwards branch so it's always a fixed
+ // size which allows the assert below to succeed and patching to work.
+ deferred->enter()->Branch(not_equal, &receiver, not_taken);
+
+ // The delta from the patch label to the load offset must be
+ // statically known.
+ ASSERT(masm->SizeOfCodeGeneratedSince(deferred->patch_site()) ==
+ LoadIC::kOffsetToLoadInstruction);
+ // The initial (invalid) offset has to be large enough to force
+ // a 32-bit instruction encoding to allow patching with an
+ // arbitrary offset. Use kMaxInt (minus kHeapObjectTag).
+ int offset = kMaxInt;
+ masm->mov(value.reg(), FieldOperand(receiver.reg(), offset));
+
+ __ IncrementCounter(&Counters::named_load_inline, 1);
+ deferred->BindExit(&receiver, &value);
+ cgen_->frame()->Push(&receiver);
+ cgen_->frame()->Push(&value);
+ }
break;
}
@@ -5806,10 +5902,10 @@
// Right operand must be in register cl because x86 likes it that way.
if (right->reg().is(ecx)) {
// Right is already in the right place. Left may be in the
- // same register, which causes problems. Use answer instead.
- if (left->reg().is(ecx)) {
- *left = answer;
- }
+ // same register, which causes problems. Always use answer
+ // instead of left, even if left is not ecx, since this avoids
+ // spilling left.
+ *left = answer;
} else if (left->reg().is(ecx)) {
generator()->frame()->Spill(left->reg());
__ mov(left->reg(), right->reg());
@@ -5823,6 +5919,9 @@
ASSERT(reg_ecx.is_valid());
__ mov(ecx, right->reg());
*right = reg_ecx;
+ // Answer and left both contain the left operand. Use answer, so
+ // left is not spilled.
+ *left = answer;
}
ASSERT(left->reg().is_valid());
ASSERT(!left->reg().is(ecx));
@@ -5872,16 +5971,10 @@
case Token::SHL: {
__ shl(left->reg());
// Check that the *signed* result fits in a smi.
- //
- // TODO(207): Can reduce registers from 4 to 3 by
- // preallocating ecx.
JumpTarget result_ok(generator());
- Result smi_test_reg = generator()->allocator()->Allocate();
- ASSERT(smi_test_reg.is_valid());
- __ lea(smi_test_reg.reg(), Operand(left->reg(), 0x40000000));
- __ test(smi_test_reg.reg(), Immediate(0x80000000));
- smi_test_reg.Unuse();
- result_ok.Branch(zero, left, taken);
+ __ cmp(left->reg(), 0xc0000000);
+ result_ok.Branch(positive, left, taken);
+
__ shr(left->reg());
ASSERT(kSmiTag == 0);
__ shl(left->reg(), kSmiTagSize);
@@ -6181,11 +6274,15 @@
case Token::SHR: __ shr(eax); break;
default: UNREACHABLE();
}
-
- // Check if result is non-negative and fits in a smi.
- __ test(eax, Immediate(0xc0000000));
- __ j(not_zero, &non_smi_result);
-
+ if (op_ == Token::SHR) {
+ // Check if result is non-negative and fits in a smi.
+ __ test(eax, Immediate(0xc0000000));
+ __ j(not_zero, &non_smi_result);
+ } else {
+ // Check if result fits in a smi.
+ __ cmp(eax, 0xc0000000);
+ __ j(negative, &non_smi_result);
+ }
// Tag smi result and return.
ASSERT(kSmiTagSize == times_2); // adjust code if not the case
__ lea(eax, Operand(eax, eax, times_1, kSmiTag));
diff --git a/src/ia32/codegen-ia32.h b/src/ia32/codegen-ia32.h
index a39bc58..caa293e 100644
--- a/src/ia32/codegen-ia32.h
+++ b/src/ia32/codegen-ia32.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_CODEGEN_IA32_H_
-#define V8_CODEGEN_IA32_H_
+#ifndef V8_IA32_CODEGEN_IA32_H_
+#define V8_IA32_CODEGEN_IA32_H_
namespace v8 { namespace internal {
@@ -615,4 +615,4 @@
} } // namespace v8::internal
-#endif // V8_CODEGEN_IA32_H_
+#endif // V8_IA32_CODEGEN_IA32_H_
diff --git a/src/ia32/frames-ia32.h b/src/ia32/frames-ia32.h
index 518b1ca..f86dbe4 100644
--- a/src/ia32/frames-ia32.h
+++ b/src/ia32/frames-ia32.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_FRAMES_IA32_H_
-#define V8_FRAMES_IA32_H_
+#ifndef V8_IA32_FRAMES_IA32_H_
+#define V8_IA32_FRAMES_IA32_H_
namespace v8 { namespace internal {
@@ -288,4 +288,4 @@
} } // namespace v8::internal
-#endif // V8_FRAMES_IA32_H_
+#endif // V8_IA32_FRAMES_IA32_H_
diff --git a/src/ia32/ic-ia32.cc b/src/ia32/ic-ia32.cc
index 559ac24..4231bfa 100644
--- a/src/ia32/ic-ia32.cc
+++ b/src/ia32/ic-ia32.cc
@@ -729,36 +729,66 @@
static const byte kTestEaxByte = 0xA9;
-bool KeyedLoadIC::HasInlinedVersion(Address address) {
- Address test_instruction_address = address + 4; // 4 = stub address
- return *test_instruction_address == kTestEaxByte;
+void LoadIC::ClearInlinedVersion(Address address) {
+ // Reset the map check of the inlined inobject property load (if
+ // present) to guarantee failure by holding an invalid map (the null
+ // value). The offset can be patched to anything.
+ PatchInlinedLoad(address, Heap::null_value(), kMaxInt);
}
void KeyedLoadIC::ClearInlinedVersion(Address address) {
// Insert null as the map to check for to make sure the map check fails
// sending control flow to the IC instead of the inlined version.
- PatchInlinedMapCheck(address, Heap::null_value());
+ PatchInlinedLoad(address, Heap::null_value());
}
-void KeyedLoadIC::PatchInlinedMapCheck(Address address, Object* value) {
+bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) {
+ // The address of the instruction following the call.
+ Address test_instruction_address = address + 4;
+ // If the instruction following the call is not a test eax, nothing
+ // was inlined.
+ if (*test_instruction_address != kTestEaxByte) return false;
+
+ Address delta_address = test_instruction_address + 1;
+ // The delta to the start of the map check instruction.
+ int delta = *reinterpret_cast<int*>(delta_address);
+
+ // The map address is the last 4 bytes of the 7-byte
+ // operand-immediate compare instruction, so we add 3 to get the
+ // offset to the last 4 bytes.
+ Address map_address = test_instruction_address + delta + 3;
+ *(reinterpret_cast<Object**>(map_address)) = map;
+
+ // The offset is in the last 4 bytes of a six byte
+ // memory-to-register move instruction, so we add 2 to get the
+ // offset to the last 4 bytes.
+ Address offset_address =
+ test_instruction_address + delta + kOffsetToLoadInstruction + 2;
+ *reinterpret_cast<int*>(offset_address) = offset - kHeapObjectTag;
+ return true;
+}
+
+
+bool KeyedLoadIC::PatchInlinedLoad(Address address, Object* map) {
Address test_instruction_address = address + 4; // 4 = stub address
// The keyed load has a fast inlined case if the IC call instruction
// is immediately followed by a test instruction.
- if (*test_instruction_address == kTestEaxByte) {
- // Fetch the offset from the test instruction to the map cmp
- // instruction. This offset is stored in the last 4 bytes of the
- // 5 byte test instruction.
- Address offset_address = test_instruction_address + 1;
- int offset_value = *(reinterpret_cast<int*>(offset_address));
- // Compute the map address. The map address is in the last 4
- // bytes of the 7-byte operand-immediate compare instruction, so
- // we add 3 to the offset to get the map address.
- Address map_address = test_instruction_address + offset_value + 3;
- // Patch the map check.
- (*(reinterpret_cast<Object**>(map_address))) = value;
- }
+ if (*test_instruction_address != kTestEaxByte) return false;
+
+ // Fetch the offset from the test instruction to the map cmp
+ // instruction. This offset is stored in the last 4 bytes of the 5
+ // byte test instruction.
+ Address delta_address = test_instruction_address + 1;
+ int delta = *reinterpret_cast<int*>(delta_address);
+ // Compute the map address. The map address is in the last 4 bytes
+ // of the 7-byte operand-immediate compare instruction, so we add 3
+ // to the offset to get the map address.
+ Address map_address = test_instruction_address + delta + 3;
+ // Patch the map check.
+ *(reinterpret_cast<Object**>(map_address)) = map;
+ return true;
}
diff --git a/src/ia32/jump-target-ia32.cc b/src/ia32/jump-target-ia32.cc
index a1049b2..6c7d6e3 100644
--- a/src/ia32/jump-target-ia32.cc
+++ b/src/ia32/jump-target-ia32.cc
@@ -115,11 +115,13 @@
__ bind(&original_fall_through);
} else {
- // Forward branch. A copy of the current frame is added to the end
- // of the list of frames reaching the target block and a branch to
- // the merge code is emitted.
+ // Forward branch. A copy of the current frame is added to the end of the
+ // list of frames reaching the target block and a branch to the merge code
+ // is emitted. Use masm_-> instead of __ as forward branches are expected
+ // to be a fixed size (no inserted coverage-checking instructions please).
+ // This is used in Reference::GetValue.
AddReachingFrame(new VirtualFrame(cgen_->frame()));
- __ j(cc, &merge_labels_.last(), hint);
+ masm_->j(cc, &merge_labels_.last(), hint);
is_linked_ = true;
}
}
diff --git a/src/ia32/macro-assembler-ia32.h b/src/ia32/macro-assembler-ia32.h
index ae3a853..cd7a233 100644
--- a/src/ia32/macro-assembler-ia32.h
+++ b/src/ia32/macro-assembler-ia32.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_MACRO_ASSEMBLER_IA32_H_
-#define V8_MACRO_ASSEMBLER_IA32_H_
+#ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_
+#define V8_IA32_MACRO_ASSEMBLER_IA32_H_
#include "assembler.h"
@@ -368,4 +368,4 @@
} } // namespace v8::internal
-#endif // V8_MACRO_ASSEMBLER_IA32_H_
+#endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_
diff --git a/src/ia32/regexp-macro-assembler-ia32.cc b/src/ia32/regexp-macro-assembler-ia32.cc
index 83dac54..2a0cefd 100644
--- a/src/ia32/regexp-macro-assembler-ia32.cc
+++ b/src/ia32/regexp-macro-assembler-ia32.cc
@@ -974,7 +974,7 @@
int start_offset = previous_index;
int end_offset = subject_ptr->length();
- bool is_ascii = StringShape(*subject).IsAsciiRepresentation();
+ bool is_ascii = subject->IsAsciiRepresentation();
if (StringShape(subject_ptr).IsCons()) {
subject_ptr = ConsString::cast(subject_ptr)->first();
@@ -985,7 +985,7 @@
subject_ptr = slice->buffer();
}
// Ensure that an underlying string has the same ascii-ness.
- ASSERT(StringShape(subject_ptr).IsAsciiRepresentation() == is_ascii);
+ ASSERT(subject_ptr->IsAsciiRepresentation() == is_ascii);
ASSERT(subject_ptr->IsExternalString() || subject_ptr->IsSeqString());
// String is now either Sequential or External
int char_size_shift = is_ascii ? 0 : 1;
@@ -1112,7 +1112,7 @@
ASSERT(subject->IsExternalString() || subject->IsSeqString());
ASSERT(start_index >= 0);
ASSERT(start_index <= subject->length());
- if (StringShape(subject).IsAsciiRepresentation()) {
+ if (subject->IsAsciiRepresentation()) {
const byte* address;
if (StringShape(subject).IsExternal()) {
const char* data = ExternalAsciiString::cast(subject)->resource()->data();
@@ -1152,7 +1152,7 @@
Handle<String> subject(frame_entry<String*>(re_frame, kInputString));
// Current string.
- bool is_ascii = StringShape(*subject).IsAsciiRepresentation();
+ bool is_ascii = subject->IsAsciiRepresentation();
ASSERT(re_code->instruction_start() <= *return_address);
ASSERT(*return_address <=
@@ -1171,7 +1171,7 @@
}
// String might have changed.
- if (StringShape(*subject).IsAsciiRepresentation() != is_ascii) {
+ if (subject->IsAsciiRepresentation() != is_ascii) {
// If we changed between an ASCII and an UC16 string, the specialized
// code cannot be used, and we need to restart regexp matching from
// scratch (including, potentially, compiling a new version of the code).
diff --git a/src/ia32/regexp-macro-assembler-ia32.h b/src/ia32/regexp-macro-assembler-ia32.h
index 0309f20..8c5dd24 100644
--- a/src/ia32/regexp-macro-assembler-ia32.h
+++ b/src/ia32/regexp-macro-assembler-ia32.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef REGEXP_MACRO_ASSEMBLER_IA32_H_
-#define REGEXP_MACRO_ASSEMBLER_IA32_H_
+#ifndef V8_IA32_REGEXP_MACRO_ASSEMBLER_IA32_H_
+#define V8_IA32_REGEXP_MACRO_ASSEMBLER_IA32_H_
namespace v8 { namespace internal {
@@ -282,4 +282,4 @@
}} // namespace v8::internal
-#endif /* REGEXP_MACRO_ASSEMBLER_IA32_H_ */
+#endif // V8_IA32_REGEXP_MACRO_ASSEMBLER_IA32_H_
diff --git a/src/ia32/simulator-ia32.h b/src/ia32/simulator-ia32.h
index 2267721..4d02c03 100644
--- a/src/ia32/simulator-ia32.h
+++ b/src/ia32/simulator-ia32.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_SIMULATOR_IA32_H_
-#define V8_SIMULATOR_IA32_H_
+#ifndef V8_IA32_SIMULATOR_IA32_H_
+#define V8_IA32_SIMULATOR_IA32_H_
// Since there is no simulator for the ia32 architecture the only thing we can
@@ -44,4 +44,4 @@
(reinterpret_cast<uintptr_t>(this) >= limit ? \
reinterpret_cast<uintptr_t>(this) - limit : 0)
-#endif // V8_SIMULATOR_IA32_H_
+#endif // V8_IA32_SIMULATOR_IA32_H_
diff --git a/src/ia32/virtual-frame-ia32.cc b/src/ia32/virtual-frame-ia32.cc
index 656ef21..619010b 100644
--- a/src/ia32/virtual-frame-ia32.cc
+++ b/src/ia32/virtual-frame-ia32.cc
@@ -310,64 +310,33 @@
// We have already done X-to-memory moves.
ASSERT(stack_pointer_ >= expected->stack_pointer_);
- // Perform register-to-register moves.
- int start = 0;
- int end = elements_.length() - 1;
- bool any_moves_blocked; // Did we fail to make some moves this iteration?
- bool should_break_cycles = false;
- bool any_moves_made; // Did we make any progress this iteration?
- do {
- any_moves_blocked = false;
- any_moves_made = false;
- int first_move_blocked = kIllegalIndex;
- int last_move_blocked = kIllegalIndex;
- for (int i = start; i <= end; i++) {
- FrameElement source = elements_[i];
- FrameElement target = expected->elements_[i];
- if (source.is_register() && target.is_register()) {
- if (target.reg().is(source.reg())) {
- if (target.is_synced() && !source.is_synced()) {
- __ mov(Operand(ebp, fp_relative(i)), source.reg());
- }
- elements_[i] = target;
- } else {
- // We need to move source to target.
- if (is_used(target.reg())) {
- // The move is blocked because the target contains valid data.
- // If we are stuck with only cycles remaining, then we spill source.
- // Otherwise, we just need more iterations.
- if (should_break_cycles) {
- SpillElementAt(i);
- should_break_cycles = false;
- } else { // Record a blocked move.
- if (!any_moves_blocked) {
- first_move_blocked = i;
- }
- last_move_blocked = i;
- any_moves_blocked = true;
- }
- } else {
- // The move is not blocked. This frame element can be moved from
- // its source register to its target register.
- if (target.is_synced() && !source.is_synced()) {
- SyncElementAt(i);
- }
- Use(target.reg(), i);
- Unuse(source.reg());
- elements_[i] = target;
- __ mov(target.reg(), source.reg());
- any_moves_made = true;
- }
- }
+ for (int i = 0; i < kNumRegisters; i++) {
+ // Move the right value into register i if it is currently in a register.
+ int index = expected->register_locations_[i];
+ int use_index = register_locations_[i];
+ // Fast check if register is unused in target or already correct
+ if (index != kIllegalIndex
+ && index != use_index
+ && elements_[index].is_register()) {
+ Register source = elements_[index].reg();
+ Register target = { i };
+ if (use_index == kIllegalIndex) { // Target is currently unused.
+ // Copy contents of source from source to target.
+ // Set frame element register to target.
+ elements_[index].set_reg(target);
+ Use(target, index);
+ Unuse(source);
+ __ mov(target, source);
+ } else {
+ // Exchange contents of registers source and target.
+ elements_[use_index].set_reg(source);
+ elements_[index].set_reg(target);
+ register_locations_[target.code()] = index;
+ register_locations_[source.code()] = use_index;
+ __ xchg(source, target);
}
}
- // Update control flags for next iteration.
- should_break_cycles = (any_moves_blocked && !any_moves_made);
- if (any_moves_blocked) {
- start = first_move_blocked;
- end = last_move_blocked;
- }
- } while (any_moves_blocked);
+ }
}
@@ -376,19 +345,22 @@
// final step and is done from the bottom up so that the backing
// elements of copies are in their correct locations when we
// encounter the copies.
- for (int i = 0; i < elements_.length(); i++) {
- FrameElement source = elements_[i];
- FrameElement target = expected->elements_[i];
- if (target.is_register() && !source.is_register()) {
+ for (int i = 0; i < kNumRegisters; i++) {
+ int index = expected->register_locations_[i];
+ if (index != kIllegalIndex) {
+ FrameElement source = elements_[index];
+ FrameElement target = expected->elements_[index];
switch (source.type()) {
case FrameElement::INVALID: // Fall through.
- case FrameElement::REGISTER:
UNREACHABLE();
break;
-
+ case FrameElement::REGISTER:
+ ASSERT(source.reg().is(target.reg()));
+ continue; // Go to next iteration. Skips Use(target.reg()) below.
+ break;
case FrameElement::MEMORY:
- ASSERT(i <= stack_pointer_);
- __ mov(target.reg(), Operand(ebp, fp_relative(i)));
+ ASSERT(index <= stack_pointer_);
+ __ mov(target.reg(), Operand(ebp, fp_relative(index)));
break;
case FrameElement::CONSTANT:
@@ -400,11 +372,25 @@
break;
case FrameElement::COPY: {
- FrameElement backing = elements_[source.index()];
+ int backing_index = source.index();
+ FrameElement backing = elements_[backing_index];
ASSERT(backing.is_memory() || backing.is_register());
if (backing.is_memory()) {
- ASSERT(source.index() <= stack_pointer_);
- __ mov(target.reg(), Operand(ebp, fp_relative(source.index())));
+ ASSERT(backing_index <= stack_pointer_);
+ // Code optimization if backing store should also move
+ // to a register: move backing store to its register first.
+ if (expected->elements_[backing_index].is_register()) {
+ FrameElement new_backing = expected->elements_[backing_index];
+ Register new_backing_reg = new_backing.reg();
+ ASSERT(!is_used(new_backing_reg));
+ elements_[backing_index] = new_backing;
+ Use(new_backing_reg, backing_index);
+ __ mov(new_backing_reg,
+ Operand(ebp, fp_relative(backing_index)));
+ __ mov(target.reg(), new_backing_reg);
+ } else {
+ __ mov(target.reg(), Operand(ebp, fp_relative(backing_index)));
+ }
} else {
__ mov(target.reg(), backing.reg());
}
@@ -412,11 +398,11 @@
}
// Ensure the proper sync state. If the source was memory no
// code needs to be emitted.
- if (target.is_synced() && !source.is_memory()) {
- SyncElementAt(i);
+ if (target.is_synced() && !source.is_synced()) {
+ __ mov(Operand(ebp, fp_relative(index)), target.reg());
}
- Use(target.reg(), i);
- elements_[i] = target;
+ Use(target.reg(), index);
+ elements_[index] = target;
}
}
}
diff --git a/src/ia32/virtual-frame-ia32.h b/src/ia32/virtual-frame-ia32.h
index 113ccc6..298eda2 100644
--- a/src/ia32/virtual-frame-ia32.h
+++ b/src/ia32/virtual-frame-ia32.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_VIRTUAL_FRAME_IA32_H_
-#define V8_VIRTUAL_FRAME_IA32_H_
+#ifndef V8_IA32_VIRTUAL_FRAME_IA32_H_
+#define V8_IA32_VIRTUAL_FRAME_IA32_H_
#include "register-allocator.h"
@@ -490,4 +490,4 @@
} } // namespace v8::internal
-#endif // V8_VIRTUAL_FRAME_IA32_H_
+#endif // V8_IA32_VIRTUAL_FRAME_IA32_H_
diff --git a/src/ic.cc b/src/ic.cc
index 51768d7..ccdf3ca 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -42,7 +42,7 @@
switch (state) {
case UNINITIALIZED: return '0';
case UNINITIALIZED_IN_LOOP: return 'L';
- case PREMONOMORPHIC: return '0';
+ case PREMONOMORPHIC: return 'P';
case MONOMORPHIC: return '1';
case MONOMORPHIC_PROTOTYPE_FAILURE: return '^';
case MEGAMORPHIC: return 'N';
@@ -244,6 +244,7 @@
void LoadIC::Clear(Address address, Code* target) {
if (target->ic_state() == UNINITIALIZED) return;
+ ClearInlinedVersion(address);
SetTargetAtAddress(address, initialize_stub());
}
@@ -523,6 +524,31 @@
LOG(SuspectReadEvent(*name, *object));
}
+ bool can_be_inlined =
+ FLAG_use_ic &&
+ state == PREMONOMORPHIC &&
+ lookup.IsValid() &&
+ lookup.IsLoaded() &&
+ lookup.IsCacheable() &&
+ lookup.holder() == *object &&
+ lookup.type() == FIELD &&
+ !object->IsAccessCheckNeeded();
+
+ if (can_be_inlined) {
+ Map* map = lookup.holder()->map();
+ // Property's index in the properties array. If negative we have
+ // an inobject property.
+ int index = lookup.GetFieldIndex() - map->inobject_properties();
+ if (index < 0) {
+ // Index is an offset from the end of the object.
+ int offset = map->instance_size() + (index * kPointerSize);
+ if (PatchInlinedLoad(address(), map, offset)) {
+ set_target(megamorphic_stub());
+ return lookup.holder()->FastPropertyAt(lookup.GetFieldIndex());
+ }
+ }
+ }
+
// Update inline cache and stub cache.
if (FLAG_use_ic && lookup.IsLoaded()) {
UpdateCaches(&lookup, state, object, name);
@@ -734,7 +760,7 @@
!object->IsJSValue() &&
!JSObject::cast(*object)->HasIndexedInterceptor()) {
Map* map = JSObject::cast(*object)->map();
- PatchInlinedMapCheck(address(), map);
+ PatchInlinedLoad(address(), map);
}
}
diff --git a/src/ic.h b/src/ic.h
index 11d47ae..11fd604 100644
--- a/src/ic.h
+++ b/src/ic.h
@@ -216,6 +216,11 @@
static void GenerateStringLength(MacroAssembler* masm);
static void GenerateFunctionPrototype(MacroAssembler* masm);
+ // The offset from the inlined patch site to the start of the
+ // inlined load instruction. It is 7 bytes (test eax, imm) plus
+ // 6 bytes (jne slow_label).
+ static const int kOffsetToLoadInstruction = 13;
+
private:
static void Generate(MacroAssembler* masm, const ExternalReference& f);
@@ -238,6 +243,12 @@
}
static void Clear(Address address, Code* target);
+
+ // Clear the use of the inlined version.
+ static void ClearInlinedVersion(Address address);
+
+ static bool PatchInlinedLoad(Address address, Object* map, int index);
+
friend class IC;
};
@@ -254,9 +265,6 @@
static void GeneratePreMonomorphic(MacroAssembler* masm);
static void GenerateGeneric(MacroAssembler* masm);
- // Check if this IC corresponds to an inlined version.
- static bool HasInlinedVersion(Address address);
-
// Clear the use of the inlined version.
static void ClearInlinedVersion(Address address);
@@ -287,7 +295,7 @@
// Support for patching the map that is checked in an inlined
// version of keyed load.
- static void PatchInlinedMapCheck(Address address, Object* map);
+ static bool PatchInlinedLoad(Address address, Object* map);
friend class IC;
};
diff --git a/src/interpreter-irregexp.cc b/src/interpreter-irregexp.cc
index 1cc5c5a..70680a8 100644
--- a/src/interpreter-irregexp.cc
+++ b/src/interpreter-irregexp.cc
@@ -574,7 +574,7 @@
AssertNoAllocation a;
const byte* code_base = code_array->GetDataStartAddress();
uc16 previous_char = '\n';
- if (StringShape(*subject).IsAsciiRepresentation()) {
+ if (subject->IsAsciiRepresentation()) {
Vector<const char> subject_vector = subject->ToAsciiVector();
if (start_position != 0) previous_char = subject_vector[start_position - 1];
return RawMatch(code_base,
diff --git a/src/jsregexp.cc b/src/jsregexp.cc
index 89d11eb..1757f52 100644
--- a/src/jsregexp.cc
+++ b/src/jsregexp.cc
@@ -42,9 +42,16 @@
#include "regexp-macro-assembler-irregexp.h"
#include "regexp-stack.h"
-#ifdef ARM
+#ifdef V8_ARCH_ARM
#include "arm/regexp-macro-assembler-arm.h"
-#else // IA32
+#endif
+
+#ifdef V8_ARCH_X64
+#include "x64/macro-assembler-x64.h"
+#include "x64/regexp-macro-assembler-x64.h"
+#endif
+
+#ifdef V8_ARCH_IA32
#include "ia32/macro-assembler-ia32.h"
#include "ia32/regexp-macro-assembler-ia32.h"
#endif
@@ -424,12 +431,16 @@
Handle<String> original_subject = subject;
Handle<FixedArray> regexp(FixedArray::cast(jsregexp->data()));
if (UseNativeRegexp()) {
-#ifdef ARM
+#ifdef V8_ARCH_ARM
UNREACHABLE();
-#else
+#endif
+#ifdef V8_ARCH_X64
+ UNIMPLEMENTED();
+#endif
+#ifdef V8_ARCH_IA32
RegExpMacroAssemblerIA32::Result res;
do {
- bool is_ascii = StringShape(*subject).IsAsciiRepresentation();
+ bool is_ascii = subject->IsAsciiRepresentation();
if (!EnsureCompiledIrregexp(jsregexp, is_ascii)) {
return Handle<Object>::null();
}
@@ -452,7 +463,7 @@
rc = (res == RegExpMacroAssemblerIA32::SUCCESS);
#endif
} else {
- bool is_ascii = StringShape(*subject).IsAsciiRepresentation();
+ bool is_ascii = subject->IsAsciiRepresentation();
if (!EnsureCompiledIrregexp(jsregexp, is_ascii)) {
return Handle<Object>::null();
}
@@ -4434,9 +4445,13 @@
NodeInfo info = *node->info();
if (RegExpImpl::UseNativeRegexp()) {
-#ifdef ARM
+#ifdef V8_ARCH_ARM
UNREACHABLE();
-#else // IA32
+#endif
+#ifdef V8_ARCH_X64
+ UNREACHABLE();
+#endif
+#ifdef V8_ARCH_IA32
RegExpMacroAssemblerIA32::Mode mode;
if (is_ascii) {
mode = RegExpMacroAssemblerIA32::ASCII;
diff --git a/src/jsregexp.h b/src/jsregexp.h
index e824974..c0d50a3 100644
--- a/src/jsregexp.h
+++ b/src/jsregexp.h
@@ -37,9 +37,13 @@
class RegExpImpl {
public:
static inline bool UseNativeRegexp() {
-#ifdef ARM
+#ifdef V8_ARCH_ARM
return false;
-#else
+#endif
+#ifdef V8_ARCH_X64
+ return false;
+#endif
+#ifdef V8_ARCH_IA32
return FLAG_regexp_native;
#endif
}
@@ -1003,14 +1007,14 @@
virtual bool try_to_emit_quick_check_for_alternative(int i) { return true; }
protected:
- int GreedyLoopTextLength(GuardedAlternative *alternative);
+ int GreedyLoopTextLength(GuardedAlternative* alternative);
ZoneList<GuardedAlternative>* alternatives_;
private:
friend class DispatchTableConstructor;
friend class Analysis;
void GenerateGuard(RegExpMacroAssembler* macro_assembler,
- Guard *guard,
+ Guard* guard,
Trace* trace);
int CalculatePreloadCharacters(RegExpCompiler* compiler);
void EmitOutOfLineContinuation(RegExpCompiler* compiler,
@@ -1288,7 +1292,7 @@
void set_choice_index(int value) { choice_index_ = value; }
protected:
- DispatchTable *table_;
+ DispatchTable* table_;
int choice_index_;
bool ignore_case_;
};
diff --git a/src/list-inl.h b/src/list-inl.h
index 6dbd214..e3d251f 100644
--- a/src/list-inl.h
+++ b/src/list-inl.h
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2006-2009 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:
@@ -38,21 +38,36 @@
if (length_ < capacity_) {
data_[length_++] = element;
} else {
- // Grow the list capacity by 50%, but make sure to let it grow
- // even when the capacity is zero (possible initial case).
- int new_capacity = 1 + capacity_ + (capacity_ >> 1);
- T* new_data = NewData(new_capacity);
- memcpy(new_data, data_, capacity_ * sizeof(T));
- // Since the element reference could be an element of the list,
- // assign it to the new backing store before deleting the old.
- new_data[length_++] = element;
- DeleteData(data_);
- data_ = new_data;
- capacity_ = new_capacity;
+ List<T, P>::ResizeAdd(element);
}
}
+// Use two layers of inlining so that the non-inlined function can
+// use the same implementation as the inlined version.
+template<typename T, class P>
+void List<T, P>::ResizeAdd(const T& element) {
+ ResizeAddInternal(element);
+}
+
+
+template<typename T, class P>
+void List<T, P>::ResizeAddInternal(const T& element) {
+ ASSERT(length_ >= capacity_);
+ // Grow the list capacity by 50%, but make sure to let it grow
+ // even when the capacity is zero (possible initial case).
+ int new_capacity = 1 + capacity_ + (capacity_ >> 1);
+ T* new_data = List<T, P>::NewData(new_capacity);
+ memcpy(new_data, data_, capacity_ * sizeof(T));
+ // Since the element reference could be an element of the list,
+ // assign it to the new backing store before deleting the old.
+ new_data[length_++] = element;
+ List<T, P>::DeleteData(data_);
+ data_ = new_data;
+ capacity_ = new_capacity;
+}
+
+
template<typename T, class P>
Vector<T> List<T, P>::AddBlock(T value, int count) {
int start = length_;
diff --git a/src/list.h b/src/list.h
index dc2f115..92d23ea 100644
--- a/src/list.h
+++ b/src/list.h
@@ -118,9 +118,24 @@
INLINE(T* NewData(int n)) { return static_cast<T*>(P::New(n * sizeof(T))); }
INLINE(void DeleteData(T* data)) { P::Delete(data); }
+ // Increase the capacity of a full list, and add an element.
+ // List must be full already.
+ void ResizeAdd(const T& element);
+
+ // Inlined implementation of ResizeAdd, shared by inlined and
+ // non-inlined versions of ResizeAdd.
+ void ResizeAddInternal(const T& element);
+
DISALLOW_COPY_AND_ASSIGN(List);
};
+class FrameElement;
+
+// Add() is inlined, ResizeAdd() called by Add() is inlined except for
+// Lists of FrameElements, and ResizeAddInternal() is inlined in ResizeAdd().
+template <>
+void List<FrameElement,
+ FreeStoreAllocationPolicy>::ResizeAdd(const FrameElement& element);
} } // namespace v8::internal
diff --git a/src/log.cc b/src/log.cc
index f23b73b..4d4dfa7 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -366,7 +366,7 @@
if (len > 0x1000)
len = 0x1000;
if (show_impl_info) {
- Append(StringShape(str).IsAsciiRepresentation() ? 'a' : '2');
+ Append(str->IsAsciiRepresentation() ? 'a' : '2');
if (StringShape(str).IsExternal())
Append('e');
if (StringShape(str).IsSymbol())
diff --git a/src/macro-assembler.h b/src/macro-assembler.h
index d21f479..2d93dac 100644
--- a/src/macro-assembler.h
+++ b/src/macro-assembler.h
@@ -28,23 +28,29 @@
#ifndef V8_MACRO_ASSEMBLER_H_
#define V8_MACRO_ASSEMBLER_H_
-#ifdef ARM
-
+#ifdef V8_ARCH_ARM
#include "arm/constants-arm.h"
#include "assembler.h"
#include "arm/assembler-arm.h"
#include "arm/assembler-arm-inl.h"
#include "code.h" // must be after assembler_*.h
#include "arm/macro-assembler-arm.h"
+#endif
-#else // ia32
+#ifdef V8_ARCH_X64
+#include "assembler.h"
+#include "x64/assembler-x64.h"
+#include "x64/assembler-x64-inl.h"
+#include "code.h" // must be after assembler_*.h
+#include "x64/macro-assembler-x64.h"
+#endif
+#ifdef V8_ARCH_IA32
#include "assembler.h"
#include "ia32/assembler-ia32.h"
#include "ia32/assembler-ia32-inl.h"
#include "code.h" // must be after assembler_*.h
#include "ia32/macro-assembler-ia32.h"
-
#endif
#endif // V8_MACRO_ASSEMBLER_H_
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index c55345d..94cf315 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -562,18 +562,57 @@
}
-void MarkCompactCollector::ProcessRoots(RootMarkingVisitor* visitor) {
- // Mark the heap roots gray, including global variables, stack variables,
- // etc.
+class SymbolMarkingVisitor : public ObjectVisitor {
+ public:
+ void VisitPointers(Object** start, Object** end) {
+ MarkingVisitor marker;
+ for (Object** p = start; p < end; p++) {
+ if (!(*p)->IsHeapObject()) continue;
+
+ HeapObject* object = HeapObject::cast(*p);
+ // If the object is marked, we have marked or are in the process
+ // of marking subparts.
+ if (object->IsMarked()) continue;
+
+ // The object is unmarked, we do not need to unmark to use its
+ // map.
+ Map* map = object->map();
+ object->IterateBody(map->instance_type(),
+ object->SizeFromMap(map),
+ &marker);
+ }
+ }
+};
+
+
+void MarkCompactCollector::MarkSymbolTable() {
+ // Objects reachable from symbols are marked as live so as to ensure
+ // that if the symbol itself remains alive after GC for any reason,
+ // and if it is a sliced string or a cons string backed by an
+ // external string (even indirectly), then the external string does
+ // not receive a weak reference callback.
+ SymbolTable* symbol_table = SymbolTable::cast(Heap::symbol_table());
+ // Mark the symbol table itself.
+ SetMark(symbol_table);
+ // Explicitly mark the prefix.
+ MarkingVisitor marker;
+ symbol_table->IteratePrefix(&marker);
+ ProcessMarkingStack(&marker);
+ // Mark subparts of the symbols but not the symbols themselves
+ // (unless reachable from another symbol).
+ SymbolMarkingVisitor symbol_marker;
+ symbol_table->IterateElements(&symbol_marker);
+ ProcessMarkingStack(&marker);
+}
+
+
+void MarkCompactCollector::MarkRoots(RootMarkingVisitor* visitor) {
+ // Mark the heap roots including global variables, stack variables,
+ // etc., and all objects reachable from them.
Heap::IterateStrongRoots(visitor);
- // Take care of the symbol table specially.
- SymbolTable* symbol_table = SymbolTable::cast(Heap::symbol_table());
- // 1. Mark the prefix of the symbol table gray.
- symbol_table->IteratePrefix(visitor);
- // 2. Mark the symbol table black (ie, do not push it on the marking stack
- // or mark it overflowed).
- SetMark(symbol_table);
+ // Handle the symbol table specially.
+ MarkSymbolTable();
// There may be overflowed objects in the heap. Visit them now.
while (marking_stack.overflowed()) {
@@ -715,7 +754,7 @@
ASSERT(!marking_stack.overflowed());
RootMarkingVisitor root_visitor;
- ProcessRoots(&root_visitor);
+ MarkRoots(&root_visitor);
// The objects reachable from the roots are marked black, unreachable
// objects are white. Mark objects reachable from object groups with at
@@ -762,21 +801,22 @@
#ifdef DEBUG
-void MarkCompactCollector::UpdateLiveObjectCount(HeapObject* obj) {
- live_bytes_ += obj->Size();
+void MarkCompactCollector::UpdateLiveObjectCount(HeapObject* obj, int scale) {
+ ASSERT(scale == -1 || scale == 1);
+ live_bytes_ += obj->Size() * scale;
if (Heap::new_space()->Contains(obj)) {
- live_young_objects_++;
+ live_young_objects_ += scale;
} else if (Heap::map_space()->Contains(obj)) {
ASSERT(obj->IsMap());
- live_map_objects_++;
+ live_map_objects_ += scale;
} else if (Heap::old_pointer_space()->Contains(obj)) {
- live_old_pointer_objects_++;
+ live_old_pointer_objects_ += scale;
} else if (Heap::old_data_space()->Contains(obj)) {
- live_old_data_objects_++;
+ live_old_data_objects_ += scale;
} else if (Heap::code_space()->Contains(obj)) {
- live_code_objects_++;
+ live_code_objects_ += scale;
} else if (Heap::lo_space()->Contains(obj)) {
- live_lo_objects_++;
+ live_lo_objects_ +=scale;
} else {
UNREACHABLE();
}
diff --git a/src/mark-compact.h b/src/mark-compact.h
index 9a92ade..432b8cc 100644
--- a/src/mark-compact.h
+++ b/src/mark-compact.h
@@ -142,6 +142,7 @@
friend class RootMarkingVisitor;
friend class MarkingVisitor;
+ friend class UnmarkingVisitor;
// Marking operations for objects reachable from roots.
static void MarkLiveObjects();
@@ -155,7 +156,7 @@
static inline void SetMark(HeapObject* obj) {
tracer_->increment_marked_count();
#ifdef DEBUG
- UpdateLiveObjectCount(obj);
+ UpdateLiveObjectCount(obj, 1);
#endif
obj->SetMark();
}
@@ -172,7 +173,11 @@
static void MarkDescriptorArray(DescriptorArray* descriptors);
// Mark the heap roots and all objects reachable from them.
- static void ProcessRoots(RootMarkingVisitor* visitor);
+ static void MarkRoots(RootMarkingVisitor* visitor);
+
+ // Mark the symbol table specially. References to symbols from the
+ // symbol table are weak.
+ static void MarkSymbolTable();
// Mark objects in object groups that have at least one object in the
// group marked.
@@ -202,7 +207,10 @@
static bool MustBeMarked(Object** p);
#ifdef DEBUG
- static void UpdateLiveObjectCount(HeapObject* obj);
+ // The scale argument is positive 1 if we are marking an object and
+ // -1 if we are clearing the mark bit of an object that we didn't
+ // actually want marked.
+ static void UpdateLiveObjectCount(HeapObject* obj, int scale);
#endif
// We sweep the large object space in the same way whether we are
diff --git a/src/objects-inl.h b/src/objects-inl.h
index ff64d65..58e4f7c 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -144,14 +144,14 @@
bool Object::IsSeqAsciiString() {
if (!IsString()) return false;
return StringShape(String::cast(this)).IsSequential() &&
- StringShape(String::cast(this)).IsAsciiRepresentation();
+ String::cast(this)->IsAsciiRepresentation();
}
bool Object::IsSeqTwoByteString() {
if (!IsString()) return false;
return StringShape(String::cast(this)).IsSequential() &&
- StringShape(String::cast(this)).IsTwoByteRepresentation();
+ String::cast(this)->IsTwoByteRepresentation();
}
@@ -164,14 +164,14 @@
bool Object::IsExternalAsciiString() {
if (!IsString()) return false;
return StringShape(String::cast(this)).IsExternal() &&
- StringShape(String::cast(this)).IsAsciiRepresentation();
+ String::cast(this)->IsAsciiRepresentation();
}
bool Object::IsExternalTwoByteString() {
if (!IsString()) return false;
return StringShape(String::cast(this)).IsExternal() &&
- StringShape(String::cast(this)).IsTwoByteRepresentation();
+ String::cast(this)->IsTwoByteRepresentation();
}
@@ -211,13 +211,28 @@
}
-bool StringShape::IsAsciiRepresentation() {
- return (type_ & kStringEncodingMask) == kAsciiStringTag;
+bool String::IsAsciiRepresentation() {
+ uint32_t type = map()->instance_type();
+ if ((type & kStringRepresentationMask) == kSlicedStringTag) {
+ return SlicedString::cast(this)->buffer()->IsAsciiRepresentation();
+ }
+ if ((type & kStringRepresentationMask) == kConsStringTag &&
+ ConsString::cast(this)->second()->length() == 0) {
+ return ConsString::cast(this)->first()->IsAsciiRepresentation();
+ }
+ return (type & kStringEncodingMask) == kAsciiStringTag;
}
-bool StringShape::IsTwoByteRepresentation() {
- return (type_ & kStringEncodingMask) == kTwoByteStringTag;
+bool String::IsTwoByteRepresentation() {
+ uint32_t type = map()->instance_type();
+ if ((type & kStringRepresentationMask) == kSlicedStringTag) {
+ return SlicedString::cast(this)->buffer()->IsTwoByteRepresentation();
+ } else if ((type & kStringRepresentationMask) == kConsStringTag &&
+ ConsString::cast(this)->second()->length() == 0) {
+ return ConsString::cast(this)->first()->IsTwoByteRepresentation();
+ }
+ return (type & kStringEncodingMask) == kTwoByteStringTag;
}
@@ -668,7 +683,7 @@
int Smi::value() {
- return reinterpret_cast<int>(this) >> kSmiTagSize;
+ return static_cast<int>(reinterpret_cast<intptr_t>(this) >> kSmiTagSize);
}
@@ -724,7 +739,7 @@
int Failure::value() const {
- return reinterpret_cast<int>(this) >> kFailureTagSize;
+ return static_cast<int>(reinterpret_cast<intptr_t>(this) >> kFailureTagSize);
}
@@ -742,7 +757,8 @@
Failure* Failure::Construct(Type type, int value) {
int info = (value << kFailureTypeTagSize) | type;
ASSERT(Smi::IsValid(info)); // Same validation check as in Smi
- return reinterpret_cast<Failure*>((info << kFailureTagSize) | kFailureTag);
+ return reinterpret_cast<Failure*>(
+ static_cast<intptr_t>((info << kFailureTagSize) | kFailureTag));
}
@@ -1476,7 +1492,7 @@
ASSERT(index >= 0 && index < length());
ASSERT(StringShape(this).IsSequential());
- return StringShape(this).IsAsciiRepresentation()
+ return this->IsAsciiRepresentation()
? SeqAsciiString::cast(this)->SeqAsciiStringSet(index, value)
: SeqTwoByteString::cast(this)->SeqTwoByteStringSet(index, value);
}
@@ -1576,11 +1592,6 @@
String* ConsString::first() {
- ASSERT(String::cast(READ_FIELD(this, kSecondOffset))->length() != 0 ||
- StringShape(
- String::cast(
- READ_FIELD(this, kFirstOffset))).IsAsciiRepresentation()
- == StringShape(this).IsAsciiRepresentation());
return String::cast(READ_FIELD(this, kFirstOffset));
}
@@ -1613,10 +1624,6 @@
String* SlicedString::buffer() {
- ASSERT(
- StringShape(
- String::cast(READ_FIELD(this, kBufferOffset))).IsAsciiRepresentation()
- == StringShape(this).IsAsciiRepresentation());
return String::cast(READ_FIELD(this, kBufferOffset));
}
diff --git a/src/objects.cc b/src/objects.cc
index 55fc971..80977c1 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -602,8 +602,6 @@
if (StringShape(String::cast(ok)).IsCons()) {
ss->set_buffer(ConsString::cast(ok)->first());
}
- ASSERT(StringShape(this).IsAsciiRepresentation() ==
- StringShape(ss->buffer()).IsAsciiRepresentation());
return this;
}
case kConsStringTag: {
@@ -618,7 +616,7 @@
int len = length();
Object* object;
String* result;
- if (StringShape(this).IsAsciiRepresentation()) {
+ if (IsAsciiRepresentation()) {
object = Heap::AllocateRawAsciiString(len, tenure);
if (object->IsFailure()) return object;
result = String::cast(object);
@@ -956,10 +954,11 @@
// Avoid calling functions such as FixedArray::cast during GC, which
// read map pointer of this object again.
InstanceType instance_type = map->instance_type();
+ uint32_t type = static_cast<uint32_t>(instance_type);
if (instance_type < FIRST_NONSTRING_TYPE
&& (StringShape(instance_type).IsSequential())) {
- if (StringShape(instance_type).IsAsciiRepresentation()) {
+ if ((type & kStringEncodingMask) == kAsciiStringTag) {
SeqAsciiString* seq_ascii_this = reinterpret_cast<SeqAsciiString*>(this);
return seq_ascii_this->SeqAsciiStringSize(instance_type);
} else {
@@ -2850,22 +2849,26 @@
Object* FixedArray::AddKeysFromJSArray(JSArray* array) {
- // Remove array holes from array if any.
- Object* object = array->RemoveHoles();
- if (object->IsFailure()) return object;
- JSArray* compacted_array = JSArray::cast(object);
+ if (array->HasFastElements()) {
+ return UnionOfKeys(array->elements());
+ }
+ ASSERT(!array->HasFastElements());
+ Dictionary* dict = array->element_dictionary();
+ int size = dict->NumberOfElements();
// Allocate a temporary fixed array.
- int compacted_array_length = Smi::cast(compacted_array->length())->value();
- object = Heap::AllocateFixedArray(compacted_array_length);
+ Object* object = Heap::AllocateFixedArray(size);
if (object->IsFailure()) return object;
FixedArray* key_array = FixedArray::cast(object);
+ int capacity = dict->Capacity();
+ int pos = 0;
// Copy the elements from the JSArray to the temporary fixed array.
- for (int i = 0; i < compacted_array_length; i++) {
- key_array->set(i, compacted_array->GetElement(i));
+ for (int i = 0; i < capacity; i++) {
+ if (dict->IsKey(dict->KeyAt(i))) {
+ key_array->set(pos++, dict->ValueAt(i));
+ }
}
-
// Compute the union of this and the temporary fixed array.
return UnionOfKeys(key_array);
}
@@ -2881,9 +2884,12 @@
// Compute how many elements are not in this.
int extra = 0;
for (int y = 0; y < len1; y++) {
- if (!HasKey(this, other->get(y))) extra++;
+ Object* value = other->get(y);
+ if (!value->IsTheHole() && !HasKey(this, value)) extra++;
}
+ if (extra == 0) return this;
+
// Allocate the result
Object* obj = Heap::AllocateFixedArray(len0 + extra);
if (obj->IsFailure()) return obj;
@@ -2896,7 +2902,8 @@
// Fill in the extra keys.
int index = 0;
for (int y = 0; y < len1; y++) {
- if (!HasKey(this, other->get(y))) {
+ Object* value = other->get(y);
+ if (!value->IsTheHole() && !HasKey(this, value)) {
result->set(len0 + index, other->get(y), mode);
index++;
}
@@ -3227,7 +3234,7 @@
int String::Utf8Length() {
- if (StringShape(this).IsAsciiRepresentation()) return length();
+ if (IsAsciiRepresentation()) return length();
// Attempt to flatten before accessing the string. It probably
// doesn't make Utf8Length faster, but it is very likely that
// the string will be accessed later (for example by WriteUtf8)
@@ -3243,7 +3250,7 @@
Vector<const char> String::ToAsciiVector() {
- ASSERT(StringShape(this).IsAsciiRepresentation());
+ ASSERT(IsAsciiRepresentation());
ASSERT(IsFlat());
int offset = 0;
@@ -3274,7 +3281,7 @@
Vector<const uc16> String::ToUC16Vector() {
- ASSERT(StringShape(this).IsTwoByteRepresentation());
+ ASSERT(IsTwoByteRepresentation());
ASSERT(IsFlat());
int offset = 0;
@@ -3377,7 +3384,7 @@
const uc16* String::GetTwoByteData(unsigned start) {
- ASSERT(!StringShape(this).IsAsciiRepresentation());
+ ASSERT(!IsAsciiRepresentation());
switch (StringShape(this).representation_tag()) {
case kSeqStringTag:
return SeqTwoByteString::cast(this)->SeqTwoByteStringGetData(start);
@@ -3672,7 +3679,7 @@
}
switch (StringShape(input).representation_tag()) {
case kSeqStringTag:
- if (StringShape(input).IsAsciiRepresentation()) {
+ if (input->IsAsciiRepresentation()) {
SeqAsciiString* str = SeqAsciiString::cast(input);
return str->SeqAsciiStringReadBlock(&rbb->remaining,
offset_ptr,
@@ -3693,7 +3700,7 @@
offset_ptr,
max_chars);
case kExternalStringTag:
- if (StringShape(input).IsAsciiRepresentation()) {
+ if (input->IsAsciiRepresentation()) {
return ExternalAsciiString::cast(input)->ExternalAsciiStringReadBlock(
&rbb->remaining,
offset_ptr,
@@ -3746,7 +3753,7 @@
if (str_ == NULL) return;
Handle<String> str(str_);
ASSERT(str->IsFlat());
- is_ascii_ = StringShape(*str).IsAsciiRepresentation();
+ is_ascii_ = str->IsAsciiRepresentation();
if (is_ascii_) {
start_ = str->ToAsciiVector().start();
} else {
@@ -3787,7 +3794,7 @@
switch (StringShape(input).representation_tag()) {
case kSeqStringTag:
- if (StringShape(input).IsAsciiRepresentation()) {
+ if (input->IsAsciiRepresentation()) {
SeqAsciiString::cast(input)->SeqAsciiStringReadBlockIntoBuffer(rbb,
offset_ptr,
max_chars);
@@ -3809,7 +3816,7 @@
max_chars);
return;
case kExternalStringTag:
- if (StringShape(input).IsAsciiRepresentation()) {
+ if (input->IsAsciiRepresentation()) {
ExternalAsciiString::cast(input)->
ExternalAsciiStringReadBlockIntoBuffer(rbb, offset_ptr, max_chars);
} else {
@@ -4139,7 +4146,7 @@
template <typename IteratorA>
static inline bool CompareStringContentsPartial(IteratorA* ia, String* b) {
if (b->IsFlat()) {
- if (StringShape(b).IsAsciiRepresentation()) {
+ if (b->IsAsciiRepresentation()) {
VectorIterator<char> ib(b->ToAsciiVector());
return CompareStringContents(ia, &ib);
} else {
@@ -4179,10 +4186,10 @@
}
if (this->IsFlat()) {
- if (StringShape(this).IsAsciiRepresentation()) {
+ if (IsAsciiRepresentation()) {
Vector<const char> vec1 = this->ToAsciiVector();
if (other->IsFlat()) {
- if (StringShape(other).IsAsciiRepresentation()) {
+ if (other->IsAsciiRepresentation()) {
Vector<const char> vec2 = other->ToAsciiVector();
return CompareRawStringContents(vec1, vec2);
} else {
@@ -4201,7 +4208,7 @@
Vector<const uc16> vec1 = this->ToUC16Vector();
if (CheckVectorForBug9746(vec1)) return false;
if (other->IsFlat()) {
- if (StringShape(other).IsAsciiRepresentation()) {
+ if (other->IsAsciiRepresentation()) {
VectorIterator<uc16> buf1(vec1);
VectorIterator<char> ib(other->ToAsciiVector());
return CompareStringContents(&buf1, &ib);
@@ -5628,75 +5635,18 @@
}
-Object* Dictionary::RemoveHoles() {
- int capacity = Capacity();
- Object* obj = Allocate(NumberOfElements());
- if (obj->IsFailure()) return obj;
- Dictionary* dict = Dictionary::cast(obj);
- uint32_t pos = 0;
- for (int i = 0; i < capacity; i++) {
- Object* k = KeyAt(i);
- if (IsKey(k)) {
- dict->AddNumberEntry(pos++, ValueAt(i), DetailsAt(i));
- }
- }
- return dict;
-}
-
-
void Dictionary::CopyValuesTo(FixedArray* elements) {
int pos = 0;
int capacity = Capacity();
+ WriteBarrierMode mode = elements->GetWriteBarrierMode();
for (int i = 0; i < capacity; i++) {
Object* k = KeyAt(i);
- if (IsKey(k)) elements->set(pos++, ValueAt(i));
+ if (IsKey(k)) elements->set(pos++, ValueAt(i), mode);
}
ASSERT(pos == elements->length());
}
-Object* JSArray::RemoveHoles() {
- if (HasFastElements()) {
- int len = Smi::cast(length())->value();
- int pos = 0;
- FixedArray* elms = FixedArray::cast(elements());
- for (int index = 0; index < len; index++) {
- Object* e = elms->get(index);
- if (!e->IsTheHole()) {
- if (index != pos) elms->set(pos, e);
- pos++;
- }
- }
- set_length(Smi::FromInt(pos), SKIP_WRITE_BARRIER);
- for (int index = pos; index < len; index++) {
- elms->set_the_hole(index);
- }
- return this;
- }
-
- // Compact the sparse array if possible.
- Dictionary* dict = element_dictionary();
- int length = dict->NumberOfElements();
-
- // Try to make this a fast array again.
- if (length <= kMaxFastElementsLength) {
- Object* obj = Heap::AllocateFixedArray(length);
- if (obj->IsFailure()) return obj;
- dict->CopyValuesTo(FixedArray::cast(obj));
- set_length(Smi::FromInt(length), SKIP_WRITE_BARRIER);
- set_elements(FixedArray::cast(obj));
- return this;
- }
-
- // Make another dictionary with smaller indices.
- Object* obj = dict->RemoveHoles();
- if (obj->IsFailure()) return obj;
- set_length(Smi::FromInt(length), SKIP_WRITE_BARRIER);
- set_elements(Dictionary::cast(obj));
- return this;
-}
-
-
InterceptorInfo* JSObject::GetNamedInterceptor() {
ASSERT(map()->has_named_interceptor());
JSFunction* constructor = JSFunction::cast(map()->constructor());
@@ -6448,6 +6398,176 @@
template class HashTable<0, 2>;
+// Collates undefined and unexisting elements below limit from position
+// zero of the elements. The object stays in Dictionary mode.
+Object* JSObject::PrepareSlowElementsForSort(uint32_t limit) {
+ ASSERT(!HasFastElements());
+ // Must stay in dictionary mode, either because of requires_slow_elements,
+ // or because we are not going to sort (and therefore compact) all of the
+ // elements.
+ Dictionary* dict = element_dictionary();
+ HeapNumber* result_double = NULL;
+ if (limit > static_cast<uint32_t>(Smi::kMaxValue)) {
+ // Allocate space for result before we start mutating the object.
+ Object* new_double = Heap::AllocateHeapNumber(0.0);
+ if (new_double->IsFailure()) return new_double;
+ result_double = HeapNumber::cast(new_double);
+ }
+
+ int capacity = dict->Capacity();
+ Object* obj = Dictionary::Allocate(dict->Capacity());
+ if (obj->IsFailure()) return obj;
+ Dictionary* new_dict = Dictionary::cast(obj);
+
+ AssertNoAllocation no_alloc;
+
+ // Loose all details on properties when moving them around.
+ // Elements do not have special details like properties.
+ PropertyDetails no_details = PropertyDetails(NONE, NORMAL);
+
+ uint32_t pos = 0;
+ uint32_t undefs = 0;
+ for (int i = 0; i < capacity; i++) {
+ Object* k = dict->KeyAt(i);
+ if (dict->IsKey(k)) {
+ ASSERT(k->IsNumber());
+ ASSERT(!k->IsSmi() || Smi::cast(k)->value() >= 0);
+ ASSERT(!k->IsHeapNumber() || HeapNumber::cast(k)->value() >= 0);
+ ASSERT(!k->IsHeapNumber() || HeapNumber::cast(k)->value() <= kMaxUInt32);
+ Object* value = dict->ValueAt(i);
+ uint32_t key = NumberToUint32(k);
+ if (key < limit) {
+ if (value->IsUndefined()) {
+ undefs++;
+ } else {
+ new_dict->AddNumberEntry(pos, value, no_details);
+ pos++;
+ }
+ } else {
+ new_dict->AddNumberEntry(key, value, no_details);
+ }
+ }
+ }
+
+ uint32_t result = pos;
+ while (undefs > 0) {
+ new_dict->AddNumberEntry(pos, Heap::undefined_value(), no_details);
+ pos++;
+ undefs--;
+ }
+
+ set_elements(new_dict);
+
+ if (result <= static_cast<uint32_t>(Smi::kMaxValue)) {
+ return Smi::FromInt(static_cast<int>(result));
+ }
+
+ ASSERT_NE(NULL, result_double);
+ result_double->set_value(static_cast<double>(result));
+ return result_double;
+}
+
+
+// Collects all defined (non-hole) and non-undefined (array) elements at
+// the start of the elements array.
+// If the object is in dictionary mode, it is converted to fast elements
+// mode.
+Object* JSObject::PrepareElementsForSort(uint32_t limit) {
+ if (!HasFastElements()) {
+ // Convert to fast elements containing only the existing properties.
+ // Ordering is irrelevant, since we are going to sort anyway.
+ Dictionary* dict = element_dictionary();
+ if (IsJSArray() || dict->requires_slow_elements() ||
+ dict->max_number_key() >= limit) {
+ return PrepareSlowElementsForSort(limit);
+ }
+ // Convert to fast elements.
+
+ PretenureFlag tenure = Heap::InNewSpace(this) ? NOT_TENURED: TENURED;
+ Object* new_array =
+ Heap::AllocateFixedArray(dict->NumberOfElements(), tenure);
+ if (new_array->IsFailure()) {
+ return new_array;
+ }
+ FixedArray* fast_elements = FixedArray::cast(new_array);
+ dict->CopyValuesTo(fast_elements);
+ set_elements(fast_elements);
+ }
+ ASSERT(HasFastElements());
+
+ // Collect holes at the end, undefined before that and the rest at the
+ // start, and return the number of non-hole, non-undefined values.
+
+ FixedArray* elements = this->elements();
+ uint32_t elements_length = static_cast<uint32_t>(elements->length());
+ if (limit > elements_length) {
+ limit = elements_length ;
+ }
+ if (limit == 0) {
+ return Smi::FromInt(0);
+ }
+
+ HeapNumber* result_double = NULL;
+ if (limit > static_cast<uint32_t>(Smi::kMaxValue)) {
+ // Pessimistically allocate space for return value before
+ // we start mutating the array.
+ Object* new_double = Heap::AllocateHeapNumber(0.0);
+ if (new_double->IsFailure()) return new_double;
+ result_double = HeapNumber::cast(new_double);
+ }
+
+ AssertNoAllocation no_alloc;
+
+ // Split elements into defined, undefined and the_hole, in that order.
+ // Only count locations for undefined and the hole, and fill them afterwards.
+ WriteBarrierMode write_barrier = elements->GetWriteBarrierMode();
+ unsigned int undefs = limit;
+ unsigned int holes = limit;
+ // Assume most arrays contain no holes and undefined values, so minimize the
+ // number of stores of non-undefined, non-the-hole values.
+ for (unsigned int i = 0; i < undefs; i++) {
+ Object* current = elements->get(i);
+ if (current->IsTheHole()) {
+ holes--;
+ undefs--;
+ } else if (current->IsUndefined()) {
+ undefs--;
+ } else {
+ continue;
+ }
+ // Position i needs to be filled.
+ while (undefs > i) {
+ current = elements->get(undefs);
+ if (current->IsTheHole()) {
+ holes--;
+ undefs--;
+ } else if (current->IsUndefined()) {
+ undefs--;
+ } else {
+ elements->set(i, current, write_barrier);
+ break;
+ }
+ }
+ }
+ uint32_t result = undefs;
+ while (undefs < holes) {
+ elements->set_undefined(undefs);
+ undefs++;
+ }
+ while (holes < limit) {
+ elements->set_the_hole(holes);
+ holes++;
+ }
+
+ if (result <= static_cast<uint32_t>(Smi::kMaxValue)) {
+ return Smi::FromInt(static_cast<int>(result));
+ }
+ ASSERT_NE(NULL, result_double);
+ result_double->set_value(static_cast<double>(result));
+ return result_double;
+}
+
+
Object* SymbolTable::LookupString(String* string, Object** s) {
SymbolKey key(string);
return LookupKey(&key, s);
diff --git a/src/objects.h b/src/objects.h
index 8e76591..b5b7cbe 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -795,9 +795,10 @@
void SmiVerify();
#endif
+ static const int kSmiNumBits = 31;
// Min and max limits for Smi values.
- static const int kMinValue = -(1 << (kBitsPerPointer - (kSmiTagSize + 1)));
- static const int kMaxValue = (1 << (kBitsPerPointer - (kSmiTagSize + 1))) - 1;
+ static const int kMinValue = -(1 << (kSmiNumBits - 1));
+ static const int kMaxValue = (1 << (kSmiNumBits - 1)) - 1;
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(Smi);
@@ -1178,6 +1179,14 @@
inline bool HasFastElements();
inline Dictionary* element_dictionary(); // Gets slow elements.
+ // Collects elements starting at index 0.
+ // Undefined values are placed after non-undefined values.
+ // Returns the number of non-undefined values.
+ Object* PrepareElementsForSort(uint32_t limit);
+ // As PrepareElementsForSort, but only on objects where elements is
+ // a dictionary, and it will stay a dictionary.
+ Object* PrepareSlowElementsForSort(uint32_t limit);
+
Object* SetProperty(String* key,
Object* value,
PropertyAttributes attributes);
@@ -2008,7 +2017,6 @@
void RemoveNumberEntries(uint32_t from, uint32_t to);
// Sorting support
- Object* RemoveHoles();
void CopyValuesTo(FixedArray* elements);
// Casting.
@@ -2317,8 +2325,7 @@
// the layout of the code object into account.
int ExecutableSize() {
// Check that the assumptions about the layout of the code object holds.
- ASSERT_EQ(reinterpret_cast<unsigned int>(instruction_start()) -
- reinterpret_cast<unsigned int>(address()),
+ ASSERT_EQ(instruction_start() - address(),
Code::kHeaderSize);
return instruction_size() + Code::kHeaderSize;
}
@@ -3200,8 +3207,6 @@
inline explicit StringShape(String* s);
inline explicit StringShape(Map* s);
inline explicit StringShape(InstanceType t);
- inline bool IsAsciiRepresentation();
- inline bool IsTwoByteRepresentation();
inline bool IsSequential();
inline bool IsExternal();
inline bool IsCons();
@@ -3253,6 +3258,9 @@
inline uint32_t length_field();
inline void set_length_field(uint32_t value);
+ inline bool IsAsciiRepresentation();
+ inline bool IsTwoByteRepresentation();
+
// Get and set individual two byte chars in the string.
inline void Set(int index, uint16_t value);
// Get individual two byte char in the string. Repeated calls
@@ -3892,9 +3900,6 @@
// Set the content of the array to the content of storage.
inline void SetContent(FixedArray* storage);
- // Support for sorting
- Object* RemoveHoles();
-
// Casting.
static inline JSArray* cast(Object* obj);
diff --git a/src/platform-freebsd.cc b/src/platform-freebsd.cc
index 1e71704..82208f1 100644
--- a/src/platform-freebsd.cc
+++ b/src/platform-freebsd.cc
@@ -171,7 +171,7 @@
void OS::DebugBreak() {
-#if defined (__arm__) || defined(__thumb__)
+#if defined(__arm__) || defined(__thumb__)
asm("bkpt 0");
#else
asm("int $3");
diff --git a/src/platform-linux.cc b/src/platform-linux.cc
index 9f5b9ac..c735ceb 100644
--- a/src/platform-linux.cc
+++ b/src/platform-linux.cc
@@ -171,6 +171,8 @@
void OS::DebugBreak() {
+// TODO(lrn): Introduce processor define for runtime system (!= V8_ARCH_x,
+// which is the architecture of generated code).
#if defined(__arm__) || defined(__thumb__)
asm("bkpt 0");
#else
@@ -598,7 +600,7 @@
// Extracting the sample from the context is extremely machine dependent.
ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
mcontext_t& mcontext = ucontext->uc_mcontext;
-#if defined (__arm__) || defined(__thumb__)
+#if defined(__arm__) || defined(__thumb__)
sample.pc = mcontext.gregs[R15];
sample.sp = mcontext.gregs[R13];
sample.fp = mcontext.gregs[R11];
diff --git a/src/regexp-macro-assembler-irregexp-inl.h b/src/regexp-macro-assembler-irregexp-inl.h
index 3785291..fa4c3d1 100644
--- a/src/regexp-macro-assembler-irregexp-inl.h
+++ b/src/regexp-macro-assembler-irregexp-inl.h
@@ -32,6 +32,8 @@
#include "ast.h"
#include "bytecodes-irregexp.h"
+#ifndef V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_INL_H_
+#define V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_INL_H_
namespace v8 { namespace internal {
@@ -69,3 +71,5 @@
} } // namespace v8::internal
+
+#endif // V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_INL_H_
diff --git a/src/regexp-macro-assembler-tracer.h b/src/regexp-macro-assembler-tracer.h
index d3aeff7..f25289e 100644
--- a/src/regexp-macro-assembler-tracer.h
+++ b/src/regexp-macro-assembler-tracer.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef REGEXP_MACRO_ASSEMBLER_TRACER_H_
-#define REGEXP_MACRO_ASSEMBLER_TRACER_H_
+#ifndef V8_REGEXP_MACRO_ASSEMBLER_TRACER_H_
+#define V8_REGEXP_MACRO_ASSEMBLER_TRACER_H_
namespace v8 { namespace internal {
@@ -115,4 +115,4 @@
}} // namespace v8::internal
-#endif // REGEXP_MACRO_ASSEMBLER_TRACER_H_
+#endif // V8_REGEXP_MACRO_ASSEMBLER_TRACER_H_
diff --git a/src/regexp-stack.h b/src/regexp-stack.h
index e47462f..b955e76 100644
--- a/src/regexp-stack.h
+++ b/src/regexp-stack.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef REGEXP_STACK_H_
-#define REGEXP_STACK_H_
+#ifndef V8_REGEXP_STACK_H_
+#define V8_REGEXP_STACK_H_
namespace v8 { namespace internal {
@@ -103,4 +103,4 @@
}} // namespace v8::internal
-#endif /* REGEXP_STACK_H_ */
+#endif // V8_REGEXP_STACK_H_
diff --git a/src/runtime.cc b/src/runtime.cc
index a1e23b4..3a738df 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -1282,7 +1282,7 @@
parts_(Factory::NewFixedArray(estimated_part_count)),
part_count_(0),
character_count_(0),
- is_ascii_(StringShape(*subject).IsAsciiRepresentation()) {
+ is_ascii_(subject->IsAsciiRepresentation()) {
// Require a non-zero initial size. Ensures that doubling the size to
// extend the array will work.
ASSERT(estimated_part_count > 0);
@@ -1326,7 +1326,7 @@
int length = string->length();
ASSERT(length > 0);
AddElement(*string);
- if (!StringShape(*string).IsAsciiRepresentation()) {
+ if (!string->IsAsciiRepresentation()) {
is_ascii_ = false;
}
IncrementCharacterCount(length);
@@ -1583,14 +1583,14 @@
int capture_count,
int subject_length) {
ASSERT(replacement->IsFlat());
- if (StringShape(*replacement).IsAsciiRepresentation()) {
+ if (replacement->IsAsciiRepresentation()) {
AssertNoAllocation no_alloc;
ParseReplacementPattern(&parts_,
replacement->ToAsciiVector(),
capture_count,
subject_length);
} else {
- ASSERT(StringShape(*replacement).IsTwoByteRepresentation());
+ ASSERT(replacement->IsTwoByteRepresentation());
AssertNoAllocation no_alloc;
ParseReplacementPattern(&parts_,
@@ -2165,7 +2165,7 @@
// algorithm is unnecessary overhead.
if (pattern_length == 1) {
AssertNoAllocation no_heap_allocation; // ensure vectors stay valid
- if (StringShape(*sub).IsAsciiRepresentation()) {
+ if (sub->IsAsciiRepresentation()) {
uc16 pchar = pat->Get(0);
if (pchar > String::kMaxAsciiCharCode) {
return -1;
@@ -2190,15 +2190,15 @@
AssertNoAllocation no_heap_allocation; // ensure vectors stay valid
// dispatch on type of strings
- if (StringShape(*pat).IsAsciiRepresentation()) {
+ if (pat->IsAsciiRepresentation()) {
Vector<const char> pat_vector = pat->ToAsciiVector();
- if (StringShape(*sub).IsAsciiRepresentation()) {
+ if (sub->IsAsciiRepresentation()) {
return StringMatchStrategy(sub->ToAsciiVector(), pat_vector, start_index);
}
return StringMatchStrategy(sub->ToUC16Vector(), pat_vector, start_index);
}
Vector<const uc16> pat_vector = pat->ToUC16Vector();
- if (StringShape(*sub).IsAsciiRepresentation()) {
+ if (sub->IsAsciiRepresentation()) {
return StringMatchStrategy(sub->ToAsciiVector(), pat_vector, start_index);
}
return StringMatchStrategy(sub->ToUC16Vector(), pat_vector, start_index);
@@ -3329,7 +3329,7 @@
// character is also ascii. This is currently the case, but it
// might break in the future if we implement more context and locale
// dependent upper/lower conversions.
- Object* o = StringShape(s).IsAsciiRepresentation()
+ Object* o = s->IsAsciiRepresentation()
? Heap::AllocateRawAsciiString(length)
: Heap::AllocateRawTwoByteString(length);
if (o->IsFailure()) return o;
@@ -3680,7 +3680,7 @@
if (first->IsString()) return first;
}
- bool ascii = StringShape(special).IsAsciiRepresentation();
+ bool ascii = special->IsAsciiRepresentation();
int position = 0;
for (int i = 0; i < array_length; i++) {
Object* elt = fixed_array->get(i);
@@ -3700,7 +3700,7 @@
return Failure::OutOfMemoryException();
}
position += element_length;
- if (ascii && !StringShape(element).IsAsciiRepresentation()) {
+ if (ascii && !element->IsAsciiRepresentation()) {
ascii = false;
}
} else {
@@ -4757,10 +4757,10 @@
FixedArray* output_array = output->elements();
RUNTIME_ASSERT(output_array->length() >= DateParser::OUTPUT_SIZE);
bool result;
- if (StringShape(*str).IsAsciiRepresentation()) {
+ if (str->IsAsciiRepresentation()) {
result = DateParser::Parse(str->ToAsciiVector(), output_array);
} else {
- ASSERT(StringShape(*str).IsTwoByteRepresentation());
+ ASSERT(str->IsTwoByteRepresentation());
result = DateParser::Parse(str->ToUC16Vector(), output_array);
}
@@ -5244,12 +5244,16 @@
return string;
}
-
+// Moves all own elements of an object, that are below a limit, to positions
+// starting at zero. All undefined values are placed after non-undefined values,
+// and are followed by non-existing element. Does not change the length
+// property.
+// Returns the number of non-undefined elements collected.
static Object* Runtime_RemoveArrayHoles(Arguments args) {
- ASSERT(args.length() == 1);
- // Ignore the case if this is not a JSArray.
- if (!args[0]->IsJSArray()) return args[0];
- return JSArray::cast(args[0])->RemoveHoles();
+ ASSERT(args.length() == 2);
+ CONVERT_CHECKED(JSObject, object, args[0]);
+ CONVERT_NUMBER_CHECKED(uint32_t, limit, Uint32, args[1]);
+ return object->PrepareElementsForSort(limit);
}
@@ -5285,8 +5289,7 @@
static Object* Runtime_GetArrayKeys(Arguments args) {
ASSERT(args.length() == 2);
HandleScope scope;
- CONVERT_CHECKED(JSArray, raw_array, args[0]);
- Handle<JSArray> array(raw_array);
+ CONVERT_ARG_CHECKED(JSObject, array, 0);
CONVERT_NUMBER_CHECKED(uint32_t, length, Uint32, args[1]);
if (array->elements()->IsDictionary()) {
// Create an array and get all the keys into it, then remove all the
@@ -5308,8 +5311,10 @@
single_interval->set(0,
Smi::FromInt(-1),
SKIP_WRITE_BARRIER);
+ uint32_t actual_length = static_cast<uint32_t>(array->elements()->length());
+ uint32_t min_length = actual_length < length ? actual_length : length;
Handle<Object> length_object =
- Factory::NewNumber(static_cast<double>(length));
+ Factory::NewNumber(static_cast<double>(min_length));
single_interval->set(1, *length_object);
return *Factory::NewJSArrayWithElements(single_interval);
}
@@ -6569,9 +6574,9 @@
if (!str->IsString() || !StringShape(String::cast(str)).IsExternal()) {
return true;
}
- if (StringShape(String::cast(str)).IsAsciiRepresentation()) {
+ if (String::cast(str)->IsAsciiRepresentation()) {
return ExternalAsciiString::cast(str)->resource() != NULL;
- } else if (StringShape(String::cast(str)).IsTwoByteRepresentation()) {
+ } else if (String::cast(str)->IsTwoByteRepresentation()) {
return ExternalTwoByteString::cast(str)->resource() != NULL;
} else {
return true;
diff --git a/src/runtime.h b/src/runtime.h
index b29ce70..9430073 100644
--- a/src/runtime.h
+++ b/src/runtime.h
@@ -205,7 +205,7 @@
F(IgnoreAttributesAndSetProperty, -1 /* 3 or 4 */) \
\
/* Arrays */ \
- F(RemoveArrayHoles, 1) \
+ F(RemoveArrayHoles, 2) \
F(GetArrayKeys, 2) \
F(MoveArrayContents, 2) \
F(EstimateNumberOfElements, 1) \
diff --git a/src/shell.h b/src/shell.h
index 4042c07..6712451 100644
--- a/src/shell.h
+++ b/src/shell.h
@@ -27,6 +27,9 @@
//
// A simple interactive shell. Enable with --shell.
+#ifndef V8_SHELL_H_
+#define V8_SHELL_H_
+
#include "../public/debug.h"
namespace v8 { namespace internal {
@@ -47,3 +50,5 @@
};
} } // namespace v8::internal
+
+#endif // V8_SHELL_H_
diff --git a/src/spaces.h b/src/spaces.h
index 3138cc3..843981b 100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -939,14 +939,14 @@
// True if the address is in the address range of this semispace (not
// necessarily below the allocation pointer).
bool Contains(Address a) {
- return (reinterpret_cast<uint32_t>(a) & address_mask_)
- == reinterpret_cast<uint32_t>(start_);
+ return (reinterpret_cast<uintptr_t>(a) & address_mask_)
+ == reinterpret_cast<uintptr_t>(start_);
}
// True if the object is a heap object in the address range of this
// semispace (not necessarily below the allocation pointer).
bool Contains(Object* o) {
- return (reinterpret_cast<uint32_t>(o) & object_mask_) == object_expected_;
+ return (reinterpret_cast<uintptr_t>(o) & object_mask_) == object_expected_;
}
// The offset of an address from the beginning of the space.
@@ -975,9 +975,9 @@
Address age_mark_;
// Masks and comparison values to test for containment in this semispace.
- uint32_t address_mask_;
- uint32_t object_mask_;
- uint32_t object_expected_;
+ uintptr_t address_mask_;
+ uintptr_t object_mask_;
+ uintptr_t object_expected_;
public:
TRACK_MEMORY("SemiSpace")
@@ -1063,11 +1063,11 @@
// True if the address or object lies in the address range of either
// semispace (not necessarily below the allocation pointer).
bool Contains(Address a) {
- return (reinterpret_cast<uint32_t>(a) & address_mask_)
- == reinterpret_cast<uint32_t>(start_);
+ return (reinterpret_cast<uintptr_t>(a) & address_mask_)
+ == reinterpret_cast<uintptr_t>(start_);
}
bool Contains(Object* o) {
- return (reinterpret_cast<uint32_t>(o) & object_mask_) == object_expected_;
+ return (reinterpret_cast<uintptr_t>(o) & object_mask_) == object_expected_;
}
// Return the allocated bytes in the active semispace.
diff --git a/src/unicode-inl.h b/src/unicode-inl.h
index 9737c27..0ee03bd 100644
--- a/src/unicode-inl.h
+++ b/src/unicode-inl.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef __UNIBROW_INL_H__
-#define __UNIBROW_INL_H__
+#ifndef V8_UNICODE_INL_H_
+#define V8_UNICODE_INL_H_
#include "unicode.h"
@@ -235,4 +235,4 @@
} // namespace unibrow
-#endif // __UNIBROW_INL_H__
+#endif // V8_UNICODE_INL_H_
diff --git a/src/unicode.h b/src/unicode.h
index 86fd498..f5e4210 100644
--- a/src/unicode.h
+++ b/src/unicode.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef __UNIBROW_H__
-#define __UNIBROW_H__
+#ifndef V8_UNICODE_H_
+#define V8_UNICODE_H_
#include <sys/types.h>
@@ -276,4 +276,4 @@
} // namespace unibrow
-#endif // __UNIBROW_H__
+#endif // V8_UNICODE_H_
diff --git a/src/usage-analyzer.h b/src/usage-analyzer.h
index 2732dd5..2369422 100644
--- a/src/usage-analyzer.h
+++ b/src/usage-analyzer.h
@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_USAGE_ANALYSER_H_
-#define V8_USAGE_ANALYSER_H_
+#ifndef V8_USAGE_ANALYZER_H_
+#define V8_USAGE_ANALYZER_H_
namespace v8 { namespace internal {
@@ -36,4 +36,4 @@
} } // namespace v8::internal
-#endif // V8_USAGE_ANALYSER_H_
+#endif // V8_USAGE_ANALYZER_H_
diff --git a/src/v8-counters.h b/src/v8-counters.h
index 6596dbf..34156ea 100644
--- a/src/v8-counters.h
+++ b/src/v8-counters.h
@@ -116,6 +116,8 @@
SC(keyed_load_interceptor, V8.KeyedLoadInterceptor) \
SC(keyed_load_inline, V8.KeyedLoadInline) \
SC(keyed_load_inline_miss, V8.KeyedLoadInlineMiss) \
+ SC(named_load_inline, V8.NamedLoadInline) \
+ SC(named_load_inline_miss, V8.NamedLoadInlineMiss) \
SC(keyed_store_field, V8.KeyedStoreField) \
SC(for_in, V8.ForIn) \
SC(enum_cache_hits, V8.EnumCacheHits) \
@@ -159,4 +161,4 @@
} } // namespace v8::internal
-#endif // V8_COUNTERS_H_
+#endif // V8_V8_COUNTERS_H_
diff --git a/src/version.cc b/src/version.cc
new file mode 100644
index 0000000..73f6938
--- /dev/null
+++ b/src/version.cc
@@ -0,0 +1,87 @@
+// Copyright 2008 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "v8.h"
+
+#include "version.h"
+
+// These macros define the version number for the current version.
+// NOTE these macros are used by the SCons build script so their names
+// cannot be changed without changing the SCons build script.
+#define MAJOR_VERSION 1
+#define MINOR_VERSION 2
+#define BUILD_NUMBER 2
+#define PATCH_LEVEL 0
+#define CANDIDATE_VERSION false
+
+// Define SONAME to have the SCons build the put a specific SONAME into the
+// shared library instead the generic SONAME generated from the V8 version
+// number. This define is mainly used by the SCons build script.
+#define SONAME ""
+
+namespace v8 { namespace internal {
+
+int Version::major_ = MAJOR_VERSION;
+int Version::minor_ = MINOR_VERSION;
+int Version::build_ = BUILD_NUMBER;
+int Version::patch_ = PATCH_LEVEL;
+bool Version::candidate_ = CANDIDATE_VERSION;
+const char* Version::soname_ = SONAME;
+
+
+// Calculate the V8 version string.
+void Version::GetString(Vector<char> str) {
+ const char* candidate = IsCandidate() ? " (candidate)" : "";
+ if (GetPatch() > 0) {
+ OS::SNPrintF(str, "%d.%d.%d.%d%s",
+ GetMajor(), GetMinor(), GetBuild(), GetPatch(), candidate);
+ } else {
+ OS::SNPrintF(str, "%d.%d.%d%s",
+ GetMajor(), GetMinor(), GetBuild(), candidate);
+ }
+}
+
+
+// Calculate the SONAME for the V8 shared library.
+void Version::GetSONAME(Vector<char> str) {
+ if (soname_ == NULL || *soname_ == '\0') {
+ // Generate generic SONAME if no specific SONAME is defined.
+ const char* candidate = IsCandidate() ? "-candidate" : "";
+ if (GetPatch() > 0) {
+ OS::SNPrintF(str, "libv8-%d.%d.%d.%d%s.so",
+ GetMajor(), GetMinor(), GetBuild(), GetPatch(), candidate);
+ } else {
+ OS::SNPrintF(str, "libv8-%d.%d.%d%s.so",
+ GetMajor(), GetMinor(), GetBuild(), candidate);
+ }
+ } else {
+ // Use specific SONAME.
+ OS::SNPrintF(str, "%s", soname_);
+ }
+}
+
+} } // namespace v8::internal
diff --git a/src/version.h b/src/version.h
new file mode 100644
index 0000000..423b5f7
--- /dev/null
+++ b/src/version.h
@@ -0,0 +1,63 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef V8_VERSION_H_
+#define V8_VERSION_H_
+
+namespace v8 { namespace internal {
+
+class Version {
+ public:
+ // Return the various version components.
+ static int GetMajor() { return major_; }
+ static int GetMinor() { return minor_; }
+ static int GetBuild() { return build_; }
+ static int GetPatch() { return patch_; }
+ static bool IsCandidate() { return candidate_; }
+
+ // Calculate the V8 version string.
+ static void GetString(Vector<char> str);
+
+ // Calculate the SONAME for the V8 shared library.
+ static void GetSONAME(Vector<char> str);
+
+ private:
+ static int major_;
+ static int minor_;
+ static int build_;
+ static int patch_;
+ static bool candidate_;
+ static const char* soname_;
+
+ // In test-version.cc.
+ friend void SetVersion(int major, int minor, int build, int patch,
+ bool candidate, const char* soname);
+};
+
+} } // namespace v8::internal
+
+#endif // V8_VERSION_H_
diff --git a/src/virtual-frame.cc b/src/virtual-frame.cc
index cef1d80..566fcdb 100644
--- a/src/virtual-frame.cc
+++ b/src/virtual-frame.cc
@@ -507,4 +507,14 @@
return true;
}
+
+// Specialization of List::ResizeAdd to non-inlined version for FrameElements.
+// The function ResizeAdd becomes a real function, whose implementation is the
+// inlined ResizeAddInternal.
+template <>
+void List<FrameElement,
+ FreeStoreAllocationPolicy>::ResizeAdd(const FrameElement& element) {
+ ResizeAddInternal(element);
+}
+
} } // namespace v8::internal
diff --git a/src/virtual-frame.h b/src/virtual-frame.h
index 13e68b0..8c76f8a 100644
--- a/src/virtual-frame.h
+++ b/src/virtual-frame.h
@@ -191,15 +191,26 @@
data_.index_ = new_index;
}
+ void set_reg(Register new_reg) {
+ ASSERT(is_register());
+ data_.reg_ = new_reg;
+ }
+
friend class VirtualFrame;
};
} } // namespace v8::internal
-#ifdef ARM
+#ifdef V8_ARCH_ARM
#include "arm/virtual-frame-arm.h"
-#else // ia32
+#endif
+
+#ifdef V8_ARCH_X64
+#include "x64/virtual-frame-x64.h"
+#endif
+
+#ifdef V8_ARCH_IA32
#include "ia32/virtual-frame-ia32.h"
#endif
diff --git a/src/x64/assembler-x64-inl.h b/src/x64/assembler-x64-inl.h
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/assembler-x64-inl.h
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/assembler-x64.cc b/src/x64/assembler-x64.cc
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/assembler-x64.cc
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/assembler-x64.h b/src/x64/assembler-x64.h
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/assembler-x64.h
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/builtins-x64.cc
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/codegen-x64.cc
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/codegen-x64.h b/src/x64/codegen-x64.h
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/codegen-x64.h
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/cpu-x64.cc b/src/x64/cpu-x64.cc
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/cpu-x64.cc
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/debug-x64.cc b/src/x64/debug-x64.cc
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/debug-x64.cc
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/disasm-x64.cc b/src/x64/disasm-x64.cc
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/disasm-x64.cc
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/frames-x64.cc b/src/x64/frames-x64.cc
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/frames-x64.cc
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/frames-x64.h b/src/x64/frames-x64.h
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/frames-x64.h
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/ic-x64.cc b/src/x64/ic-x64.cc
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/ic-x64.cc
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/jump-target-x64.cc b/src/x64/jump-target-x64.cc
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/jump-target-x64.cc
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/macro-assembler-x64.cc
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/macro-assembler-x64.h b/src/x64/macro-assembler-x64.h
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/macro-assembler-x64.h
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/regexp-macro-assembler-x64.cc b/src/x64/regexp-macro-assembler-x64.cc
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/regexp-macro-assembler-x64.cc
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/regexp-macro-assembler-x64.h b/src/x64/regexp-macro-assembler-x64.h
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/regexp-macro-assembler-x64.h
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/register-allocator-x64.cc b/src/x64/register-allocator-x64.cc
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/register-allocator-x64.cc
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/simulator-x64.cc b/src/x64/simulator-x64.cc
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/simulator-x64.cc
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/simulator-x64.h b/src/x64/simulator-x64.h
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/simulator-x64.h
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/stub-cache-x64.cc
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/virtual-frame-x64.cc b/src/x64/virtual-frame-x64.cc
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/virtual-frame-x64.cc
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/src/x64/virtual-frame-x64.h b/src/x64/virtual-frame-x64.h
new file mode 100644
index 0000000..209aa2d
--- /dev/null
+++ b/src/x64/virtual-frame-x64.h
@@ -0,0 +1,27 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/test/cctest/SConscript b/test/cctest/SConscript
index f66f72b..eb94fc5 100644
--- a/test/cctest/SConscript
+++ b/test/cctest/SConscript
@@ -54,7 +54,8 @@
'test-spaces.cc',
'test-strings.cc',
'test-threads.cc',
- 'test-utils.cc'
+ 'test-utils.cc',
+ 'test-version.cc'
],
'arch:arm': ['test-assembler-arm.cc', 'test-disasm-arm.cc'],
'arch:ia32': [
diff --git a/test/cctest/cctest.cc b/test/cctest/cctest.cc
index 2807c8b..82a33e6 100644
--- a/test/cctest/cctest.cc
+++ b/test/cctest/cctest.cc
@@ -26,9 +26,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <v8.h>
-#include <cstdlib>
-#include <cstring>
-#include <cstdio>
#include "cctest.h"
#include "debug.h"
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 9a3aead..a59b1d4 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -27,9 +27,6 @@
#include <stdlib.h>
-#include <map>
-#include <string>
-
#include "v8.h"
#include "api.h"
@@ -423,7 +420,7 @@
public:
static int dispose_count;
- explicit TestAsciiResource(char* data)
+ explicit TestAsciiResource(const char* data)
: data_(data),
length_(strlen(data)) { }
@@ -440,7 +437,7 @@
return length_;
}
private:
- char* data_;
+ const char* data_;
size_t length_;
};
@@ -4659,11 +4656,6 @@
value = Script::Compile(v8_str(call_17))->Run();
CHECK(!try_catch.HasCaught());
CHECK_EQ(17, value->Int32Value());
-
- // Try something that will cause an exception: Call the object as a
- // constructor. This should be the last test.
- value = Script::Compile(v8_str("new obj(42)"))->Run();
- CHECK(try_catch.HasCaught());
}
@@ -6156,6 +6148,117 @@
}
+class AsciiVectorResource : public v8::String::ExternalAsciiStringResource {
+ public:
+ explicit AsciiVectorResource(i::Vector<const char> vector)
+ : data_(vector) {}
+ virtual ~AsciiVectorResource() {}
+ virtual size_t length() const { return data_.length(); }
+ virtual const char* data() const { return data_.start(); }
+ private:
+ i::Vector<const char> data_;
+};
+
+
+class UC16VectorResource : public v8::String::ExternalStringResource {
+ public:
+ explicit UC16VectorResource(i::Vector<const i::uc16> vector)
+ : data_(vector) {}
+ virtual ~UC16VectorResource() {}
+ virtual size_t length() const { return data_.length(); }
+ virtual const i::uc16* data() const { return data_.start(); }
+ private:
+ i::Vector<const i::uc16> data_;
+};
+
+
+static void MorphAString(i::String* string,
+ AsciiVectorResource* ascii_resource,
+ UC16VectorResource* uc16_resource) {
+ CHECK(i::StringShape(string).IsExternal());
+ if (string->IsAsciiRepresentation()) {
+ // Check old map is not symbol or long.
+ CHECK(string->map() == i::Heap::short_external_ascii_string_map() ||
+ string->map() == i::Heap::medium_external_ascii_string_map());
+ // Morph external string to be TwoByte string.
+ if (string->length() <= i::String::kMaxShortStringSize) {
+ string->set_map(i::Heap::short_external_string_map());
+ } else {
+ string->set_map(i::Heap::medium_external_string_map());
+ }
+ i::ExternalTwoByteString* morphed =
+ i::ExternalTwoByteString::cast(string);
+ morphed->set_resource(uc16_resource);
+ } else {
+ // Check old map is not symbol or long.
+ CHECK(string->map() == i::Heap::short_external_string_map() ||
+ string->map() == i::Heap::medium_external_string_map());
+ // Morph external string to be ASCII string.
+ if (string->length() <= i::String::kMaxShortStringSize) {
+ string->set_map(i::Heap::short_external_ascii_string_map());
+ } else {
+ string->set_map(i::Heap::medium_external_ascii_string_map());
+ }
+ i::ExternalAsciiString* morphed =
+ i::ExternalAsciiString::cast(string);
+ morphed->set_resource(ascii_resource);
+ }
+}
+
+
+// Test that we can still flatten a string if the components it is built up
+// from have been turned into 16 bit strings in the mean time.
+THREADED_TEST(MorphCompositeStringTest) {
+ const char* c_string = "Now is the time for all good men"
+ " to come to the aid of the party";
+ uint16_t* two_byte_string = AsciiToTwoByteString(c_string);
+ {
+ v8::HandleScope scope;
+ LocalContext env;
+ AsciiVectorResource ascii_resource(
+ i::Vector<const char>(c_string, strlen(c_string)));
+ UC16VectorResource uc16_resource(
+ i::Vector<const uint16_t>(two_byte_string, strlen(c_string)));
+
+ Local<String> lhs(v8::Utils::ToLocal(
+ i::Factory::NewExternalStringFromAscii(&ascii_resource)));
+ Local<String> rhs(v8::Utils::ToLocal(
+ i::Factory::NewExternalStringFromAscii(&ascii_resource)));
+
+ env->Global()->Set(v8_str("lhs"), lhs);
+ env->Global()->Set(v8_str("rhs"), rhs);
+
+ CompileRun(
+ "var cons = lhs + rhs;"
+ "var slice = lhs.substring(1, lhs.length - 1);"
+ "var slice_on_cons = (lhs + rhs).substring(1, lhs.length *2 - 1);");
+
+ MorphAString(*v8::Utils::OpenHandle(*lhs), &ascii_resource, &uc16_resource);
+ MorphAString(*v8::Utils::OpenHandle(*rhs), &ascii_resource, &uc16_resource);
+
+ // Now do some stuff to make sure the strings are flattened, etc.
+ CompileRun(
+ "/[^a-z]/.test(cons);"
+ "/[^a-z]/.test(slice);"
+ "/[^a-z]/.test(slice_on_cons);");
+ const char* expected_cons =
+ "Now is the time for all good men to come to the aid of the party"
+ "Now is the time for all good men to come to the aid of the party";
+ const char* expected_slice =
+ "ow is the time for all good men to come to the aid of the part";
+ const char* expected_slice_on_cons =
+ "ow is the time for all good men to come to the aid of the party"
+ "Now is the time for all good men to come to the aid of the part";
+ CHECK_EQ(String::New(expected_cons),
+ env->Global()->Get(v8_str("cons")));
+ CHECK_EQ(String::New(expected_slice),
+ env->Global()->Get(v8_str("slice")));
+ CHECK_EQ(String::New(expected_slice_on_cons),
+ env->Global()->Get(v8_str("slice_on_cons")));
+ }
+}
+
+
class RegExpStringModificationTest {
public:
RegExpStringModificationTest()
@@ -6200,26 +6303,6 @@
}
private:
- class AsciiVectorResource : public v8::String::ExternalAsciiStringResource {
- public:
- explicit AsciiVectorResource(i::Vector<const char> vector)
- : data_(vector) {}
- virtual ~AsciiVectorResource() {}
- virtual size_t length() const { return data_.length(); }
- virtual const char* data() const { return data_.start(); }
- private:
- i::Vector<const char> data_;
- };
- class UC16VectorResource : public v8::String::ExternalStringResource {
- public:
- explicit UC16VectorResource(i::Vector<const i::uc16> vector)
- : data_(vector) {}
- virtual ~UC16VectorResource() {}
- virtual size_t length() const { return data_.length(); }
- virtual const i::uc16* data() const { return data_.start(); }
- private:
- i::Vector<const i::uc16> data_;
- };
// Number of string modifications required.
static const int kRequiredModifications = 5;
static const int kMaxModifications = 100;
@@ -6243,25 +6326,7 @@
v8::Locker lock;
// Swap string between ascii and two-byte representation.
i::String* string = *input_;
- CHECK(i::StringShape(string).IsExternal());
- if (i::StringShape(string).IsAsciiRepresentation()) {
- // Morph external string to be TwoByte string.
- i::ExternalAsciiString* ext_string =
- i::ExternalAsciiString::cast(string);
- i::ExternalTwoByteString* morphed =
- reinterpret_cast<i::ExternalTwoByteString*>(ext_string);
- morphed->map()->set_instance_type(i::SHORT_EXTERNAL_STRING_TYPE);
- morphed->set_resource(&uc16_resource_);
- } else {
- // Morph external string to be ASCII string.
- i::ExternalTwoByteString* ext_string =
- i::ExternalTwoByteString::cast(string);
- i::ExternalAsciiString* morphed =
- reinterpret_cast<i::ExternalAsciiString*>(ext_string);
- morphed->map()->set_instance_type(
- i::SHORT_EXTERNAL_ASCII_STRING_TYPE);
- morphed->set_resource(&ascii_resource_);
- }
+ MorphAString(string, &ascii_resource_, &uc16_resource_);
morphs_++;
}
i::OS::Sleep(1);
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
index ca2d49e..93286eb 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -3436,6 +3436,7 @@
// Signals when a break is reported.
message_queue_barriers.semaphore_2->Signal();
}
+
// Allow message handler to block on a semaphore, to test queueing of
// messages while blocked.
message_queue_barriers.semaphore_1->Wait();
@@ -3474,6 +3475,7 @@
/* Interleaved sequence of actions by the two threads:*/
// Main thread compiles and runs source_1
+ message_queue_barriers.semaphore_1->Signal();
message_queue_barriers.barrier_1.Wait();
// Post 6 commands, filling the command queue and making it expand.
// These calls return immediately, but the commands stay on the queue
@@ -3487,22 +3489,39 @@
v8::Debug::SendCommand(buffer_2, AsciiToUtf16(command_3, buffer_2));
message_queue_barriers.barrier_2.Wait();
// Main thread compiles and runs source_2.
- // Queued commands are executed at the start of compilation of source_2.
- message_queue_barriers.barrier_3.Wait();
- // Free the message handler to process all the messages from the queue.
- for (int i = 0; i < 20 ; ++i) {
+ // Queued commands are executed at the start of compilation of source_2(
+ // beforeCompile event).
+ // Free the message handler to process all the messages from the queue. 7
+ // messages are expected: 2 afterCompile events and 5 responses.
+ // All the commands added so far will fail to execute as long as call stack
+ // is empty on beforeCompile event.
+ for (int i = 0; i < 6 ; ++i) {
message_queue_barriers.semaphore_1->Signal();
}
+ message_queue_barriers.barrier_3.Wait();
// Main thread compiles and runs source_3.
+ // Don't stop in the afterCompile handler.
+ message_queue_barriers.semaphore_1->Signal();
// source_3 includes a debugger statement, which causes a break event.
// Wait on break event from hitting "debugger" statement
message_queue_barriers.semaphore_2->Wait();
// These should execute after the "debugger" statement in source_2
+ v8::Debug::SendCommand(buffer_1, AsciiToUtf16(command_1, buffer_1));
+ v8::Debug::SendCommand(buffer_2, AsciiToUtf16(command_2, buffer_2));
+ v8::Debug::SendCommand(buffer_2, AsciiToUtf16(command_3, buffer_2));
v8::Debug::SendCommand(buffer_2, AsciiToUtf16(command_single_step, buffer_2));
+ // Run after 2 break events, 4 responses.
+ for (int i = 0; i < 6 ; ++i) {
+ message_queue_barriers.semaphore_1->Signal();
+ }
// Wait on break event after a single step executes.
message_queue_barriers.semaphore_2->Wait();
v8::Debug::SendCommand(buffer_1, AsciiToUtf16(command_2, buffer_1));
v8::Debug::SendCommand(buffer_2, AsciiToUtf16(command_continue, buffer_2));
+ // Run after 2 responses.
+ for (int i = 0; i < 2 ; ++i) {
+ message_queue_barriers.semaphore_1->Signal();
+ }
// Main thread continues running source_3 to end, waits for this thread.
}
@@ -3593,10 +3612,8 @@
static int handled_client_data_instances_count = 0;
static void MessageHandlerCountingClientData(
- const uint16_t* message,
- int length,
- v8::Debug::ClientData* client_data) {
- if (client_data) {
+ const v8::Debug::Message& message) {
+ if (message.GetClientData() != NULL) {
handled_client_data_instances_count++;
}
}
@@ -3609,8 +3626,8 @@
DebugLocalContext env;
TestClientData::ResetCounters();
handled_client_data_instances_count = 0;
- v8::Debug::SetMessageHandler(MessageHandlerCountingClientData);
- const char* source_1 = "a = 3; b = 4; c = new Object(); c.d = 5; debugger;";
+ v8::Debug::SetMessageHandler2(MessageHandlerCountingClientData);
+ const char* source_1 = "a = 3; b = 4; c = new Object(); c.d = 5;";
const int kBufferSize = 1000;
uint16_t buffer[kBufferSize];
const char* command_1 =
@@ -3635,8 +3652,9 @@
new TestClientData());
v8::Debug::SendCommand(buffer, AsciiToUtf16(command_2, buffer),
new TestClientData());
- v8::Debug::SendCommand(buffer, AsciiToUtf16(command_continue, buffer));
+ // All the messages will be processed on beforeCompile event.
CompileRun(source_1);
+ v8::Debug::SendCommand(buffer, AsciiToUtf16(command_continue, buffer));
CHECK_EQ(3, TestClientData::constructor_call_counter);
CHECK_EQ(TestClientData::constructor_call_counter,
handled_client_data_instances_count);
@@ -3671,10 +3689,10 @@
}
-static void ThreadedMessageHandler(const uint16_t* message, int length,
- v8::Debug::ClientData* client_data) {
+static void ThreadedMessageHandler(const v8::Debug::Message& message) {
static char print_buffer[1000];
- Utf16ToAscii(message, length, print_buffer);
+ v8::String::Value json(message.GetJSON());
+ Utf16ToAscii(*json, json.length(), print_buffer);
if (IsBreakEventMessage(print_buffer)) {
threaded_debugging_barriers.barrier_2.Wait();
}
@@ -3705,7 +3723,7 @@
v8::HandleScope scope;
DebugLocalContext env;
- v8::Debug::SetMessageHandler(&ThreadedMessageHandler);
+ v8::Debug::SetMessageHandler2(&ThreadedMessageHandler);
v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New();
global_template->Set(v8::String::New("ThreadedAtBarrier1"),
v8::FunctionTemplate::New(ThreadedAtBarrier1));
@@ -3768,11 +3786,10 @@
Barriers* breakpoints_barriers;
-static void BreakpointsMessageHandler(const uint16_t* message,
- int length,
- v8::Debug::ClientData* client_data) {
+static void BreakpointsMessageHandler(const v8::Debug::Message& message) {
static char print_buffer[1000];
- Utf16ToAscii(message, length, print_buffer);
+ v8::String::Value json(message.GetJSON());
+ Utf16ToAscii(*json, json.length(), print_buffer);
printf("%s\n", print_buffer);
fflush(stdout);
@@ -3806,7 +3823,7 @@
v8::HandleScope scope;
DebugLocalContext env;
- v8::Debug::SetMessageHandler(&BreakpointsMessageHandler);
+ v8::Debug::SetMessageHandler2(&BreakpointsMessageHandler);
CompileRun(source_1);
breakpoints_barriers->barrier_1.Wait();
@@ -3915,14 +3932,12 @@
}
-static void DummyMessageHandler(const uint16_t* message,
- int length,
- v8::Debug::ClientData* client_data) {
+static void DummyMessageHandler(const v8::Debug::Message& message) {
}
TEST(SetMessageHandlerOnUninitializedVM) {
- v8::Debug::SetMessageHandler(DummyMessageHandler);
+ v8::Debug::SetMessageHandler2(DummyMessageHandler);
}
@@ -4142,9 +4157,7 @@
// Debugger message handler which counts the number of times it is called.
static int message_handler_hit_count = 0;
-static void MessageHandlerHitCount(const uint16_t* message,
- int length,
- v8::Debug::ClientData* client_data) {
+static void MessageHandlerHitCount(const v8::Debug::Message& message) {
message_handler_hit_count++;
const int kBufferSize = 1000;
@@ -4167,7 +4180,7 @@
CheckDebuggerUnloaded();
// Set a debug message handler.
- v8::Debug::SetMessageHandler(MessageHandlerHitCount);
+ v8::Debug::SetMessageHandler2(MessageHandlerHitCount);
// Run code to throw a unhandled exception. This should end up in the message
// handler.
@@ -4193,9 +4206,7 @@
// Debugger message handler which clears the message handler while active.
static void MessageHandlerClearingMessageHandler(
- const uint16_t* message,
- int length,
- v8::Debug::ClientData* client_data) {
+ const v8::Debug::Message& message) {
message_handler_hit_count++;
// Clear debug message handler.
@@ -4212,7 +4223,7 @@
CheckDebuggerUnloaded();
// Set a debug message handler.
- v8::Debug::SetMessageHandler(MessageHandlerClearingMessageHandler);
+ v8::Debug::SetMessageHandler2(MessageHandlerClearingMessageHandler);
// Run code to throw a unhandled exception. This should end up in the message
// handler.
@@ -4242,11 +4253,10 @@
Barriers* host_dispatch_barriers;
-static void HostDispatchMessageHandler(const uint16_t* message,
- int length,
- v8::Debug::ClientData* client_data) {
+static void HostDispatchMessageHandler(const v8::Debug::Message& message) {
static char print_buffer[1000];
- Utf16ToAscii(message, length, print_buffer);
+ v8::String::Value json(message.GetJSON());
+ Utf16ToAscii(*json, json.length(), print_buffer);
printf("%s\n", print_buffer);
fflush(stdout);
}
@@ -4273,7 +4283,7 @@
DebugLocalContext env;
// Setup message and host dispatch handlers.
- v8::Debug::SetMessageHandler(HostDispatchMessageHandler);
+ v8::Debug::SetMessageHandler2(HostDispatchMessageHandler);
v8::Debug::SetHostDispatchHandler(HostDispatchDispatchHandler, 10 /* ms */);
CompileRun(source_1);
diff --git a/test/cctest/test-regexp.cc b/test/cctest/test-regexp.cc
index f2f66fb..ac75999 100644
--- a/test/cctest/test-regexp.cc
+++ b/test/cctest/test-regexp.cc
@@ -1,4 +1,4 @@
-// Copyright 2008 the V8 project authors. All rights reserved.
+/// Copyright 2008 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:
@@ -27,7 +27,6 @@
#include <stdlib.h>
-#include <set>
#include "v8.h"
@@ -39,9 +38,13 @@
#include "jsregexp-inl.h"
#include "regexp-macro-assembler.h"
#include "regexp-macro-assembler-irregexp.h"
-#ifdef ARM
+#ifdef V8_ARCH_ARM
#include "arm/regexp-macro-assembler-arm.h"
-#else // IA32
+#endif
+#ifdef V8_ARCH_X64
+// No X64-implementation yet.
+#endif
+#ifdef V8_ARCH_IA32
#include "ia32/macro-assembler-ia32.h"
#include "ia32/regexp-macro-assembler-ia32.h"
#endif
@@ -499,24 +502,25 @@
const int TestConfig::kNoValue = 0;
-static int PseudoRandom(int i, int j) {
+static unsigned PseudoRandom(int i, int j) {
return ~(~((i * 781) ^ (j * 329)));
}
TEST(SplayTreeSimple) {
- static const int kLimit = 1000;
+ static const unsigned kLimit = 1000;
ZoneScope zone_scope(DELETE_ON_EXIT);
ZoneSplayTree<TestConfig> tree;
- std::set<int> seen;
+ bool seen[kLimit];
+ for (unsigned i = 0; i < kLimit; i++) seen[i] = false;
#define CHECK_MAPS_EQUAL() do { \
- for (int k = 0; k < kLimit; k++) \
- CHECK_EQ(seen.find(k) != seen.end(), tree.Find(k, &loc)); \
+ for (unsigned k = 0; k < kLimit; k++) \
+ CHECK_EQ(seen[k], tree.Find(k, &loc)); \
} while (false)
for (int i = 0; i < 50; i++) {
for (int j = 0; j < 50; j++) {
- int next = PseudoRandom(i, j) % kLimit;
- if (seen.find(next) != seen.end()) {
+ unsigned next = PseudoRandom(i, j) % kLimit;
+ if (seen[next]) {
// We've already seen this one. Check the value and remove
// it.
ZoneSplayTree<TestConfig>::Locator loc;
@@ -524,7 +528,7 @@
CHECK_EQ(next, loc.key());
CHECK_EQ(3 * next, loc.value());
tree.Remove(next);
- seen.erase(next);
+ seen[next] = false;
CHECK_MAPS_EQUAL();
} else {
// Check that it wasn't there already and then add it.
@@ -533,26 +537,22 @@
CHECK(tree.Insert(next, &loc));
CHECK_EQ(next, loc.key());
loc.set_value(3 * next);
- seen.insert(next);
+ seen[next] = true;
CHECK_MAPS_EQUAL();
}
int val = PseudoRandom(j, i) % kLimit;
- for (int k = val; k >= 0; k--) {
- if (seen.find(val) != seen.end()) {
- ZoneSplayTree<TestConfig>::Locator loc;
- CHECK(tree.FindGreatestLessThan(val, &loc));
- CHECK_EQ(loc.key(), val);
- break;
- }
+ if (seen[val]) {
+ ZoneSplayTree<TestConfig>::Locator loc;
+ CHECK(tree.FindGreatestLessThan(val, &loc));
+ CHECK_EQ(loc.key(), val);
+ break;
}
val = PseudoRandom(i + j, i - j) % kLimit;
- for (int k = val; k < kLimit; k++) {
- if (seen.find(val) != seen.end()) {
- ZoneSplayTree<TestConfig>::Locator loc;
- CHECK(tree.FindLeastGreaterThan(val, &loc));
- CHECK_EQ(loc.key(), val);
- break;
- }
+ if (seen[val]) {
+ ZoneSplayTree<TestConfig>::Locator loc;
+ CHECK(tree.FindLeastGreaterThan(val, &loc));
+ CHECK_EQ(loc.key(), val);
+ break;
}
}
}
@@ -661,7 +661,7 @@
}
-#ifndef ARM // IA32 only tests.
+#ifdef V8_ARCH_IA32 // IA32 only tests.
class ContextInitializer {
public:
diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc
index 56727dc..36f051f 100644
--- a/test/cctest/test-serialize.cc
+++ b/test/cctest/test-serialize.cc
@@ -26,8 +26,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <signal.h>
-#include <map>
-#include <string>
#include "sys/stat.h"
#include "v8.h"
@@ -42,20 +40,40 @@
using namespace v8::internal;
-static int local_counters[256];
-static int counter_count = 0;
-static std::map<std::string, int> counter_table;
+static const unsigned kCounters = 256;
+static int local_counters[kCounters];
+static const char* local_counter_names[kCounters];
+
+
+static unsigned CounterHash(const char* s) {
+ unsigned hash = 0;
+ while (*++s) {
+ hash |= hash << 5;
+ hash += *s;
+ }
+ return hash;
+}
// Callback receiver to track counters in test.
static int* counter_function(const char* name) {
- std::string counter(name);
- if (counter_table.find(counter) == counter_table.end()) {
- local_counters[counter_count] = 0;
- counter_table[counter] = counter_count++;
+ unsigned hash = CounterHash(name) % kCounters;
+ unsigned original_hash = hash;
+ USE(original_hash);
+ while (true) {
+ if (local_counter_names[hash] == name) {
+ return &local_counters[hash];
+ }
+ if (local_counter_names[hash] == 0) {
+ local_counter_names[hash] = name;
+ return &local_counters[hash];
+ }
+ if (strcmp(local_counter_names[hash], name) == 0) {
+ return &local_counters[hash];
+ }
+ hash = (hash + 1) % kCounters;
+ ASSERT(hash != original_hash); // Hash table has been filled up.
}
-
- return &local_counters[counter_table[counter]];
}
diff --git a/test/cctest/test-strings.cc b/test/cctest/test-strings.cc
index 1788cd2..6f42639 100644
--- a/test/cctest/test-strings.cc
+++ b/test/cctest/test-strings.cc
@@ -9,6 +9,7 @@
#include "v8.h"
+#include "api.h"
#include "factory.h"
#include "cctest.h"
#include "zone-inl.h"
@@ -391,9 +392,19 @@
class TwoByteResource: public v8::String::ExternalStringResource {
public:
- explicit TwoByteResource(const uint16_t* data, size_t length)
- : data_(data), length_(length) { }
- virtual ~TwoByteResource() { }
+ TwoByteResource(const uint16_t* data, size_t length, bool* destructed)
+ : data_(data), length_(length), destructed_(destructed) {
+ if (destructed_ != NULL) {
+ *destructed_ = false;
+ }
+ }
+
+ virtual ~TwoByteResource() {
+ if (destructed_ != NULL) {
+ CHECK(!*destructed_);
+ *destructed_ = true;
+ }
+ }
const uint16_t* data() const { return data_; }
size_t length() const { return length_; }
@@ -401,6 +412,7 @@
private:
const uint16_t* data_;
size_t length_;
+ bool* destructed_;
};
@@ -420,7 +432,8 @@
// Allocate an external string resource and external string.
TwoByteResource* resource = new TwoByteResource(two_byte_data,
- two_byte_length);
+ two_byte_length,
+ NULL);
Handle<String> string = Factory::NewExternalStringFromTwoByte(resource);
Vector<const char> one_byte_vec = CStrVector(one_byte_data);
Handle<String> compare = Factory::NewStringFromAscii(one_byte_vec);
@@ -444,3 +457,87 @@
CHECK_EQ(false, string->Equals(Heap::empty_string()));
#endif // !defined(DEBUG)
}
+
+
+// Regression test case for http://crbug.com/9746. The problem was
+// that when we marked objects reachable only through weak pointers,
+// we ended up keeping a sliced symbol alive, even though we already
+// invoked the weak callback on the underlying external string thus
+// deleting its resource.
+TEST(Regress9746) {
+ InitializeVM();
+
+ // Setup lengths that guarantee we'll get slices instead of simple
+ // flat strings.
+ static const int kFullStringLength = String::kMinNonFlatLength * 2;
+ static const int kSliceStringLength = String::kMinNonFlatLength + 1;
+
+ uint16_t* source = new uint16_t[kFullStringLength];
+ for (int i = 0; i < kFullStringLength; i++) source[i] = '1';
+ char* key = new char[kSliceStringLength];
+ for (int i = 0; i < kSliceStringLength; i++) key[i] = '1';
+
+ // Allocate an external string resource that keeps track of when it
+ // is destructed.
+ bool resource_destructed = false;
+ TwoByteResource* resource =
+ new TwoByteResource(source, kFullStringLength, &resource_destructed);
+
+ {
+ v8::HandleScope scope;
+
+ // Allocate an external string resource and external string. We
+ // have to go through the API to get the weak handle and the
+ // automatic destruction going.
+ Handle<String> string =
+ v8::Utils::OpenHandle(*v8::String::NewExternal(resource));
+
+ // Create a slice of the external string.
+ Handle<String> slice =
+ Factory::NewStringSlice(string, 0, kSliceStringLength);
+ CHECK_EQ(kSliceStringLength, slice->length());
+ CHECK(StringShape(*slice).IsSliced());
+
+ // Make sure the slice ends up in old space so we can morph it
+ // into a symbol.
+ while (Heap::InNewSpace(*slice)) {
+ Heap::PerformScavenge();
+ }
+
+ // Force the slice into the symbol table.
+ slice = Factory::SymbolFromString(slice);
+ CHECK(slice->IsSymbol());
+ CHECK(StringShape(*slice).IsSliced());
+
+ Handle<String> buffer(Handle<SlicedString>::cast(slice)->buffer());
+ CHECK(StringShape(*buffer).IsExternal());
+ CHECK(buffer->IsTwoByteRepresentation());
+
+ // Finally, base a script on the slice of the external string and
+ // get its wrapper. This allocated yet another weak handle that
+ // indirectly refers to the external string.
+ Handle<Script> script = Factory::NewScript(slice);
+ Handle<JSObject> wrapper = GetScriptWrapper(script);
+ }
+
+ // When we collect all garbage, we cannot get rid of the sliced
+ // symbol entry in the symbol table because it is used by the script
+ // kept alive by the weak wrapper. Make sure we don't destruct the
+ // external string.
+ Heap::CollectAllGarbage();
+ CHECK(!resource_destructed);
+
+ // Make sure the sliced symbol is still in the table.
+ v8::HandleScope scope;
+ Vector<const char> vector(key, kSliceStringLength);
+ Handle<String> symbol = Factory::LookupSymbol(vector);
+ CHECK(StringShape(*symbol).IsSliced());
+
+ // Make sure the buffer is still a two-byte external string.
+ Handle<String> buffer(Handle<SlicedString>::cast(symbol)->buffer());
+ CHECK(StringShape(*buffer).IsExternal());
+ CHECK(buffer->IsTwoByteRepresentation());
+
+ delete[] source;
+ delete[] key;
+}
diff --git a/test/cctest/test-version.cc b/test/cctest/test-version.cc
new file mode 100644
index 0000000..0b93fbf
--- /dev/null
+++ b/test/cctest/test-version.cc
@@ -0,0 +1,88 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "v8.h"
+
+#include "version.h"
+#include "cctest.h"
+
+using namespace v8::internal;
+
+
+namespace v8 { namespace internal {
+
+void SetVersion(int major, int minor, int build, int patch,
+ bool candidate, const char* soname) {
+ Version::major_ = major;
+ Version::minor_ = minor;
+ Version::build_ = build;
+ Version::patch_ = patch;
+ Version::candidate_ = candidate;
+ Version::soname_ = soname;
+}
+
+} } // namespace v8::internal
+
+
+static void CheckVersion(int major, int minor, int build,
+ int patch, bool candidate,
+ const char* expected_version_string,
+ const char* expected_generic_soname) {
+ static v8::internal::EmbeddedVector<char, 128> version_str;
+ static v8::internal::EmbeddedVector<char, 128> soname_str;
+
+ // Test version without specific SONAME.
+ SetVersion(major, minor, build, patch, candidate, "");
+ Version::GetString(version_str);
+ CHECK_EQ(expected_version_string, version_str.start());
+ Version::GetSONAME(soname_str);
+ CHECK_EQ(expected_generic_soname, soname_str.start());
+
+ // Test version with specific SONAME.
+ const char* soname = "libv8.so.1";
+ SetVersion(major, minor, build, patch, candidate, soname);
+ Version::GetString(version_str);
+ CHECK_EQ(expected_version_string, version_str.start());
+ Version::GetSONAME(soname_str);
+ CHECK_EQ(soname, soname_str.start());
+}
+
+
+TEST(VersionString) {
+ CheckVersion(0, 0, 0, 0, false, "0.0.0", "libv8-0.0.0.so");
+ CheckVersion(0, 0, 0, 0, true,
+ "0.0.0 (candidate)", "libv8-0.0.0-candidate.so");
+ CheckVersion(1, 0, 0, 0, false, "1.0.0", "libv8-1.0.0.so");
+ CheckVersion(1, 0, 0, 0, true,
+ "1.0.0 (candidate)", "libv8-1.0.0-candidate.so");
+ CheckVersion(1, 0, 0, 1, false, "1.0.0.1", "libv8-1.0.0.1.so");
+ CheckVersion(1, 0, 0, 1, true,
+ "1.0.0.1 (candidate)", "libv8-1.0.0.1-candidate.so");
+ CheckVersion(2, 5, 10, 7, false, "2.5.10.7", "libv8-2.5.10.7.so");
+ CheckVersion(2, 5, 10, 7, true,
+ "2.5.10.7 (candidate)", "libv8-2.5.10.7-candidate.so");
+}
diff --git a/test/mjsunit/array-sort.js b/test/mjsunit/array-sort.js
index dfa4590..ef75dcc 100644
--- a/test/mjsunit/array-sort.js
+++ b/test/mjsunit/array-sort.js
@@ -152,3 +152,191 @@
}
TestArraySortingWithUnsoundComparisonFunction();
+
+
+function TestSparseNonArraySorting(length) {
+ assertTrue(length > 101);
+ var obj = {length: length};
+ obj[0] = 42;
+ obj[10] = 37;
+ obj[100] = undefined;
+ obj[length - 1] = null;
+ Array.prototype.sort.call(obj);
+ assertEquals(length, obj.length, "objsort length unaffected");
+ assertEquals(37, obj[0], "objsort smallest number");
+ assertEquals(42, obj[1], "objsort largest number");
+ assertEquals(null, obj[2], "objsort null");
+ assertEquals(undefined, obj[3], "objsort undefined");
+ assertTrue(3 in obj, "objsort undefined retained");
+ assertFalse(4 in obj, "objsort non-existing retained");
+}
+
+TestSparseNonArraySorting(5000);
+TestSparseNonArraySorting(500000);
+TestSparseNonArraySorting(Math.pow(2, 31) + 1);
+
+
+function TestArrayLongerLength(length) {
+ var x = new Array(4);
+ x[0] = 42;
+ x[2] = 37;
+ x.length = length;
+ Array.prototype.sort.call(x);
+ assertEquals(length, x.length, "longlength length");
+ assertEquals(37, x[0], "longlength first");
+ assertEquals(42, x[1], "longlength second");
+ assertFalse(2 in x,"longlength third");
+}
+
+TestArrayLongerLength(4);
+TestArrayLongerLength(10);
+TestArrayLongerLength(1000);
+TestArrayLongerLength(500000);
+TestArrayLongerLength(Math.pow(2,32) - 1);
+
+
+function TestNonArrayLongerLength(length) {
+ var x = {};
+ x[0] = 42;
+ x[2] = 37;
+ x.length = length;
+ Array.prototype.sort.call(x);
+ assertEquals(length, x.length, "longlength length");
+ assertEquals(37, x[0], "longlength first");
+ assertEquals(42, x[1], "longlength second");
+ assertFalse(2 in x,"longlength third");
+}
+
+TestNonArrayLongerLength(4);
+TestNonArrayLongerLength(10);
+TestNonArrayLongerLength(1000);
+TestNonArrayLongerLength(500000);
+TestNonArrayLongerLength(Math.pow(2,32) - 1);
+
+
+function TestInheritedElementSort(depth) {
+ var length = depth * 2 + 3;
+ var obj = {length: length};
+ obj[depth * 2 + 1] = 0;
+ for (var i = 0; i < depth; i++) {
+ var newObj = {};
+ newObj.__proto__ = obj;
+ obj[i] = undefined;
+ obj[i + depth + 1] = depth - i;
+ obj = newObj;
+ }
+ // expected (inherited) object: [undef1,...undefdepth,hole,1,...,depth,0,hole]
+
+ Array.prototype.sort.call(obj, function(a,b) { return (b < a) - (a < b); });
+ // expected result: [0,1,...,depth,undef1,...,undefdepth,undef,hole]
+ var name = "SortInherit("+depth+")-";
+
+ assertEquals(length, obj.length, name+"length");
+ for (var i = 0; i <= depth; i++) {
+ assertTrue(obj.hasOwnProperty(i), name + "hasvalue" + i);
+ assertEquals(i, obj[i], name + "value" + i);
+ }
+ for (var i = depth + 1; i <= depth * 2 + 1; i++) {
+ assertEquals(undefined, obj[i], name + "undefined" + i);
+ assertTrue(obj.hasOwnProperty(i), name + "hasundefined" + i);
+ }
+ assertTrue(!obj.hasOwnProperty(depth * 2 + 2), name + "hashole");
+}
+
+TestInheritedElementSort(5);
+TestInheritedElementSort(15);
+
+function TestSparseInheritedElementSort(scale) {
+ var length = scale * 10;
+ var x = {length: length};
+ var y = {};
+ y.__proto__ = x;
+
+ for (var i = 0; i < 5; i++) {
+ x[i * 2 * scale] = 2 * (4 - i);
+ y[(i * 2 + 1) * scale] = 2 * (4 - i) + 1;
+ }
+
+ var name = "SparseSortInherit(" + scale + ")-";
+
+ Array.prototype.sort.call(y);
+
+ assertEquals(length, y.length, name +"length");
+
+ for (var i = 0; i < 10; i++) {
+ assertTrue(y.hasOwnProperty(i), name + "hasvalue" + i);
+ assertEquals(i, y[i], name + "value" + i);
+ }
+ for (var i = 10; i < length; i++) {
+ assertEquals(x.hasOwnProperty(i), y.hasOwnProperty(i),
+ name + "hasundef" + i);
+ assertEquals(undefined, y[i], name+"undefined"+i);
+ if (x.hasOwnProperty(i)) {
+ assertTrue(0 == i % (2 * scale), name + "new_x" + i);
+ }
+ }
+}
+
+TestSparseInheritedElementSort(10);
+TestSparseInheritedElementSort(100);
+TestSparseInheritedElementSort(1000);
+
+function TestSpecialCasesInheritedElementSort() {
+
+ var x = {
+ 1:"d1",
+ 2:"c1",
+ 3:"b1",
+ 4: undefined,
+ __proto__: {
+ length: 10000,
+ 1: "e2",
+ 10: "a2",
+ 100: "b2",
+ 1000: "c2",
+ 2000: undefined,
+ 8000: "d2",
+ 12000: "XX",
+ __proto__: {
+ 0: "e3",
+ 1: "d3",
+ 2: "c3",
+ 3: "b3",
+ 4: "f3",
+ 5: "a3",
+ 6: undefined,
+ }
+ }
+ };
+ Array.prototype.sort.call(x);
+
+ var name = "SpecialInherit-";
+
+ assertEquals(10000, x.length, name + "length");
+ var sorted = ["a2", "a3", "b1", "b2", "c1", "c2", "d1", "d2", "e3",
+ undefined, undefined, undefined];
+ for (var i = 0; i < sorted.length; i++) {
+ assertTrue(x.hasOwnProperty(i), name + "has" + i)
+ assertEquals(sorted[i], x[i], name + i);
+ }
+ assertFalse(x.hasOwnProperty(sorted.length), name + "haspost");
+ assertFalse(sorted.length in x, name + "haspost2");
+
+ assertTrue(x.hasOwnProperty(10), name + "hasundefined10");
+ assertEquals(undefined, x[10], name + "undefined10");
+ assertTrue(x.hasOwnProperty(100), name + "hasundefined100");
+ assertEquals(undefined, x[100], name + "undefined100");
+ assertTrue(x.hasOwnProperty(1000), name + "hasundefined1000");
+ assertEquals(undefined, x[1000], name + "undefined1000");
+ assertTrue(x.hasOwnProperty(2000), name + "hasundefined2000");
+ assertEquals(undefined, x[2000], name + "undefined2000");
+ assertTrue(x.hasOwnProperty(8000), name + "hasundefined8000");
+ assertEquals(undefined, x[8000], name + "undefined8000");
+
+ assertFalse(x.hasOwnProperty(12000), name + "has12000");
+ assertEquals("XX", x[12000], name + "XX12000");
+
+}
+
+TestSpecialCasesInheritedElementSort();
+
diff --git a/test/mjsunit/codegen_coverage.js b/test/mjsunit/codegen_coverage.js
new file mode 100644
index 0000000..d5e7769
--- /dev/null
+++ b/test/mjsunit/codegen_coverage.js
@@ -0,0 +1,91 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test the paths in the code generator where values in specific
+// registers get moved around so that the shift operation can use
+// register ECX on ia32 for the shift amount. Other codegen coverage
+// tests should go here too.
+
+
+
+function identity(x) {
+ return x;
+}
+
+function cover_codegen_paths() {
+ var x = 1;
+ var a; // Register EAX
+ var b; // Register EBX
+ var c; // Register ECX
+ var d; // Register EDX
+ // Register ESI is already used.
+ var di; // Register EDI
+
+ while (x == 1) {
+ x = identity(1);
+ a = x + 1;
+ c = x + 1;
+ d = x + 1;
+ b = x + 1;
+ di = x + 1;
+ // Locals are in the corresponding registers here.
+ assertEquals(c << a, 8);
+
+ x = identity(1);
+ a = x + 1;
+ c = x + 1;
+ d = x + 1;
+ b = x + 1;
+ di = x + 1;
+ // Locals are in the corresponding registers here.
+ assertEquals(a << c, 8);
+
+ x = identity(1);
+ a = x + 1;
+ c = x + 1;
+ d = x + 1;
+ b = x + 1;
+ di = x + 1;
+ // Locals are in the corresponding registers here.
+ c = 0; // Free register ecx.
+ assertEquals(a << d, 8);
+
+ x = identity(1);
+ a = x + 1;
+ c = x + 1;
+ d = x + 1;
+ b = x + 1;
+ di = x + 1;
+ // Locals are in the corresponding registers here.
+ b = 0; // Free register ebx.
+ assertEquals(a << d, 8);
+
+ x = 3;
+ }
+}
+
+cover_codegen_paths();
diff --git a/test/mjsunit/regress/regress-326.js b/test/mjsunit/regress/regress-326.js
new file mode 100644
index 0000000..fcd102e
--- /dev/null
+++ b/test/mjsunit/regress/regress-326.js
@@ -0,0 +1,40 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Should not crash or raise an exception.
+// Should sort non-array into equivalent of [37,42,undefined,,0]
+
+var nonArray = { length: 4, 0: 42, 2: 37, 3: undefined, 4: 0 };
+Array.prototype.sort.call(nonArray);
+
+assertEquals(4, nonArray.length, "preserve length");
+assertEquals(37, nonArray[0], "sort smallest first");
+assertEquals(42, nonArray[1], "sort largest last");
+assertTrue(2 in nonArray, "don't delete undefined");
+assertEquals(undefined, nonArray[2], "sort undefined after largest");
+assertFalse(3 in nonArray, "don't create non-existing");
+assertEquals(0, nonArray[4], "don't affect after length.");
diff --git a/test/mjsunit/smi-ops.js b/test/mjsunit/smi-ops.js
index 80d2012..7e57136 100644
--- a/test/mjsunit/smi-ops.js
+++ b/test/mjsunit/smi-ops.js
@@ -34,7 +34,7 @@
this.valueOf = function() { return 42; };
})();
-assertEquals(42, OBJ_42.valueOf());
+assertEquals(42, OBJ_42.valueOf());
function Add1(x) {
@@ -195,3 +195,393 @@
var x = 0x23; var y = 0x35;
assertEquals(0x16, x ^ y);
+
+// Test shift operators on non-smi inputs, giving smi and non-smi results.
+function testShiftNonSmis() {
+ var pos_non_smi = 2000000000;
+ var neg_non_smi = -pos_non_smi;
+ var pos_smi = 1000000000;
+ var neg_smi = -pos_smi;
+
+ // Begin block A
+ assertEquals(pos_non_smi, (pos_non_smi) >> 0);
+ assertEquals(pos_non_smi, (pos_non_smi) >>> 0);
+ assertEquals(pos_non_smi, (pos_non_smi) << 0);
+ assertEquals(neg_non_smi, (neg_non_smi) >> 0);
+ assertEquals(neg_non_smi + 0x100000000, (neg_non_smi) >>> 0);
+ assertEquals(neg_non_smi, (neg_non_smi) << 0);
+ assertEquals(pos_smi, (pos_smi) >> 0);
+ assertEquals(pos_smi, (pos_smi) >>> 0);
+ assertEquals(pos_smi, (pos_smi) << 0);
+ assertEquals(neg_smi, (neg_smi) >> 0);
+ assertEquals(neg_smi + 0x100000000, (neg_smi) >>> 0);
+ assertEquals(neg_smi, (neg_smi) << 0);
+
+ assertEquals(pos_non_smi / 2, (pos_non_smi) >> 1);
+ assertEquals(pos_non_smi / 2, (pos_non_smi) >>> 1);
+ assertEquals(-0x1194D800, (pos_non_smi) << 1);
+ assertEquals(pos_non_smi / 8, (pos_non_smi) >> 3);
+ assertEquals(pos_non_smi / 8, (pos_non_smi) >>> 3);
+ assertEquals(-0x46536000, (pos_non_smi) << 3);
+ assertEquals(0x73594000, (pos_non_smi) << 4);
+ assertEquals(pos_non_smi, (pos_non_smi + 0.5) >> 0);
+ assertEquals(pos_non_smi, (pos_non_smi + 0.5) >>> 0);
+ assertEquals(pos_non_smi, (pos_non_smi + 0.5) << 0);
+ assertEquals(pos_non_smi / 2, (pos_non_smi + 0.5) >> 1);
+ assertEquals(pos_non_smi / 2, (pos_non_smi + 0.5) >>> 1);
+ assertEquals(-0x1194D800, (pos_non_smi + 0.5) << 1);
+ assertEquals(pos_non_smi / 8, (pos_non_smi + 0.5) >> 3);
+ assertEquals(pos_non_smi / 8, (pos_non_smi + 0.5) >>> 3);
+ assertEquals(-0x46536000, (pos_non_smi + 0.5) << 3);
+ assertEquals(0x73594000, (pos_non_smi + 0.5) << 4);
+
+ assertEquals(neg_non_smi / 2, (neg_non_smi) >> 1);
+ assertEquals(neg_non_smi / 2 + 0x100000000 / 2, (neg_non_smi) >>> 1);
+ assertEquals(0x1194D800, (neg_non_smi) << 1);
+ assertEquals(neg_non_smi / 8, (neg_non_smi) >> 3);
+ assertEquals(neg_non_smi / 8 + 0x100000000 / 8, (neg_non_smi) >>> 3);
+ assertEquals(0x46536000, (neg_non_smi) << 3);
+ assertEquals(-0x73594000, (neg_non_smi) << 4);
+ assertEquals(neg_non_smi, (neg_non_smi - 0.5) >> 0);
+ assertEquals(neg_non_smi + 0x100000000, (neg_non_smi - 0.5) >>> 0);
+ assertEquals(neg_non_smi, (neg_non_smi - 0.5) << 0);
+ assertEquals(neg_non_smi / 2, (neg_non_smi - 0.5) >> 1);
+ assertEquals(neg_non_smi / 2 + 0x100000000 / 2, (neg_non_smi - 0.5) >>> 1);
+ assertEquals(0x1194D800, (neg_non_smi - 0.5) << 1);
+ assertEquals(neg_non_smi / 8, (neg_non_smi - 0.5) >> 3);
+ assertEquals(neg_non_smi / 8 + 0x100000000 / 8, (neg_non_smi - 0.5) >>> 3);
+ assertEquals(0x46536000, (neg_non_smi - 0.5) << 3);
+ assertEquals(-0x73594000, (neg_non_smi - 0.5) << 4);
+
+ assertEquals(pos_smi / 2, (pos_smi) >> 1);
+ assertEquals(pos_smi / 2, (pos_smi) >>> 1);
+ assertEquals(pos_non_smi, (pos_smi) << 1);
+ assertEquals(pos_smi / 8, (pos_smi) >> 3);
+ assertEquals(pos_smi / 8, (pos_smi) >>> 3);
+ assertEquals(-0x2329b000, (pos_smi) << 3);
+ assertEquals(0x73594000, (pos_smi) << 5);
+ assertEquals(pos_smi, (pos_smi + 0.5) >> 0);
+ assertEquals(pos_smi, (pos_smi + 0.5) >>> 0);
+ assertEquals(pos_smi, (pos_smi + 0.5) << 0);
+ assertEquals(pos_smi / 2, (pos_smi + 0.5) >> 1);
+ assertEquals(pos_smi / 2, (pos_smi + 0.5) >>> 1);
+ assertEquals(pos_non_smi, (pos_smi + 0.5) << 1);
+ assertEquals(pos_smi / 8, (pos_smi + 0.5) >> 3);
+ assertEquals(pos_smi / 8, (pos_smi + 0.5) >>> 3);
+ assertEquals(-0x2329b000, (pos_smi + 0.5) << 3);
+ assertEquals(0x73594000, (pos_smi + 0.5) << 5);
+
+ assertEquals(neg_smi / 2, (neg_smi) >> 1);
+ assertEquals(neg_smi / 2 + 0x100000000 / 2, (neg_smi) >>> 1);
+ assertEquals(neg_non_smi, (neg_smi) << 1);
+ assertEquals(neg_smi / 8, (neg_smi) >> 3);
+ assertEquals(neg_smi / 8 + 0x100000000 / 8, (neg_smi) >>> 3);
+ assertEquals(0x46536000, (neg_smi) << 4);
+ assertEquals(-0x73594000, (neg_smi) << 5);
+ assertEquals(neg_smi, (neg_smi - 0.5) >> 0);
+ assertEquals(neg_smi + 0x100000000, (neg_smi - 0.5) >>> 0);
+ assertEquals(neg_smi, (neg_smi - 0.5) << 0);
+ assertEquals(neg_smi / 2, (neg_smi - 0.5) >> 1);
+ assertEquals(neg_smi / 2 + 0x100000000 / 2, (neg_smi - 0.5) >>> 1);
+ assertEquals(neg_non_smi, (neg_smi - 0.5) << 1);
+ assertEquals(neg_smi / 8, (neg_smi - 0.5) >> 3);
+ assertEquals(neg_smi / 8 + 0x100000000 / 8, (neg_smi - 0.5) >>> 3);
+ assertEquals(0x46536000, (neg_smi - 0.5) << 4);
+ assertEquals(-0x73594000, (neg_smi - 0.5) << 5);
+ // End block A
+
+ // Repeat block A with 2^32 added to positive numbers and
+ // 2^32 subtracted from negative numbers.
+ // Begin block A repeat 1
+ var two_32 = 0x100000000;
+ var neg_32 = -two_32;
+ assertEquals(pos_non_smi, (two_32 + pos_non_smi) >> 0);
+ assertEquals(pos_non_smi, (two_32 + pos_non_smi) >>> 0);
+ assertEquals(pos_non_smi, (two_32 + pos_non_smi) << 0);
+ assertEquals(neg_non_smi, (neg_32 + neg_non_smi) >> 0);
+ assertEquals(neg_non_smi + 0x100000000, (neg_32 + neg_non_smi) >>> 0);
+ assertEquals(neg_non_smi, (neg_32 + neg_non_smi) << 0);
+ assertEquals(pos_smi, (two_32 + pos_smi) >> 0);
+ assertEquals(pos_smi, (two_32 + pos_smi) >>> 0);
+ assertEquals(pos_smi, (two_32 + pos_smi) << 0);
+ assertEquals(neg_smi, (neg_32 + neg_smi) >> 0);
+ assertEquals(neg_smi + 0x100000000, (neg_32 + neg_smi) >>> 0);
+ assertEquals(neg_smi, (neg_32 + neg_smi) << 0);
+
+ assertEquals(pos_non_smi / 2, (two_32 + pos_non_smi) >> 1);
+ assertEquals(pos_non_smi / 2, (two_32 + pos_non_smi) >>> 1);
+ assertEquals(-0x1194D800, (two_32 + pos_non_smi) << 1);
+ assertEquals(pos_non_smi / 8, (two_32 + pos_non_smi) >> 3);
+ assertEquals(pos_non_smi / 8, (two_32 + pos_non_smi) >>> 3);
+ assertEquals(-0x46536000, (two_32 + pos_non_smi) << 3);
+ assertEquals(0x73594000, (two_32 + pos_non_smi) << 4);
+ assertEquals(pos_non_smi, (two_32 + pos_non_smi + 0.5) >> 0);
+ assertEquals(pos_non_smi, (two_32 + pos_non_smi + 0.5) >>> 0);
+ assertEquals(pos_non_smi, (two_32 + pos_non_smi + 0.5) << 0);
+ assertEquals(pos_non_smi / 2, (two_32 + pos_non_smi + 0.5) >> 1);
+ assertEquals(pos_non_smi / 2, (two_32 + pos_non_smi + 0.5) >>> 1);
+ assertEquals(-0x1194D800, (two_32 + pos_non_smi + 0.5) << 1);
+ assertEquals(pos_non_smi / 8, (two_32 + pos_non_smi + 0.5) >> 3);
+ assertEquals(pos_non_smi / 8, (two_32 + pos_non_smi + 0.5) >>> 3);
+ assertEquals(-0x46536000, (two_32 + pos_non_smi + 0.5) << 3);
+ assertEquals(0x73594000, (two_32 + pos_non_smi + 0.5) << 4);
+
+ assertEquals(neg_non_smi / 2, (neg_32 + neg_non_smi) >> 1);
+ assertEquals(neg_non_smi / 2 + 0x100000000 / 2, (neg_32 + neg_non_smi) >>> 1);
+ assertEquals(0x1194D800, (neg_32 + neg_non_smi) << 1);
+ assertEquals(neg_non_smi / 8, (neg_32 + neg_non_smi) >> 3);
+ assertEquals(neg_non_smi / 8 + 0x100000000 / 8, (neg_32 + neg_non_smi) >>> 3);
+ assertEquals(0x46536000, (neg_32 + neg_non_smi) << 3);
+ assertEquals(-0x73594000, (neg_32 + neg_non_smi) << 4);
+ assertEquals(neg_non_smi, (neg_32 + neg_non_smi - 0.5) >> 0);
+ assertEquals(neg_non_smi + 0x100000000, (neg_32 + neg_non_smi - 0.5) >>> 0);
+ assertEquals(neg_non_smi, (neg_32 + neg_non_smi - 0.5) << 0);
+ assertEquals(neg_non_smi / 2, (neg_32 + neg_non_smi - 0.5) >> 1);
+ assertEquals(neg_non_smi / 2 + 0x100000000 / 2, (neg_32 + neg_non_smi - 0.5)
+ >>> 1);
+ assertEquals(0x1194D800, (neg_32 + neg_non_smi - 0.5) << 1);
+ assertEquals(neg_non_smi / 8, (neg_32 + neg_non_smi - 0.5) >> 3);
+ assertEquals(neg_non_smi / 8 + 0x100000000 / 8, (neg_32 + neg_non_smi - 0.5)
+ >>> 3);
+ assertEquals(0x46536000, (neg_32 + neg_non_smi - 0.5) << 3);
+ assertEquals(-0x73594000, (neg_32 + neg_non_smi - 0.5) << 4);
+
+ assertEquals(pos_smi / 2, (two_32 + pos_smi) >> 1);
+ assertEquals(pos_smi / 2, (two_32 + pos_smi) >>> 1);
+ assertEquals(pos_non_smi, (two_32 + pos_smi) << 1);
+ assertEquals(pos_smi / 8, (two_32 + pos_smi) >> 3);
+ assertEquals(pos_smi / 8, (two_32 + pos_smi) >>> 3);
+ assertEquals(-0x2329b000, (two_32 + pos_smi) << 3);
+ assertEquals(0x73594000, (two_32 + pos_smi) << 5);
+ assertEquals(pos_smi, (two_32 + pos_smi + 0.5) >> 0);
+ assertEquals(pos_smi, (two_32 + pos_smi + 0.5) >>> 0);
+ assertEquals(pos_smi, (two_32 + pos_smi + 0.5) << 0);
+ assertEquals(pos_smi / 2, (two_32 + pos_smi + 0.5) >> 1);
+ assertEquals(pos_smi / 2, (two_32 + pos_smi + 0.5) >>> 1);
+ assertEquals(pos_non_smi, (two_32 + pos_smi + 0.5) << 1);
+ assertEquals(pos_smi / 8, (two_32 + pos_smi + 0.5) >> 3);
+ assertEquals(pos_smi / 8, (two_32 + pos_smi + 0.5) >>> 3);
+ assertEquals(-0x2329b000, (two_32 + pos_smi + 0.5) << 3);
+ assertEquals(0x73594000, (two_32 + pos_smi + 0.5) << 5);
+
+ assertEquals(neg_smi / 2, (neg_32 + neg_smi) >> 1);
+ assertEquals(neg_smi / 2 + 0x100000000 / 2, (neg_32 + neg_smi) >>> 1);
+ assertEquals(neg_non_smi, (neg_32 + neg_smi) << 1);
+ assertEquals(neg_smi / 8, (neg_32 + neg_smi) >> 3);
+ assertEquals((neg_smi + 0x100000000) / 8, (neg_32 + neg_smi) >>> 3);
+ assertEquals(0x46536000, (neg_32 + neg_smi) << 4);
+ assertEquals(-0x73594000, (neg_32 + neg_smi) << 5);
+ assertEquals(neg_smi, (neg_32 + neg_smi - 0.5) >> 0);
+ assertEquals(neg_smi + 0x100000000, (neg_32 + neg_smi - 0.5) >>> 0);
+ assertEquals(neg_smi, (neg_32 + neg_smi - 0.5) << 0);
+ assertEquals(neg_smi / 2, (neg_32 + neg_smi - 0.5) >> 1);
+ assertEquals(neg_smi / 2 + 0x100000000 / 2, (neg_32 + neg_smi - 0.5) >>> 1);
+ assertEquals(neg_non_smi, (neg_32 + neg_smi - 0.5) << 1);
+ assertEquals(neg_smi / 8, (neg_32 + neg_smi - 0.5) >> 3);
+ assertEquals(neg_smi / 8 + 0x100000000 / 8, (neg_32 + neg_smi - 0.5) >>> 3);
+ assertEquals(0x46536000, (neg_32 + neg_smi - 0.5) << 4);
+ assertEquals(-0x73594000, (neg_32 + neg_smi - 0.5) << 5);
+ // End block A repeat 1
+ // Repeat block A with shift amounts in variables intialized with
+ // a constant.
+ var zero = 0;
+ var one = 1;
+ var three = 3;
+ var four = 4;
+ var five = 5;
+ // Begin block A repeat 2
+ assertEquals(pos_non_smi, (pos_non_smi) >> zero);
+ assertEquals(pos_non_smi, (pos_non_smi) >>> zero);
+ assertEquals(pos_non_smi, (pos_non_smi) << zero);
+ assertEquals(neg_non_smi, (neg_non_smi) >> zero);
+ assertEquals(neg_non_smi + 0x100000000, (neg_non_smi) >>> zero);
+ assertEquals(neg_non_smi, (neg_non_smi) << zero);
+ assertEquals(pos_smi, (pos_smi) >> zero);
+ assertEquals(pos_smi, (pos_smi) >>> zero);
+ assertEquals(pos_smi, (pos_smi) << zero);
+ assertEquals(neg_smi, (neg_smi) >> zero);
+ assertEquals(neg_smi + 0x100000000, (neg_smi) >>> zero);
+ assertEquals(neg_smi, (neg_smi) << zero);
+
+ assertEquals(pos_non_smi / 2, (pos_non_smi) >> one);
+ assertEquals(pos_non_smi / 2, (pos_non_smi) >>> one);
+ assertEquals(-0x1194D800, (pos_non_smi) << one);
+ assertEquals(pos_non_smi / 8, (pos_non_smi) >> three);
+ assertEquals(pos_non_smi / 8, (pos_non_smi) >>> three);
+ assertEquals(-0x46536000, (pos_non_smi) << three);
+ assertEquals(0x73594000, (pos_non_smi) << four);
+ assertEquals(pos_non_smi, (pos_non_smi + 0.5) >> zero);
+ assertEquals(pos_non_smi, (pos_non_smi + 0.5) >>> zero);
+ assertEquals(pos_non_smi, (pos_non_smi + 0.5) << zero);
+ assertEquals(pos_non_smi / 2, (pos_non_smi + 0.5) >> one);
+ assertEquals(pos_non_smi / 2, (pos_non_smi + 0.5) >>> one);
+ assertEquals(-0x1194D800, (pos_non_smi + 0.5) << one);
+ assertEquals(pos_non_smi / 8, (pos_non_smi + 0.5) >> three);
+ assertEquals(pos_non_smi / 8, (pos_non_smi + 0.5) >>> three);
+ assertEquals(-0x46536000, (pos_non_smi + 0.5) << three);
+ assertEquals(0x73594000, (pos_non_smi + 0.5) << four);
+
+ assertEquals(neg_non_smi / 2, (neg_non_smi) >> one);
+ assertEquals(neg_non_smi / 2 + 0x100000000 / 2, (neg_non_smi) >>> one);
+ assertEquals(0x1194D800, (neg_non_smi) << one);
+ assertEquals(neg_non_smi / 8, (neg_non_smi) >> three);
+ assertEquals(neg_non_smi / 8 + 0x100000000 / 8, (neg_non_smi) >>> three);
+ assertEquals(0x46536000, (neg_non_smi) << three);
+ assertEquals(-0x73594000, (neg_non_smi) << four);
+ assertEquals(neg_non_smi, (neg_non_smi - 0.5) >> zero);
+ assertEquals(neg_non_smi + 0x100000000, (neg_non_smi - 0.5) >>> zero);
+ assertEquals(neg_non_smi, (neg_non_smi - 0.5) << zero);
+ assertEquals(neg_non_smi / 2, (neg_non_smi - 0.5) >> one);
+ assertEquals(neg_non_smi / 2 + 0x100000000 / 2, (neg_non_smi - 0.5) >>> one);
+ assertEquals(0x1194D800, (neg_non_smi - 0.5) << one);
+ assertEquals(neg_non_smi / 8, (neg_non_smi - 0.5) >> three);
+ assertEquals(neg_non_smi / 8 + 0x100000000 / 8, (neg_non_smi - 0.5)
+ >>> three);
+ assertEquals(0x46536000, (neg_non_smi - 0.5) << three);
+ assertEquals(-0x73594000, (neg_non_smi - 0.5) << four);
+
+ assertEquals(pos_smi / 2, (pos_smi) >> one);
+ assertEquals(pos_smi / 2, (pos_smi) >>> one);
+ assertEquals(pos_non_smi, (pos_smi) << one);
+ assertEquals(pos_smi / 8, (pos_smi) >> three);
+ assertEquals(pos_smi / 8, (pos_smi) >>> three);
+ assertEquals(-0x2329b000, (pos_smi) << three);
+ assertEquals(0x73594000, (pos_smi) << five);
+ assertEquals(pos_smi, (pos_smi + 0.5) >> zero);
+ assertEquals(pos_smi, (pos_smi + 0.5) >>> zero);
+ assertEquals(pos_smi, (pos_smi + 0.5) << zero);
+ assertEquals(pos_smi / 2, (pos_smi + 0.5) >> one);
+ assertEquals(pos_smi / 2, (pos_smi + 0.5) >>> one);
+ assertEquals(pos_non_smi, (pos_smi + 0.5) << one);
+ assertEquals(pos_smi / 8, (pos_smi + 0.5) >> three);
+ assertEquals(pos_smi / 8, (pos_smi + 0.5) >>> three);
+ assertEquals(-0x2329b000, (pos_smi + 0.5) << three);
+ assertEquals(0x73594000, (pos_smi + 0.5) << five);
+
+ assertEquals(neg_smi / 2, (neg_smi) >> one);
+ assertEquals(neg_smi / 2 + 0x100000000 / 2, (neg_smi) >>> one);
+ assertEquals(neg_non_smi, (neg_smi) << one);
+ assertEquals(neg_smi / 8, (neg_smi) >> three);
+ assertEquals(neg_smi / 8 + 0x100000000 / 8, (neg_smi) >>> three);
+ assertEquals(0x46536000, (neg_smi) << four);
+ assertEquals(-0x73594000, (neg_smi) << five);
+ assertEquals(neg_smi, (neg_smi - 0.5) >> zero);
+ assertEquals(neg_smi + 0x100000000, (neg_smi - 0.5) >>> zero);
+ assertEquals(neg_smi, (neg_smi - 0.5) << zero);
+ assertEquals(neg_smi / 2, (neg_smi - 0.5) >> one);
+ assertEquals(neg_smi / 2 + 0x100000000 / 2, (neg_smi - 0.5) >>> one);
+ assertEquals(neg_non_smi, (neg_smi - 0.5) << one);
+ assertEquals(neg_smi / 8, (neg_smi - 0.5) >> three);
+ assertEquals(neg_smi / 8 + 0x100000000 / 8, (neg_smi - 0.5) >>> three);
+ assertEquals(0x46536000, (neg_smi - 0.5) << four);
+ assertEquals(-0x73594000, (neg_smi - 0.5) << five);
+ // End block A repeat 2
+
+ // Repeat previous block, with computed values in the shift variables.
+ five = 0;
+ while (five < 5 ) ++five;
+ four = five - one;
+ three = four - one;
+ one = four - three;
+ zero = one - one;
+
+ // Begin block A repeat 3
+ assertEquals(pos_non_smi, (pos_non_smi) >> zero);
+ assertEquals(pos_non_smi, (pos_non_smi) >>> zero);
+ assertEquals(pos_non_smi, (pos_non_smi) << zero);
+ assertEquals(neg_non_smi, (neg_non_smi) >> zero);
+ assertEquals(neg_non_smi + 0x100000000, (neg_non_smi) >>> zero);
+ assertEquals(neg_non_smi, (neg_non_smi) << zero);
+ assertEquals(pos_smi, (pos_smi) >> zero);
+ assertEquals(pos_smi, (pos_smi) >>> zero);
+ assertEquals(pos_smi, (pos_smi) << zero);
+ assertEquals(neg_smi, (neg_smi) >> zero);
+ assertEquals(neg_smi + 0x100000000, (neg_smi) >>> zero);
+ assertEquals(neg_smi, (neg_smi) << zero);
+
+ assertEquals(pos_non_smi / 2, (pos_non_smi) >> one);
+ assertEquals(pos_non_smi / 2, (pos_non_smi) >>> one);
+ assertEquals(-0x1194D800, (pos_non_smi) << one);
+ assertEquals(pos_non_smi / 8, (pos_non_smi) >> three);
+ assertEquals(pos_non_smi / 8, (pos_non_smi) >>> three);
+ assertEquals(-0x46536000, (pos_non_smi) << three);
+ assertEquals(0x73594000, (pos_non_smi) << four);
+ assertEquals(pos_non_smi, (pos_non_smi + 0.5) >> zero);
+ assertEquals(pos_non_smi, (pos_non_smi + 0.5) >>> zero);
+ assertEquals(pos_non_smi, (pos_non_smi + 0.5) << zero);
+ assertEquals(pos_non_smi / 2, (pos_non_smi + 0.5) >> one);
+ assertEquals(pos_non_smi / 2, (pos_non_smi + 0.5) >>> one);
+ assertEquals(-0x1194D800, (pos_non_smi + 0.5) << one);
+ assertEquals(pos_non_smi / 8, (pos_non_smi + 0.5) >> three);
+ assertEquals(pos_non_smi / 8, (pos_non_smi + 0.5) >>> three);
+ assertEquals(-0x46536000, (pos_non_smi + 0.5) << three);
+ assertEquals(0x73594000, (pos_non_smi + 0.5) << four);
+
+ assertEquals(neg_non_smi / 2, (neg_non_smi) >> one);
+ assertEquals(neg_non_smi / 2 + 0x100000000 / 2, (neg_non_smi) >>> one);
+ assertEquals(0x1194D800, (neg_non_smi) << one);
+ assertEquals(neg_non_smi / 8, (neg_non_smi) >> three);
+ assertEquals(neg_non_smi / 8 + 0x100000000 / 8, (neg_non_smi) >>> three);
+ assertEquals(0x46536000, (neg_non_smi) << three);
+ assertEquals(-0x73594000, (neg_non_smi) << four);
+ assertEquals(neg_non_smi, (neg_non_smi - 0.5) >> zero);
+ assertEquals(neg_non_smi + 0x100000000, (neg_non_smi - 0.5) >>> zero);
+ assertEquals(neg_non_smi, (neg_non_smi - 0.5) << zero);
+ assertEquals(neg_non_smi / 2, (neg_non_smi - 0.5) >> one);
+ assertEquals(neg_non_smi / 2 + 0x100000000 / 2, (neg_non_smi - 0.5) >>> one);
+ assertEquals(0x1194D800, (neg_non_smi - 0.5) << one);
+ assertEquals(neg_non_smi / 8, (neg_non_smi - 0.5) >> three);
+ assertEquals(neg_non_smi / 8 + 0x100000000 / 8, (neg_non_smi - 0.5)
+ >>> three);
+ assertEquals(0x46536000, (neg_non_smi - 0.5) << three);
+ assertEquals(-0x73594000, (neg_non_smi - 0.5) << four);
+
+ assertEquals(pos_smi / 2, (pos_smi) >> one);
+ assertEquals(pos_smi / 2, (pos_smi) >>> one);
+ assertEquals(pos_non_smi, (pos_smi) << one);
+ assertEquals(pos_smi / 8, (pos_smi) >> three);
+ assertEquals(pos_smi / 8, (pos_smi) >>> three);
+ assertEquals(-0x2329b000, (pos_smi) << three);
+ assertEquals(0x73594000, (pos_smi) << five);
+ assertEquals(pos_smi, (pos_smi + 0.5) >> zero);
+ assertEquals(pos_smi, (pos_smi + 0.5) >>> zero);
+ assertEquals(pos_smi, (pos_smi + 0.5) << zero);
+ assertEquals(pos_smi / 2, (pos_smi + 0.5) >> one);
+ assertEquals(pos_smi / 2, (pos_smi + 0.5) >>> one);
+ assertEquals(pos_non_smi, (pos_smi + 0.5) << one);
+ assertEquals(pos_smi / 8, (pos_smi + 0.5) >> three);
+ assertEquals(pos_smi / 8, (pos_smi + 0.5) >>> three);
+ assertEquals(-0x2329b000, (pos_smi + 0.5) << three);
+ assertEquals(0x73594000, (pos_smi + 0.5) << five);
+
+ assertEquals(neg_smi / 2, (neg_smi) >> one);
+ assertEquals(neg_smi / 2 + 0x100000000 / 2, (neg_smi) >>> one);
+ assertEquals(neg_non_smi, (neg_smi) << one);
+ assertEquals(neg_smi / 8, (neg_smi) >> three);
+ assertEquals(neg_smi / 8 + 0x100000000 / 8, (neg_smi) >>> three);
+ assertEquals(0x46536000, (neg_smi) << four);
+ assertEquals(-0x73594000, (neg_smi) << five);
+ assertEquals(neg_smi, (neg_smi - 0.5) >> zero);
+ assertEquals(neg_smi + 0x100000000, (neg_smi - 0.5) >>> zero);
+ assertEquals(neg_smi, (neg_smi - 0.5) << zero);
+ assertEquals(neg_smi / 2, (neg_smi - 0.5) >> one);
+ assertEquals(neg_smi / 2 + 0x100000000 / 2, (neg_smi - 0.5) >>> one);
+ assertEquals(neg_non_smi, (neg_smi - 0.5) << one);
+ assertEquals(neg_smi / 8, (neg_smi - 0.5) >> three);
+ assertEquals(neg_smi / 8 + 0x100000000 / 8, (neg_smi - 0.5) >>> three);
+ assertEquals(0x46536000, (neg_smi - 0.5) << four);
+ assertEquals(-0x73594000, (neg_smi - 0.5) << five);
+ // End block A repeat 3
+
+ // Test non-integer shift value
+ assertEquals(5, 20.5 >> 2.4);
+ assertEquals(5, 20.5 >> 2.7);
+ var shift = 2.4;
+ assertEquals(5, 20.5 >> shift);
+ assertEquals(5, 20.5 >> shift + 0.3);
+ shift = shift + zero;
+ assertEquals(5, 20.5 >> shift);
+ assertEquals(5, 20.5 >> shift + 0.3);
+}
+
+testShiftNonSmis();
diff --git a/test/mjsunit/tools/codemap.js b/test/mjsunit/tools/codemap.js
index 7f344a6..fdad819 100644
--- a/test/mjsunit/tools/codemap.js
+++ b/test/mjsunit/tools/codemap.js
@@ -114,3 +114,13 @@
assertNoEntry(codeMap, 0x1700);
assertEntry(codeMap, 'code1', 0x1800);
})();
+
+
+(function testDynamicNamesDuplicates() {
+ var codeMap = new devtools.profiler.CodeMap();
+ // Code entries with same names but different addresses.
+ codeMap.addCode(0x1500, newCodeEntry(0x200, 'code'));
+ codeMap.addCode(0x1700, newCodeEntry(0x100, 'code'));
+ assertEntry(codeMap, 'code', 0x1500);
+ assertEntry(codeMap, 'code {1}', 0x1700);
+})();
diff --git a/test/mjsunit/tools/consarray.js b/test/mjsunit/tools/consarray.js
new file mode 100644
index 0000000..8b2c59b
--- /dev/null
+++ b/test/mjsunit/tools/consarray.js
@@ -0,0 +1,60 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Load ConsArray implementation from <project root>/tools.
+// Files: tools/consarray.js
+
+
+var arr1 = new ConsArray();
+assertTrue(arr1.atEnd());
+
+arr1.concat([]);
+assertTrue(arr1.atEnd());
+
+arr1.concat([1]);
+assertFalse(arr1.atEnd());
+assertEquals(1, arr1.next());
+assertTrue(arr1.atEnd());
+
+arr1.concat([2, 3, 4]);
+arr1.concat([5]);
+arr1.concat([]);
+arr1.concat([6, 7]);
+
+assertFalse(arr1.atEnd());
+assertEquals(2, arr1.next());
+assertFalse(arr1.atEnd());
+assertEquals(3, arr1.next());
+assertFalse(arr1.atEnd());
+assertEquals(4, arr1.next());
+assertFalse(arr1.atEnd());
+assertEquals(5, arr1.next());
+assertFalse(arr1.atEnd());
+assertEquals(6, arr1.next());
+assertFalse(arr1.atEnd());
+assertEquals(7, arr1.next());
+assertTrue(arr1.atEnd());
diff --git a/test/mjsunit/tools/profile.js b/test/mjsunit/tools/profile.js
index 4a93860..49eef3b 100644
--- a/test/mjsunit/tools/profile.js
+++ b/test/mjsunit/tools/profile.js
@@ -26,7 +26,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Load source code files from <project root>/tools.
-// Files: tools/splaytree.js tools/codemap.js tools/profile.js
+// Files: tools/splaytree.js tools/codemap.js tools/consarray.js tools/profile.js
function stackToString(stack) {
@@ -124,6 +124,10 @@
this.leave();
this.leave();
this.leave();
+ this.enter('lib2-f1');
+ this.enter('lib1-f1');
+ this.leave();
+ this.leave();
this.stay();
this.leave();
};
@@ -149,14 +153,14 @@
Driver.prototype.enter = function(func) {
this.namesTopDown.push(func);
this.namesBottomUp.unshift(func);
- assertNoPathExists(this.profile.getTopDownTreeRoot(), this.namesTopDown,
+ assertNoPathExists(this.profile.getTopDownProfile().getRoot(), this.namesTopDown,
'pre enter/topDown');
- assertNoPathExists(this.profile.getBottomUpTreeRoot(), this.namesBottomUp,
+ assertNoPathExists(this.profile.getBottomUpProfile().getRoot(), this.namesBottomUp,
'pre enter/bottomUp');
Driver.superClass_.enter.call(this, func);
- assertPathExists(this.profile.getTopDownTreeRoot(), this.namesTopDown,
+ assertPathExists(this.profile.getTopDownProfile().getRoot(), this.namesTopDown,
'post enter/topDown');
- assertPathExists(this.profile.getBottomUpTreeRoot(), this.namesBottomUp,
+ assertPathExists(this.profile.getBottomUpProfile().getRoot(), this.namesBottomUp,
'post enter/bottomUp');
};
@@ -196,8 +200,8 @@
testDriver.execute();
var pathWeights = [
- [['lib1-f1'], 1, 14],
- [['lib1-f1', 'lib1-f2'], 2, 13],
+ [['lib1-f1'], 1, 16],
+ [['lib1-f1', 'lib1-f2'], 2, 15],
[['lib1-f1', 'lib1-f2', 'T: F1'], 2, 11],
[['lib1-f1', 'lib1-f2', 'T: F1', 'T: F2'], 1, 1],
[['lib1-f1', 'lib1-f2', 'T: F1', 'lib2-f1'], 2, 3],
@@ -205,10 +209,12 @@
[['lib1-f1', 'lib1-f2', 'T: F1', 'T: F3'], 1, 5],
[['lib1-f1', 'lib1-f2', 'T: F1', 'T: F3', 'T: F3'], 1, 4],
[['lib1-f1', 'lib1-f2', 'T: F1', 'T: F3', 'T: F3', 'T: F3'], 1, 1],
- [['lib1-f1', 'lib1-f2', 'T: F1', 'T: F3', 'T: F3', 'T: F2'], 2, 2]
+ [['lib1-f1', 'lib1-f2', 'T: F1', 'T: F3', 'T: F3', 'T: F2'], 2, 2],
+ [['lib1-f1', 'lib1-f2', 'lib2-f1'], 1, 2],
+ [['lib1-f1', 'lib1-f2', 'lib2-f1', 'lib1-f1'], 1, 1]
];
- var root = testDriver.profile.getTopDownTreeRoot();
+ var root = testDriver.profile.getTopDownProfile().getRoot();
for (var i = 0; i < pathWeights.length; ++i) {
var data = pathWeights[i];
assertNodeWeights(root, data[0], data[1], data[2]);
@@ -221,6 +227,7 @@
ProfileTestDriver.call(this);
this.namesTopDown = [''];
this.counters = {};
+ this.root = null;
};
Inherits(Driver, ProfileTestDriver);
@@ -262,16 +269,26 @@
this.namesTopDown.pop();
};
+ Driver.prototype.extractRoot = function() {
+ assertTrue('' in this.counters);
+ this.root = this.counters[''];
+ delete this.counters[''];
+ };
+
var testDriver = new Driver();
testDriver.execute();
+ testDriver.extractRoot();
var counted = 0;
for (var c in testDriver.counters) {
counted++;
}
- var flatProfile =
- testDriver.profile.getFlatProfile().getRoot().exportChildren();
+ var flatProfileRoot = testDriver.profile.getFlatProfile().getRoot();
+ assertEquals(testDriver.root.self, flatProfileRoot.selfWeight);
+ assertEquals(testDriver.root.total, flatProfileRoot.totalWeight);
+
+ var flatProfile = flatProfileRoot.exportChildren();
assertEquals(counted, flatProfile.length, 'counted vs. flatProfile');
for (var i = 0; i < flatProfile.length; ++i) {
var rec = flatProfile[i];
@@ -282,3 +299,50 @@
}
})();
+
+
+(function testFunctionCalleesProfileTicks() {
+ var testDriver = new ProfileTestDriver();
+ testDriver.execute();
+
+ var pathWeights = [
+ [['lib2-f1'], 3, 5],
+ [['lib2-f1', 'lib2-f1'], 1, 1],
+ [['lib2-f1', 'lib1-f1'], 1, 1]
+ ];
+
+ var profile = testDriver.profile.getTopDownProfile('lib2-f1');
+ var root = profile.getRoot();
+ for (var i = 0; i < pathWeights.length; ++i) {
+ var data = pathWeights[i];
+ assertNodeWeights(root, data[0], data[1], data[2]);
+ }
+})();
+
+
+(function testFunctionFlatProfileTicks() {
+ var testDriver = new ProfileTestDriver();
+ testDriver.execute();
+
+ var flatWeights = {
+ 'lib2-f1': [1, 1],
+ 'lib1-f1': [1, 1]
+ };
+
+ var flatProfileRoot =
+ testDriver.profile.getFlatProfile('lib2-f1').findOrAddChild('lib2-f1');
+ assertEquals(3, flatProfileRoot.selfWeight);
+ assertEquals(5, flatProfileRoot.totalWeight);
+
+ var flatProfile = flatProfileRoot.exportChildren();
+ assertEquals(2, flatProfile.length, 'counted vs. flatProfile');
+ for (var i = 0; i < flatProfile.length; ++i) {
+ var rec = flatProfile[i];
+ assertTrue(rec.label in flatWeights, 'uncounted: ' + rec.label);
+ var reference = flatWeights[rec.label];
+ assertEquals(reference[0], rec.selfWeight, 'self of ' + rec.label);
+ assertEquals(reference[1], rec.totalWeight, 'total of ' + rec.label);
+ }
+
+})();
+
diff --git a/test/mjsunit/tools/profileview.js b/test/mjsunit/tools/profile_view.js
similarity index 97%
rename from test/mjsunit/tools/profileview.js
rename to test/mjsunit/tools/profile_view.js
index d70c30d..3ed1128 100644
--- a/test/mjsunit/tools/profileview.js
+++ b/test/mjsunit/tools/profile_view.js
@@ -26,7 +26,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Load source code files from <project root>/tools.
-// Files: tools/profile.js tools/profileview.js
+// Files: tools/consarray.js tools/profile.js tools/profile_view.js
function createNode(name, time, opt_parent) {
diff --git a/tools/codemap.js b/tools/codemap.js
index 5149cfc..32e03d6 100644
--- a/tools/codemap.js
+++ b/tools/codemap.js
@@ -47,6 +47,8 @@
*/
this.deleted_ = [];
+ this.dynamicsNameGen_ = new devtools.profiler.CodeMap.NameGenerator();
+
/**
* Static code entries. Used for libraries code.
*/
@@ -79,6 +81,8 @@
* @param {devtools.profiler.CodeMap.CodeEntry} codeEntry Code entry object.
*/
devtools.profiler.CodeMap.prototype.addCode = function(start, codeEntry) {
+ var entryName = this.dynamicsNameGen_.getName(codeEntry.name);
+ codeEntry.name = entryName;
this.dynamics_.insert(start, codeEntry);
};
@@ -204,7 +208,22 @@
return this.name;
};
-
+
devtools.profiler.CodeMap.CodeEntry.prototype.toString = function() {
return this.name + ': ' + this.size.toString(16);
};
+
+
+devtools.profiler.CodeMap.NameGenerator = function() {
+ this.knownNames_ = [];
+};
+
+
+devtools.profiler.CodeMap.NameGenerator.prototype.getName = function(name) {
+ if (!(name in this.knownNames_)) {
+ this.knownNames_[name] = 0;
+ return name;
+ }
+ var count = ++this.knownNames_[name];
+ return name + ' {' + count + '}';
+};
diff --git a/tools/consarray.js b/tools/consarray.js
new file mode 100644
index 0000000..c67abb7
--- /dev/null
+++ b/tools/consarray.js
@@ -0,0 +1,93 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+/**
+ * Constructs a ConsArray object. It is used mainly for tree traversal.
+ * In this use case we have lots of arrays that we need to iterate
+ * sequentally. The internal Array implementation is horribly slow
+ * when concatenating on large (10K items) arrays due to memory copying.
+ * That's why we avoid copying memory and insead build a linked list
+ * of arrays to iterate through.
+ *
+ * @constructor
+ */
+function ConsArray() {
+ this.tail_ = new ConsArray.Cell(null, null);
+ this.currCell_ = this.tail_;
+ this.currCellPos_ = 0;
+};
+
+
+/**
+ * Concatenates another array for iterating. Empty arrays are ignored.
+ * This operation can be safely performed during ongoing ConsArray
+ * iteration.
+ *
+ * @param {Array} arr Array to concatenate.
+ */
+ConsArray.prototype.concat = function(arr) {
+ if (arr.length > 0) {
+ this.tail_.data = arr;
+ this.tail_ = this.tail_.next = new ConsArray.Cell(null, null);
+ }
+};
+
+
+/**
+ * Whether the end of iteration is reached.
+ */
+ConsArray.prototype.atEnd = function() {
+ return this.currCell_ === null ||
+ this.currCell_.data === null ||
+ this.currCellPos_ >= this.currCell_.data.length;
+};
+
+
+/**
+ * Returns the current item, moves to the next one.
+ */
+ConsArray.prototype.next = function() {
+ var result = this.currCell_.data[this.currCellPos_++];
+ if (this.currCellPos_ >= this.currCell_.data.length) {
+ this.currCell_ = this.currCell_.next;
+ this.currCellPos_ = 0;
+ }
+ return result;
+};
+
+
+/**
+ * A cell object used for constructing a list in ConsArray.
+ *
+ * @constructor
+ */
+ConsArray.Cell = function(data, next) {
+ this.data = data;
+ this.next = next;
+};
+
diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp
index aa45e0b..f8d9043 100644
--- a/tools/gyp/v8.gyp
+++ b/tools/gyp/v8.gyp
@@ -242,6 +242,8 @@
'../../src/v8threads.h',
'../../src/variables.cc',
'../../src/variables.h',
+ '../../src/version.cc',
+ '../../src/version.h',
'../../src/virtual-frame.h',
'../../src/virtual-frame.cc',
'../../src/zone-inl.h',
@@ -400,6 +402,9 @@
{
'target_name': 'v8_base',
'type': '<(library)',
+ 'defines': [
+ 'V8_ARCH_IA32'
+ ],
'include_dirs+': [
'../../src',
'../../src/ia32',
@@ -455,6 +460,9 @@
{
'target_name': 'v8_nosnapshot',
'type': '<(library)',
+ 'defines': [
+ 'V8_ARCH_IA32'
+ ],
'dependencies': [
'js2c',
'v8_base',
@@ -484,6 +492,9 @@
{
'target_name': 'v8',
'type': '<(library)',
+ 'defines': [
+ 'V8_ARCH_IA32'
+ ],
'dependencies': [
'js2c',
'mksnapshot',
@@ -521,6 +532,9 @@
{
'target_name': 'v8_shell',
'type': 'executable',
+ 'defines': [
+ 'V8_ARCH_IA32'
+ ],
'dependencies': [
'v8',
],
@@ -548,6 +562,9 @@
'd8_js2c',
'v8',
],
+ 'defines': [
+ 'V8_ARCH_IA32'
+ ],
'include_dirs': [
'../../src',
],
@@ -585,7 +602,7 @@
'js2c',
],
'defines': [
- 'ARM',
+ 'V8_ARCH_ARM',
],
'include_dirs+': [
'../../src',
@@ -643,7 +660,7 @@
'v8_arm',
],
'defines': [
- 'ARM',
+ 'V8_ARCH_ARM',
],
'sources': [
'../../samples/shell.cc',
@@ -663,7 +680,7 @@
'v8_arm',
],
'defines': [
- 'ARM',
+ 'V8_ARCH_ARM',
],
'include_dirs': [
'../../src',
diff --git a/tools/linux-tick-processor b/tools/linux-tick-processor
new file mode 100644
index 0000000..0ad295f
--- /dev/null
+++ b/tools/linux-tick-processor
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+tools_dir=$(dirname "$0")
+
+if [ "$1" != "--no-build" ]
+then
+ scons -C $tools_dir/.. d8
+else
+ shift
+fi
+
+# nm spits out 'no symbols found' messages on stderr
+$tools_dir/../d8 $tools_dir/splaytree.js $tools_dir/codemap.js \
+ $tools_dir/csvparser.js $tools_dir/consarray.js \
+ $tools_dir/profile.js $tools_dir/profile_view.js \
+ $tools_dir/tickprocessor.js -- $@ 2>/dev/null
diff --git a/tools/profile.js b/tools/profile.js
index d2b5322..614c635 100644
--- a/tools/profile.js
+++ b/tools/profile.js
@@ -185,25 +185,7 @@
/**
- * Returns the root of the top down call graph.
- */
-devtools.profiler.Profile.prototype.getTopDownTreeRoot = function() {
- this.topDownTree_.computeTotalWeights();
- return this.topDownTree_.getRoot();
-};
-
-
-/**
- * Returns the root of the bottom up call graph.
- */
-devtools.profiler.Profile.prototype.getBottomUpTreeRoot = function() {
- this.bottomUpTree_.computeTotalWeights();
- return this.bottomUpTree_.getRoot();
-};
-
-
-/**
- * Traverses the top down call graph in preorder.
+ * Performs a BF traversal of the top down call graph.
*
* @param {function(devtools.profiler.CallTree.Node)} f Visitor function.
*/
@@ -213,7 +195,7 @@
/**
- * Traverses the bottom up call graph in preorder.
+ * Performs a BF traversal of the bottom up call graph.
*
* @param {function(devtools.profiler.CallTree.Node)} f Visitor function.
*/
@@ -223,60 +205,96 @@
/**
- * Calculates a top down profile starting from the specified node.
+ * Calculates a top down profile for a node with the specified label.
+ * If no name specified, returns the whole top down calls tree.
*
- * @param {devtools.profiler.CallTree.Node} opt_root Starting node.
+ * @param {string} opt_label Node label.
*/
-devtools.profiler.Profile.prototype.getTopDownProfile = function(opt_root) {
- if (!opt_root) {
- this.topDownTree_.computeTotalWeights();
- return this.topDownTree_;
+devtools.profiler.Profile.prototype.getTopDownProfile = function(opt_label) {
+ return this.getTreeProfile_(this.topDownTree_, opt_label);
+};
+
+
+/**
+ * Calculates a bottom up profile for a node with the specified label.
+ * If no name specified, returns the whole bottom up calls tree.
+ *
+ * @param {string} opt_label Node label.
+ */
+devtools.profiler.Profile.prototype.getBottomUpProfile = function(opt_label) {
+ return this.getTreeProfile_(this.bottomUpTree_, opt_label);
+};
+
+
+/**
+ * Helper function for calculating a tree profile.
+ *
+ * @param {devtools.profiler.Profile.CallTree} tree Call tree.
+ * @param {string} opt_label Node label.
+ */
+devtools.profiler.Profile.prototype.getTreeProfile_ = function(tree, opt_label) {
+ if (!opt_label) {
+ tree.computeTotalWeights();
+ return tree;
} else {
- throw Error('not implemented');
+ var subTree = tree.cloneSubtree(opt_label);
+ subTree.computeTotalWeights();
+ return subTree;
}
};
/**
- * Calculates a bottom up profile starting from the specified node.
+ * Calculates a flat profile of callees starting from a node with
+ * the specified label. If no name specified, starts from the root.
*
- * @param {devtools.profiler.CallTree.Node} opt_root Starting node.
+ * @param {string} opt_label Starting node label.
*/
-devtools.profiler.Profile.prototype.getBottomUpProfile = function(opt_root) {
- if (!opt_root) {
- this.bottomUpTree_.computeTotalWeights();
- return this.bottomUpTree_;
- } else {
- throw Error('not implemented');
- }
-};
-
-
-/**
- * Calculates a flat profile of callees starting from the specified node.
- *
- * @param {devtools.profiler.CallTree.Node} opt_root Starting node.
- */
-devtools.profiler.Profile.prototype.getFlatProfile = function(opt_root) {
+devtools.profiler.Profile.prototype.getFlatProfile = function(opt_label) {
var counters = new devtools.profiler.CallTree();
+ var rootLabel = opt_label || devtools.profiler.CallTree.ROOT_NODE_LABEL;
var precs = {};
+ precs[rootLabel] = 0;
+ var root = counters.findOrAddChild(rootLabel);
+
this.topDownTree_.computeTotalWeights();
this.topDownTree_.traverseInDepth(
function onEnter(node) {
if (!(node.label in precs)) {
precs[node.label] = 0;
}
- var rec = counters.findOrAddChild(node.label);
- rec.selfWeight += node.selfWeight;
- if (precs[node.label] == 0) {
- rec.totalWeight += node.totalWeight;
+ var nodeLabelIsRootLabel = node.label == rootLabel;
+ if (nodeLabelIsRootLabel || precs[rootLabel] > 0) {
+ if (precs[rootLabel] == 0) {
+ root.selfWeight += node.selfWeight;
+ root.totalWeight += node.totalWeight;
+ } else {
+ var rec = root.findOrAddChild(node.label);
+ rec.selfWeight += node.selfWeight;
+ if (nodeLabelIsRootLabel || precs[node.label] == 0) {
+ rec.totalWeight += node.totalWeight;
+ }
+ }
+ precs[node.label]++;
}
- precs[node.label]++;
},
function onExit(node) {
- precs[node.label]--;
+ if (node.label == rootLabel || precs[rootLabel] > 0) {
+ precs[node.label]--;
+ }
},
- opt_root);
+ null);
+
+ if (!opt_label) {
+ // If we have created a flat profile for the whole program, we don't
+ // need an explicit root in it. Thus, replace the counters tree
+ // root with the node corresponding to the whole program.
+ counters.root_ = root;
+ } else {
+ // Propagate weights so percents can be calculated correctly.
+ counters.getRoot().selfWeight = root.selfWeight;
+ counters.getRoot().totalWeight = root.totalWeight;
+ }
return counters;
};
@@ -316,11 +334,18 @@
* @constructor
*/
devtools.profiler.CallTree = function() {
- this.root_ = new devtools.profiler.CallTree.Node('');
+ this.root_ = new devtools.profiler.CallTree.Node(
+ devtools.profiler.CallTree.ROOT_NODE_LABEL);
};
/**
+ * The label of the root node.
+ */
+devtools.profiler.CallTree.ROOT_NODE_LABEL = '';
+
+
+/**
* @private
*/
devtools.profiler.CallTree.prototype.totalsComputed_ = false;
@@ -359,10 +384,38 @@
*
* @param {string} label Child node label.
*/
-devtools.profiler.CallTree.prototype.findOrAddChild = function(
- label, opt_parent) {
- var parent = opt_parent || this.root_;
- return parent.findOrAddChild(label);
+devtools.profiler.CallTree.prototype.findOrAddChild = function(label) {
+ return this.root_.findOrAddChild(label);
+};
+
+
+/**
+ * Creates a subtree by cloning and merging all subtrees rooted at nodes
+ * with a given label. E.g. cloning the following call tree on label 'A'
+ * will give the following result:
+ *
+ * <A>--<B> <B>
+ * / /
+ * <root> == clone on 'A' ==> <root>--<A>
+ * \ \
+ * <C>--<A>--<D> <D>
+ *
+ * And <A>'s selfWeight will be the sum of selfWeights of <A>'s from the
+ * source call tree.
+ *
+ * @param {string} label The label of the new root node.
+ */
+devtools.profiler.CallTree.prototype.cloneSubtree = function(label) {
+ var subTree = new devtools.profiler.CallTree();
+ this.traverse(function(node, parent) {
+ if (!parent && node.label != label) {
+ return null;
+ }
+ var child = (parent ? parent : subTree).findOrAddChild(node.label);
+ child.selfWeight += node.selfWeight;
+ return child;
+ });
+ return subTree;
};
@@ -392,17 +445,18 @@
*
* @param {function(devtools.profiler.CallTree.Node, *)} f Visitor function.
* The second parameter is the result of calling 'f' on the parent node.
- * @param {devtools.profiler.CallTree.Node} opt_start Starting node.
*/
-devtools.profiler.CallTree.prototype.traverse = function(f, opt_start) {
- var pairsToProcess = [{node: opt_start || this.root_, param: null}];
- while (pairsToProcess.length > 0) {
- var pair = pairsToProcess.shift();
+devtools.profiler.CallTree.prototype.traverse = function(f) {
+ var pairsToProcess = new ConsArray();
+ pairsToProcess.concat([{node: this.root_, param: null}]);
+ while (!pairsToProcess.atEnd()) {
+ var pair = pairsToProcess.next();
var node = pair.node;
var newParam = f(node, pair.param);
- node.forEachChild(
- function (child) { pairsToProcess.push({node: child, param: newParam}); }
- );
+ var morePairsToProcess = [];
+ node.forEachChild(function (child) {
+ morePairsToProcess.push({node: child, param: newParam}); });
+ pairsToProcess.concat(morePairsToProcess);
}
};
@@ -414,16 +468,14 @@
* prior to visiting node's children.
* @param {function(devtools.profiler.CallTree.Node)} exit A function called
* after visiting node's children.
- * @param {devtools.profiler.CallTree.Node} opt_start Starting node.
*/
-devtools.profiler.CallTree.prototype.traverseInDepth = function(
- enter, exit, opt_start) {
+devtools.profiler.CallTree.prototype.traverseInDepth = function(enter, exit) {
function traverse(node) {
enter(node);
node.forEachChild(traverse);
exit(node);
}
- traverse(opt_start || this.root_);
+ traverse(this.root_);
};
@@ -505,8 +557,7 @@
*
* @param {string} label Child node label.
*/
-devtools.profiler.CallTree.Node.prototype.findOrAddChild = function(
- label) {
+devtools.profiler.CallTree.Node.prototype.findOrAddChild = function(label) {
return this.findChild(label) || this.addChild(label);
};
diff --git a/tools/profileview.js b/tools/profile_view.js
similarity index 60%
rename from tools/profileview.js
rename to tools/profile_view.js
index 53ef6d9..cd0511f 100644
--- a/tools/profileview.js
+++ b/tools/profile_view.js
@@ -77,6 +77,26 @@
*/
devtools.profiler.ProfileView = function(head) {
this.head = head;
+ this.title = '';
+ this.uid = '';
+ this.heavyProfile = null;
+ this.treeProfile = null;
+ this.flatProfile = null;
+};
+
+
+/**
+ * Updates references between profiles. This is needed for WebKit
+ * ProfileView.
+ */
+devtools.profiler.ProfileView.prototype.updateProfilesRefs = function() {
+ var profileNames = ["treeProfile", "heavyProfile", "flatProfile"];
+ for (var i = 0; i < profileNames.length; ++i) {
+ var destProfile = this[profileNames[i]];
+ for (var j = 0; j < profileNames.length; ++j) {
+ destProfile[profileNames[j]] = this[profileNames[j]];
+ }
+ }
};
@@ -95,16 +115,84 @@
/**
+ * Sorts the profile view by self time, ascending.
+ */
+devtools.profiler.ProfileView.prototype.sortSelfTimeAscending = function() {
+ this.sort(function (node1, node2) {
+ return node1.selfTime - node2.selfTime; });
+};
+
+
+/**
+ * Sorts the profile view by self time, descending.
+ */
+devtools.profiler.ProfileView.prototype.sortSelfTimeDescending = function() {
+ this.sort(function (node1, node2) {
+ return node2.selfTime - node1.selfTime; });
+};
+
+
+/**
+ * Sorts the profile view by total time, ascending.
+ */
+devtools.profiler.ProfileView.prototype.sortTotalTimeAscending = function() {
+ this.sort(function (node1, node2) {
+ return node1.totalTime - node2.totalTime; });
+};
+
+
+/**
+ * Sorts the profile view by total time, descending.
+ */
+devtools.profiler.ProfileView.prototype.sortTotalTimeDescending = function() {
+ this.sort(function (node1, node2) {
+ return node2.totalTime - node1.totalTime; });
+};
+
+
+/**
+ * String comparator compatible with Array.sort requirements.
+ *
+ * @param {string} s1 First string.
+ * @param {string} s2 Second string.
+ */
+devtools.profiler.ProfileView.compareStrings = function(s1, s2) {
+ return s1 < s2 ? -1 : (s1 > s2 ? 1 : 0);
+};
+
+
+/**
+ * Sorts the profile view by function name, ascending.
+ */
+devtools.profiler.ProfileView.prototype.sortFunctionNameAscending = function() {
+ this.sort(function (node1, node2) {
+ return devtools.profiler.ProfileView.compareStrings(
+ node1.functionName, node2.functionName); });
+};
+
+
+/**
+ * Sorts the profile view by function name, descending.
+ */
+devtools.profiler.ProfileView.prototype.sortFunctionNameDescending = function() {
+ this.sort(function (node1, node2) {
+ return devtools.profiler.ProfileView.compareStrings(
+ node2.functionName, node1.functionName); });
+};
+
+
+/**
* Traverses profile view nodes in preorder.
*
* @param {function(devtools.profiler.ProfileView.Node)} f Visitor function.
*/
devtools.profiler.ProfileView.prototype.traverse = function(f) {
- var nodesToTraverse = [this.head];
- while (nodesToTraverse.length > 0) {
- var node = nodesToTraverse.shift();
+ var nodesToTraverse = new ConsArray();
+ nodesToTraverse.concat([this.head]);
+ while (!nodesToTraverse.atEnd()) {
+ var node = nodesToTraverse.next();
f(node);
- nodesToTraverse = nodesToTraverse.concat(node.children);
+ nodesToTraverse.concat(node.children);
}
};
@@ -124,12 +212,63 @@
*/
devtools.profiler.ProfileView.Node = function(
internalFuncName, totalTime, selfTime, head) {
+ this.callIdentifier = 0;
this.internalFuncName = internalFuncName;
+ this.initFuncInfo();
this.totalTime = totalTime;
this.selfTime = selfTime;
this.head = head;
this.parent = null;
this.children = [];
+ this.visible = true;
+};
+
+
+/**
+ * RegEx for stripping V8's prefixes of compiled functions.
+ */
+devtools.profiler.ProfileView.Node.FUNC_NAME_STRIP_RE =
+ /^(?:LazyCompile|Function): (.*)$/;
+
+
+/**
+ * RegEx for extracting script source URL and line number.
+ */
+devtools.profiler.ProfileView.Node.FUNC_NAME_PARSE_RE = /^([^ ]+) (.*):(\d+)$/;
+
+
+/**
+ * RegEx for removing protocol name from URL.
+ */
+devtools.profiler.ProfileView.Node.URL_PARSE_RE = /^(?:http:\/)?.*\/([^/]+)$/;
+
+
+/**
+ * Inits 'functionName', 'url', and 'lineNumber' fields using 'internalFuncName'
+ * field.
+ */
+devtools.profiler.ProfileView.Node.prototype.initFuncInfo = function() {
+ var nodeAlias = devtools.profiler.ProfileView.Node;
+ this.functionName = this.internalFuncName;
+
+ var strippedName = nodeAlias.FUNC_NAME_STRIP_RE.exec(this.functionName);
+ if (strippedName) {
+ this.functionName = strippedName[1];
+ }
+
+ var parsedName = nodeAlias.FUNC_NAME_PARSE_RE.exec(this.functionName);
+ if (parsedName) {
+ this.url = parsedName[2];
+ var parsedUrl = nodeAlias.URL_PARSE_RE.exec(this.url);
+ if (parsedUrl) {
+ this.url = parsedUrl[1];
+ }
+ this.functionName = parsedName[1];
+ this.lineNumber = parsedName[3];
+ } else {
+ this.url = '';
+ this.lineNumber = 0;
+ }
};
diff --git a/tools/splaytree.js b/tools/splaytree.js
index f3beb16..7b3af8b 100644
--- a/tools/splaytree.js
+++ b/tools/splaytree.js
@@ -28,7 +28,8 @@
// A namespace stub. It will become more clear how to declare it properly
// during integration of this script into Dev Tools.
-goog = { structs: {} };
+var goog = goog || {};
+goog.structs = goog.structs || {};
/**
diff --git a/tools/tickprocessor.js b/tools/tickprocessor.js
new file mode 100644
index 0000000..64020ca
--- /dev/null
+++ b/tools/tickprocessor.js
@@ -0,0 +1,623 @@
+// Copyright 2009 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:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+function Profile(separateIc) {
+ devtools.profiler.Profile.call(this);
+ if (!separateIc) {
+ this.skipThisFunction = function(name) { return Profile.IC_RE.test(name); };
+ }
+};
+Profile.prototype = devtools.profiler.Profile.prototype;
+
+
+Profile.IC_RE =
+ /^(?:CallIC|LoadIC|StoreIC)|(?:Builtin: (?:Keyed)?(?:Call|Load|Store)IC_)/;
+
+
+/**
+ * A thin wrapper around shell's 'read' function showing a file name on error.
+ */
+function readFile(fileName) {
+ try {
+ return read(fileName);
+ } catch (e) {
+ print(fileName + ': ' + (e.message || e));
+ throw e;
+ }
+}
+
+
+function TickProcessor(
+ cppEntriesProvider, separateIc, ignoreUnknown, stateFilter) {
+ this.cppEntriesProvider_ = cppEntriesProvider;
+ this.ignoreUnknown_ = ignoreUnknown;
+ this.stateFilter_ = stateFilter;
+ var ticks = this.ticks_ =
+ { total: 0, unaccounted: 0, excluded: 0, gc: 0 };
+
+ Profile.prototype.handleUnknownCode = function(
+ operation, addr, opt_stackPos) {
+ var op = devtools.profiler.Profile.Operation;
+ switch (operation) {
+ case op.MOVE:
+ print('Code move event for unknown code: 0x' + addr.toString(16));
+ break;
+ case op.DELETE:
+ print('Code delete event for unknown code: 0x' + addr.toString(16));
+ break;
+ case op.TICK:
+ // Only unknown PCs (the first frame) are reported as unaccounted,
+ // otherwise tick balance will be corrupted (this behavior is compatible
+ // with the original tickprocessor.py script.)
+ if (opt_stackPos == 0) {
+ ticks.unaccounted++;
+ }
+ break;
+ }
+ };
+
+ this.profile_ = new Profile(separateIc);
+ this.codeTypes_ = {};
+ // Count each tick as a time unit.
+ this.viewBuilder_ = new devtools.profiler.ViewBuilder(1);
+ this.lastLogFileName_ = null;
+};
+
+
+TickProcessor.VmStates = {
+ JS: 0,
+ GC: 1,
+ COMPILER: 2,
+ OTHER: 3,
+ EXTERNAL: 4
+};
+
+
+TickProcessor.CodeTypes = {
+ JS: 0,
+ CPP: 1,
+ SHARED_LIB: 2
+};
+
+
+TickProcessor.RecordsDispatch = {
+ 'shared-library': { parsers: [null, parseInt, parseInt],
+ processor: 'processSharedLibrary' },
+ 'code-creation': { parsers: [null, parseInt, parseInt, null],
+ processor: 'processCodeCreation' },
+ 'code-move': { parsers: [parseInt, parseInt],
+ processor: 'processCodeMove' },
+ 'code-delete': { parsers: [parseInt], processor: 'processCodeDelete' },
+ 'tick': { parsers: [parseInt, parseInt, parseInt, 'var-args'],
+ processor: 'processTick' },
+ 'profiler': null,
+ // Obsolete row types.
+ 'code-allocate': null,
+ 'begin-code-region': null,
+ 'end-code-region': null
+};
+
+
+TickProcessor.CALL_PROFILE_CUTOFF_PCT = 2.0;
+
+
+TickProcessor.prototype.setCodeType = function(name, type) {
+ this.codeTypes_[name] = TickProcessor.CodeTypes[type];
+};
+
+
+TickProcessor.prototype.isSharedLibrary = function(name) {
+ return this.codeTypes_[name] == TickProcessor.CodeTypes.SHARED_LIB;
+};
+
+
+TickProcessor.prototype.isCppCode = function(name) {
+ return this.codeTypes_[name] == TickProcessor.CodeTypes.CPP;
+};
+
+
+TickProcessor.prototype.isJsCode = function(name) {
+ return this.codeTypes_[name] == TickProcessor.CodeTypes.JS;
+};
+
+
+TickProcessor.prototype.processLogFile = function(fileName) {
+ this.lastLogFileName_ = fileName;
+ var contents = readFile(fileName);
+ this.processLog(contents.split('\n'));
+};
+
+
+TickProcessor.prototype.processLog = function(lines) {
+ var csvParser = new devtools.profiler.CsvParser();
+ try {
+ for (var i = 0, n = lines.length; i < n; ++i) {
+ var line = lines[i];
+ if (!line) {
+ continue;
+ }
+ var fields = csvParser.parseLine(line);
+ this.dispatchLogRow(fields);
+ }
+ } catch (e) {
+ print('line ' + (i + 1) + ': ' + (e.message || e));
+ throw e;
+ }
+};
+
+
+TickProcessor.prototype.dispatchLogRow = function(fields) {
+ // Obtain the dispatch.
+ var command = fields[0];
+ if (!(command in TickProcessor.RecordsDispatch)) {
+ throw new Error('unknown command: ' + command);
+ }
+ var dispatch = TickProcessor.RecordsDispatch[command];
+
+ if (dispatch === null) {
+ return;
+ }
+
+ // Parse fields.
+ var parsedFields = [];
+ for (var i = 0; i < dispatch.parsers.length; ++i) {
+ var parser = dispatch.parsers[i];
+ if (parser === null) {
+ parsedFields.push(fields[1 + i]);
+ } else if (typeof parser == 'function') {
+ parsedFields.push(parser(fields[1 + i]));
+ } else {
+ // var-args
+ parsedFields.push(fields.slice(1 + i));
+ break;
+ }
+ }
+
+ // Run the processor.
+ this[dispatch.processor].apply(this, parsedFields);
+};
+
+
+TickProcessor.prototype.processSharedLibrary = function(
+ name, startAddr, endAddr) {
+ var entry = this.profile_.addStaticCode(name, startAddr, endAddr);
+ this.setCodeType(entry.getName(), 'SHARED_LIB');
+
+ var self = this;
+ var libFuncs = this.cppEntriesProvider_.parseVmSymbols(
+ name, startAddr, endAddr, function(fName, fStart, fEnd) {
+ self.profile_.addStaticCode(fName, fStart, fEnd);
+ self.setCodeType(fName, 'CPP');
+ });
+};
+
+
+TickProcessor.prototype.processCodeCreation = function(
+ type, start, size, name) {
+ var entry = this.profile_.addCode(type, name, start, size);
+ this.setCodeType(entry.getName(), 'JS');
+};
+
+
+TickProcessor.prototype.processCodeMove = function(from, to) {
+ this.profile_.moveCode(from, to);
+};
+
+
+TickProcessor.prototype.processCodeDelete = function(start) {
+ this.profile_.deleteCode(start);
+};
+
+
+TickProcessor.prototype.includeTick = function(vmState) {
+ return this.stateFilter_ == null || this.stateFilter_ == vmState;
+};
+
+
+TickProcessor.prototype.processTick = function(pc, sp, vmState, stack) {
+ this.ticks_.total++;
+ if (vmState == TickProcessor.VmStates.GC) this.ticks_.gc++;
+ if (!this.includeTick(vmState)) {
+ this.ticks_.excluded++;
+ return;
+ }
+
+ var fullStack = [pc];
+ for (var i = 0, n = stack.length; i < n; ++i) {
+ var frame = stack[i];
+ // Leave only numbers starting with 0x. Filter possible 'overflow' string.
+ if (frame.charAt(0) == '0') {
+ fullStack.push(parseInt(frame, 16));
+ }
+ }
+ this.profile_.recordTick(fullStack);
+};
+
+
+TickProcessor.prototype.printStatistics = function() {
+ print('Statistical profiling result from ' + this.lastLogFileName_ +
+ ', (' + this.ticks_.total +
+ ' ticks, ' + this.ticks_.unaccounted + ' unaccounted, ' +
+ this.ticks_.excluded + ' excluded).');
+
+ if (this.ticks_.total == 0) return;
+
+ // Print the unknown ticks percentage if they are not ignored.
+ if (!this.ignoreUnknown_ && this.ticks_.unaccounted > 0) {
+ this.printHeader('Unknown');
+ this.printCounter(this.ticks_.unaccounted, this.ticks_.total);
+ }
+
+ // Disable initialization of 'funcName', 'url', 'lineNumber' as
+ // we don't use it and it just wastes time.
+ devtools.profiler.ProfileView.Node.prototype.initFuncInfo = function() {};
+
+ var flatProfile = this.profile_.getFlatProfile();
+ var flatView = this.viewBuilder_.buildView(flatProfile);
+ // Sort by self time, desc, then by name, desc.
+ flatView.sort(function(rec1, rec2) {
+ return rec2.selfTime - rec1.selfTime ||
+ (rec2.internalFuncName < rec1.internalFuncName ? -1 : 1); });
+ var totalTicks = this.ticks_.total;
+ if (this.ignoreUnknown_) {
+ totalTicks -= this.ticks_.unaccounted;
+ }
+ // Our total time contains all the ticks encountered,
+ // while profile only knows about the filtered ticks.
+ flatView.head.totalTime = totalTicks;
+
+ // Count library ticks
+ var flatViewNodes = flatView.head.children;
+ var self = this;
+ var libraryTicks = 0;
+ this.processProfile(flatViewNodes,
+ function(name) { return self.isSharedLibrary(name); },
+ function(rec) { libraryTicks += rec.selfTime; });
+ var nonLibraryTicks = totalTicks - libraryTicks;
+
+ this.printHeader('Shared libraries');
+ this.printEntries(flatViewNodes, null,
+ function(name) { return self.isSharedLibrary(name); });
+
+ this.printHeader('JavaScript');
+ this.printEntries(flatViewNodes, nonLibraryTicks,
+ function(name) { return self.isJsCode(name); });
+
+ this.printHeader('C++');
+ this.printEntries(flatViewNodes, nonLibraryTicks,
+ function(name) { return self.isCppCode(name); });
+
+ this.printHeader('GC');
+ this.printCounter(this.ticks_.gc, totalTicks);
+
+ this.printHeavyProfHeader();
+ var heavyProfile = this.profile_.getBottomUpProfile();
+ var heavyView = this.viewBuilder_.buildView(heavyProfile);
+ // To show the same percentages as in the flat profile.
+ heavyView.head.totalTime = totalTicks;
+ // Sort by total time, desc, then by name, desc.
+ heavyView.sort(function(rec1, rec2) {
+ return rec2.totalTime - rec1.totalTime ||
+ (rec2.internalFuncName < rec1.internalFuncName ? -1 : 1); });
+ this.printHeavyProfile(heavyView.head.children);
+};
+
+
+function padLeft(s, len) {
+ s = s.toString();
+ if (s.length < len) {
+ s = (new Array(len - s.length + 1).join(' ')) + s;
+ }
+ return s;
+};
+
+
+TickProcessor.prototype.printHeader = function(headerTitle) {
+ print('\n [' + headerTitle + ']:');
+ print(' ticks total nonlib name');
+};
+
+
+TickProcessor.prototype.printHeavyProfHeader = function() {
+ print('\n [Bottom up (heavy) profile]:');
+ print(' Note: percentage shows a share of a particular caller in the ' +
+ 'total\n' +
+ ' amount of its parent calls.');
+ print(' Callers occupying less than ' +
+ TickProcessor.CALL_PROFILE_CUTOFF_PCT.toFixed(1) +
+ '% are not shown.\n');
+ print(' ticks parent name');
+};
+
+
+TickProcessor.prototype.printCounter = function(ticksCount, totalTicksCount) {
+ var pct = ticksCount * 100.0 / totalTicksCount;
+ print(' ' + padLeft(ticksCount, 5) + ' ' + padLeft(pct.toFixed(1), 5) + '%');
+};
+
+
+TickProcessor.prototype.processProfile = function(
+ profile, filterP, func) {
+ for (var i = 0, n = profile.length; i < n; ++i) {
+ var rec = profile[i];
+ if (!filterP(rec.internalFuncName)) {
+ continue;
+ }
+ func(rec);
+ }
+};
+
+
+TickProcessor.prototype.printEntries = function(
+ profile, nonLibTicks, filterP) {
+ this.processProfile(profile, filterP, function (rec) {
+ if (rec.selfTime == 0) return;
+ var nonLibPct = nonLibTicks != null ?
+ rec.selfTime * 100.0 / nonLibTicks : 0.0;
+ print(' ' + padLeft(rec.selfTime, 5) + ' ' +
+ padLeft(rec.selfPercent.toFixed(1), 5) + '% ' +
+ padLeft(nonLibPct.toFixed(1), 5) + '% ' +
+ rec.internalFuncName);
+ });
+};
+
+
+TickProcessor.prototype.printHeavyProfile = function(profile, opt_indent) {
+ var self = this;
+ var indent = opt_indent || 0;
+ var indentStr = padLeft('', indent);
+ this.processProfile(profile, function() { return true; }, function (rec) {
+ // Cut off too infrequent callers.
+ if (rec.parentTotalPercent < TickProcessor.CALL_PROFILE_CUTOFF_PCT) return;
+ print(' ' + padLeft(rec.totalTime, 5) + ' ' +
+ padLeft(rec.parentTotalPercent.toFixed(1), 5) + '% ' +
+ indentStr + rec.internalFuncName);
+ // Limit backtrace depth.
+ if (indent < 10) {
+ self.printHeavyProfile(rec.children, indent + 2);
+ }
+ // Delimit top-level functions.
+ if (indent == 0) {
+ print('');
+ }
+ });
+};
+
+
+function CppEntriesProvider() {
+};
+
+
+CppEntriesProvider.prototype.parseVmSymbols = function(
+ libName, libStart, libEnd, processorFunc) {
+ var syms = this.loadSymbols(libName);
+ if (syms.length == 0) return;
+
+ var prevEntry;
+
+ function addPrevEntry(end) {
+ // Several functions can be mapped onto the same address. To avoid
+ // creating zero-sized entries, skip such duplicates.
+ if (prevEntry && prevEntry.start != end) {
+ processorFunc(prevEntry.name, prevEntry.start, end);
+ }
+ }
+
+ for (var i = 0, n = syms.length; i < n; ++i) {
+ var line = syms[i];
+ var funcInfo = this.parseLine(line);
+ if (!funcInfo) {
+ continue;
+ }
+ if (funcInfo.start < libStart && funcInfo.start < libEnd - libStart) {
+ funcInfo.start += libStart;
+ }
+ addPrevEntry(funcInfo.start);
+ prevEntry = funcInfo;
+ }
+ addPrevEntry(libEnd);
+};
+
+
+CppEntriesProvider.prototype.loadSymbols = function(libName) {
+ return [];
+};
+
+
+CppEntriesProvider.prototype.parseLine = function(line) {
+ return { name: '', start: 0 };
+};
+
+
+function inherits(childCtor, parentCtor) {
+ function tempCtor() {};
+ tempCtor.prototype = parentCtor.prototype;
+ childCtor.prototype = new tempCtor();
+};
+
+
+function UnixCppEntriesProvider() {
+};
+inherits(UnixCppEntriesProvider, CppEntriesProvider);
+
+
+UnixCppEntriesProvider.FUNC_RE = /^([0-9a-fA-F]{8}) . (.*)$/;
+
+
+UnixCppEntriesProvider.prototype.loadSymbols = function(libName) {
+ var normalSyms = os.system('nm', ['-C', '-n', libName], -1, -1);
+ var dynaSyms = os.system('nm', ['-C', '-n', '-D', libName], -1, -1);
+ var syms = (normalSyms + dynaSyms).split('\n');
+ return syms;
+};
+
+
+UnixCppEntriesProvider.prototype.parseLine = function(line) {
+ var fields = line.match(UnixCppEntriesProvider.FUNC_RE);
+ return fields ? { name: fields[2], start: parseInt(fields[1], 16) } : null;
+};
+
+
+function WindowsCppEntriesProvider() {
+};
+inherits(WindowsCppEntriesProvider, CppEntriesProvider);
+
+
+WindowsCppEntriesProvider.FILENAME_RE = /^(.*)\.exe$/;
+
+
+WindowsCppEntriesProvider.FUNC_RE =
+ /^ 0001:[0-9a-fA-F]{8}\s+([_\?@$0-9a-zA-Z]+)\s+([0-9a-fA-F]{8}).*$/;
+
+
+WindowsCppEntriesProvider.prototype.loadSymbols = function(libName) {
+ var fileNameFields = libName.match(WindowsCppEntriesProvider.FILENAME_RE);
+ // Only try to load symbols for the .exe file.
+ if (!fileNameFields) return [];
+ var mapFileName = fileNameFields[1] + '.map';
+ return readFile(mapFileName).split('\r\n');
+};
+
+
+WindowsCppEntriesProvider.prototype.parseLine = function(line) {
+ var fields = line.match(WindowsCppEntriesProvider.FUNC_RE);
+ return fields ?
+ { name: this.unmangleName(fields[1]), start: parseInt(fields[2], 16) } :
+ null;
+};
+
+
+/**
+ * Performs very simple unmangling of C++ names.
+ *
+ * Does not handle arguments and template arguments. The mangled names have
+ * the form:
+ *
+ * ?LookupInDescriptor@JSObject@internal@v8@@...arguments info...
+ */
+WindowsCppEntriesProvider.prototype.unmangleName = function(name) {
+ // Empty or non-mangled name.
+ if (name.length < 1 || name.charAt(0) != '?') return name;
+ var nameEndPos = name.indexOf('@@');
+ var components = name.substring(1, nameEndPos).split('@');
+ components.reverse();
+ return components.join('::');
+};
+
+
+function padRight(s, len) {
+ s = s.toString();
+ if (s.length < len) {
+ s = s + (new Array(len - s.length + 1).join(' '));
+ }
+ return s;
+};
+
+
+function processArguments(args) {
+ var result = {
+ logFileName: 'v8.log',
+ platform: 'unix',
+ stateFilter: null,
+ ignoreUnknown: false,
+ separateIc: false
+ };
+ var argsDispatch = {
+ '-j': ['stateFilter', TickProcessor.VmStates.JS,
+ 'Show only ticks from JS VM state'],
+ '-g': ['stateFilter', TickProcessor.VmStates.GC,
+ 'Show only ticks from GC VM state'],
+ '-c': ['stateFilter', TickProcessor.VmStates.COMPILER,
+ 'Show only ticks from COMPILER VM state'],
+ '-o': ['stateFilter', TickProcessor.VmStates.OTHER,
+ 'Show only ticks from OTHER VM state'],
+ '-e': ['stateFilter', TickProcessor.VmStates.EXTERNAL,
+ 'Show only ticks from EXTERNAL VM state'],
+ '--ignore-unknown': ['ignoreUnknown', true,
+ 'Exclude ticks of unknown code entries from processing'],
+ '--separate-ic': ['separateIc', true,
+ 'Separate IC entries'],
+ '--unix': ['platform', 'unix',
+ 'Specify that we are running on *nix platform'],
+ '--windows': ['platform', 'windows',
+ 'Specify that we are running on Windows platform']
+ };
+ argsDispatch['--js'] = argsDispatch['-j'];
+ argsDispatch['--gc'] = argsDispatch['-g'];
+ argsDispatch['--compiler'] = argsDispatch['-c'];
+ argsDispatch['--other'] = argsDispatch['-o'];
+ argsDispatch['--external'] = argsDispatch['-e'];
+
+ function printUsageAndExit() {
+ print('Cmdline args: [options] [log-file-name]\n' +
+ 'Default log file name is "v8.log".\n');
+ print('Options:');
+ for (var arg in argsDispatch) {
+ var synonims = [arg];
+ var dispatch = argsDispatch[arg];
+ for (var synArg in argsDispatch) {
+ if (arg !== synArg && dispatch === argsDispatch[synArg]) {
+ synonims.push(synArg);
+ delete argsDispatch[synArg];
+ }
+ }
+ print(' ' + padRight(synonims.join(', '), 20) + dispatch[2]);
+ }
+ quit(2);
+ }
+
+ while (args.length) {
+ var arg = args[0];
+ if (arg.charAt(0) != '-') {
+ break;
+ }
+ args.shift();
+ if (arg in argsDispatch) {
+ var dispatch = argsDispatch[arg];
+ result[dispatch[0]] = dispatch[1];
+ } else {
+ printUsageAndExit();
+ }
+ }
+
+ if (args.length >= 1) {
+ result.logFileName = args.shift();
+ }
+ return result;
+};
+
+
+var params = processArguments(arguments);
+var tickProcessor = new TickProcessor(
+ params.platform == 'unix' ? new UnixCppEntriesProvider() :
+ new WindowsCppEntriesProvider(),
+ params.separateIc,
+ params.ignoreUnknown,
+ params.stateFilter);
+tickProcessor.processLogFile(params.logFileName);
+tickProcessor.printStatistics();
diff --git a/tools/tickprocessor.py b/tools/tickprocessor.py
index 95e6e50..cc540d3 100644
--- a/tools/tickprocessor.py
+++ b/tools/tickprocessor.py
@@ -411,7 +411,7 @@
number_of_accounted_ticks -= self.unaccounted_number_of_ticks
number_of_non_library_ticks = number_of_accounted_ticks - self.number_of_library_ticks
- entries.sort(key=lambda e:e.tick_count, reverse=True)
+ entries.sort(key=lambda e: (e.tick_count, e.ToString()), reverse=True)
for entry in entries:
if entry.tick_count > 0 and condition(entry):
total_percentage = entry.tick_count * 100.0 / number_of_accounted_ticks
diff --git a/tools/v8.xcodeproj/project.pbxproj b/tools/v8.xcodeproj/project.pbxproj
index 02c4631..c868487 100755
--- a/tools/v8.xcodeproj/project.pbxproj
+++ b/tools/v8.xcodeproj/project.pbxproj
@@ -26,20 +26,20 @@
/* Begin PBXBuildFile section */
58950D5E0F55519800F3E8BA /* jump-target.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D500F55514900F3E8BA /* jump-target.cc */; };
- 58950D5F0F55519D00F3E8BA /* ia32/jump-target-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D4F0F55514900F3E8BA /* ia32/jump-target-ia32.cc */; };
+ 58950D5F0F55519D00F3E8BA /* jump-target-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D4F0F55514900F3E8BA /* jump-target-ia32.cc */; };
58950D600F5551A300F3E8BA /* jump-target.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D500F55514900F3E8BA /* jump-target.cc */; };
- 58950D610F5551A400F3E8BA /* arm/jump-target-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D4E0F55514900F3E8BA /* arm/jump-target-arm.cc */; };
- 58950D620F5551AF00F3E8BA /* ia32/register-allocator-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D530F55514900F3E8BA /* ia32/register-allocator-ia32.cc */; };
+ 58950D610F5551A400F3E8BA /* jump-target-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D4E0F55514900F3E8BA /* jump-target-arm.cc */; };
+ 58950D620F5551AF00F3E8BA /* register-allocator-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D530F55514900F3E8BA /* register-allocator-ia32.cc */; };
58950D630F5551AF00F3E8BA /* register-allocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D540F55514900F3E8BA /* register-allocator.cc */; };
58950D640F5551B500F3E8BA /* register-allocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D540F55514900F3E8BA /* register-allocator.cc */; };
- 58950D650F5551B600F3E8BA /* arm/register-allocator-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D520F55514900F3E8BA /* arm/register-allocator-arm.cc */; };
+ 58950D650F5551B600F3E8BA /* register-allocator-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D520F55514900F3E8BA /* register-allocator-arm.cc */; };
58950D660F5551C200F3E8BA /* virtual-frame.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D5A0F55514900F3E8BA /* virtual-frame.cc */; };
- 58950D670F5551C400F3E8BA /* ia32/virtual-frame-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D580F55514900F3E8BA /* ia32/virtual-frame-ia32.cc */; };
+ 58950D670F5551C400F3E8BA /* virtual-frame-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D580F55514900F3E8BA /* virtual-frame-ia32.cc */; };
58950D680F5551CB00F3E8BA /* virtual-frame.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D5A0F55514900F3E8BA /* virtual-frame.cc */; };
- 58950D690F5551CE00F3E8BA /* arm/virtual-frame-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D560F55514900F3E8BA /* arm/virtual-frame-arm.cc */; };
+ 58950D690F5551CE00F3E8BA /* virtual-frame-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 58950D560F55514900F3E8BA /* virtual-frame-arm.cc */; };
8900116C0E71CA2300F91F35 /* libraries.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8900116B0E71CA2300F91F35 /* libraries.cc */; };
890A13FE0EE9C47F00E49346 /* interpreter-irregexp.cc in Sources */ = {isa = PBXBuildFile; fileRef = 89A15C660EE4665300B48DEB /* interpreter-irregexp.cc */; };
- 890A14010EE9C4B000E49346 /* arm/regexp-macro-assembler-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 89A15C700EE466D000B48DEB /* arm/regexp-macro-assembler-arm.cc */; };
+ 890A14010EE9C4B000E49346 /* regexp-macro-assembler-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 89A15C700EE466D000B48DEB /* regexp-macro-assembler-arm.cc */; };
890A14020EE9C4B400E49346 /* regexp-macro-assembler-irregexp.cc in Sources */ = {isa = PBXBuildFile; fileRef = 89A15C750EE466D000B48DEB /* regexp-macro-assembler-irregexp.cc */; };
890A14030EE9C4B500E49346 /* regexp-macro-assembler-tracer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 89A15C770EE466D000B48DEB /* regexp-macro-assembler-tracer.cc */; };
890A14040EE9C4B700E49346 /* regexp-macro-assembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 89A15C790EE466D000B48DEB /* regexp-macro-assembler.cc */; };
@@ -59,9 +59,9 @@
896FD03A0E78D717003DFB6A /* libv8-arm.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89F23C870E78D5B2006B2466 /* libv8-arm.a */; };
897F767F0E71B690007ACF34 /* shell.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1B50E719C0900D62E90 /* shell.cc */; };
897F76850E71B6B1007ACF34 /* libv8.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8970F2F00E719FB2006AE7B5 /* libv8.a */; };
- 898BD20E0EF6CC930068B00A /* ia32/debug-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 898BD20D0EF6CC850068B00A /* ia32/debug-ia32.cc */; };
- 898BD20F0EF6CC9A0068B00A /* arm/debug-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 898BD20C0EF6CC850068B00A /* arm/debug-arm.cc */; };
- 89A15C7B0EE466EB00B48DEB /* ia32/regexp-macro-assembler-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 89A15C720EE466D000B48DEB /* ia32/regexp-macro-assembler-ia32.cc */; };
+ 898BD20E0EF6CC930068B00A /* debug-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 898BD20D0EF6CC850068B00A /* debug-ia32.cc */; };
+ 898BD20F0EF6CC9A0068B00A /* debug-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 898BD20C0EF6CC850068B00A /* debug-arm.cc */; };
+ 89A15C7B0EE466EB00B48DEB /* regexp-macro-assembler-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 89A15C720EE466D000B48DEB /* regexp-macro-assembler-ia32.cc */; };
89A15C810EE4674900B48DEB /* regexp-macro-assembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 89A15C790EE466D000B48DEB /* regexp-macro-assembler.cc */; };
89A15C830EE4675E00B48DEB /* regexp-macro-assembler-irregexp.cc in Sources */ = {isa = PBXBuildFile; fileRef = 89A15C750EE466D000B48DEB /* regexp-macro-assembler-irregexp.cc */; };
89A15C850EE4678B00B48DEB /* interpreter-irregexp.cc in Sources */ = {isa = PBXBuildFile; fileRef = 89A15C660EE4665300B48DEB /* interpreter-irregexp.cc */; };
@@ -69,39 +69,39 @@
89A88DEC0E71A5FF0043BA31 /* accessors.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF0F60E719B8F00D62E90 /* accessors.cc */; };
89A88DED0E71A6000043BA31 /* allocation.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF0F80E719B8F00D62E90 /* allocation.cc */; };
89A88DEE0E71A6010043BA31 /* api.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF0FA0E719B8F00D62E90 /* api.cc */; };
- 89A88DEF0E71A60A0043BA31 /* ia32/assembler-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1010E719B8F00D62E90 /* ia32/assembler-ia32.cc */; };
+ 89A88DEF0E71A60A0043BA31 /* assembler-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1010E719B8F00D62E90 /* assembler-ia32.cc */; };
89A88DF00E71A60A0043BA31 /* assembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1030E719B8F00D62E90 /* assembler.cc */; };
89A88DF10E71A60B0043BA31 /* ast.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1050E719B8F00D62E90 /* ast.cc */; };
89A88DF20E71A60C0043BA31 /* bootstrapper.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1070E719B8F00D62E90 /* bootstrapper.cc */; };
- 89A88DF40E71A6160043BA31 /* ia32/builtins-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF10A0E719B8F00D62E90 /* ia32/builtins-ia32.cc */; };
+ 89A88DF40E71A6160043BA31 /* builtins-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF10A0E719B8F00D62E90 /* builtins-ia32.cc */; };
89A88DF50E71A6170043BA31 /* builtins.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF10B0E719B8F00D62E90 /* builtins.cc */; };
89A88DF60E71A61C0043BA31 /* checks.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF10F0E719B8F00D62E90 /* checks.cc */; };
- 89A88DF70E71A6240043BA31 /* ia32/codegen-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1150E719B8F00D62E90 /* ia32/codegen-ia32.cc */; };
+ 89A88DF70E71A6240043BA31 /* codegen-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1150E719B8F00D62E90 /* codegen-ia32.cc */; };
89A88DF80E71A6260043BA31 /* codegen.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1170E719B8F00D62E90 /* codegen.cc */; };
89A88DF90E71A6430043BA31 /* compiler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1190E719B8F00D62E90 /* compiler.cc */; };
89A88DFA0E71A6440043BA31 /* contexts.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF11C0E719B8F00D62E90 /* contexts.cc */; };
89A88DFB0E71A6440043BA31 /* conversions.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF11F0E719B8F00D62E90 /* conversions.cc */; };
89A88DFC0E71A6460043BA31 /* counters.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1210E719B8F00D62E90 /* counters.cc */; };
- 89A88DFD0E71A6470043BA31 /* ia32/cpu-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1240E719B8F00D62E90 /* ia32/cpu-ia32.cc */; };
+ 89A88DFD0E71A6470043BA31 /* cpu-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1240E719B8F00D62E90 /* cpu-ia32.cc */; };
89A88DFE0E71A6480043BA31 /* dateparser.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1260E719B8F00D62E90 /* dateparser.cc */; };
89A88DFF0E71A6530043BA31 /* debug.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1280E719B8F00D62E90 /* debug.cc */; };
- 89A88E000E71A6540043BA31 /* ia32/disasm-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF12B0E719B8F00D62E90 /* ia32/disasm-ia32.cc */; };
+ 89A88E000E71A6540043BA31 /* disasm-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF12B0E719B8F00D62E90 /* disasm-ia32.cc */; };
89A88E010E71A6550043BA31 /* disassembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF12D0E719B8F00D62E90 /* disassembler.cc */; };
89A88E020E71A65A0043BA31 /* dtoa-config.c in Sources */ = {isa = PBXBuildFile; fileRef = 897FF12F0E719B8F00D62E90 /* dtoa-config.c */; };
89A88E030E71A65B0043BA31 /* execution.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1300E719B8F00D62E90 /* execution.cc */; };
89A88E040E71A65D0043BA31 /* factory.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1320E719B8F00D62E90 /* factory.cc */; };
89A88E050E71A65D0043BA31 /* flags.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1350E719B8F00D62E90 /* flags.cc */; };
- 89A88E060E71A6600043BA31 /* ia32/frames-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1390E719B8F00D62E90 /* ia32/frames-ia32.cc */; };
+ 89A88E060E71A6600043BA31 /* frames-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1390E719B8F00D62E90 /* frames-ia32.cc */; };
89A88E070E71A6610043BA31 /* frames.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF13C0E719B8F00D62E90 /* frames.cc */; };
89A88E080E71A6620043BA31 /* global-handles.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF13E0E719B8F00D62E90 /* global-handles.cc */; };
89A88E090E71A6640043BA31 /* handles.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1420E719B8F00D62E90 /* handles.cc */; };
89A88E0A0E71A6650043BA31 /* hashmap.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1440E719B8F00D62E90 /* hashmap.cc */; };
89A88E0B0E71A66C0043BA31 /* heap.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1470E719B8F00D62E90 /* heap.cc */; };
- 89A88E0C0E71A66D0043BA31 /* ia32/ic-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF14A0E719B8F00D62E90 /* ia32/ic-ia32.cc */; };
+ 89A88E0C0E71A66D0043BA31 /* ic-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF14A0E719B8F00D62E90 /* ic-ia32.cc */; };
89A88E0D0E71A66E0043BA31 /* ic.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF14C0E719B8F00D62E90 /* ic.cc */; };
89A88E0E0E71A66F0043BA31 /* jsregexp.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF14E0E719B8F00D62E90 /* jsregexp.cc */; };
89A88E0F0E71A6740043BA31 /* log.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1520E719B8F00D62E90 /* log.cc */; };
- 89A88E100E71A6770043BA31 /* ia32/macro-assembler-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1560E719B8F00D62E90 /* ia32/macro-assembler-ia32.cc */; };
+ 89A88E100E71A6770043BA31 /* macro-assembler-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1560E719B8F00D62E90 /* macro-assembler-ia32.cc */; };
89A88E110E71A6780043BA31 /* mark-compact.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1590E719B8F00D62E90 /* mark-compact.cc */; };
89A88E120E71A67A0043BA31 /* messages.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF15C0E719B8F00D62E90 /* messages.cc */; };
89A88E130E71A6860043BA31 /* objects-debug.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1600E719B8F00D62E90 /* objects-debug.cc */; };
@@ -120,7 +120,7 @@
89A88E200E71A6B60043BA31 /* snapshot-empty.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1830E719B8F00D62E90 /* snapshot-empty.cc */; };
89A88E210E71A6B70043BA31 /* spaces.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1860E719B8F00D62E90 /* spaces.cc */; };
89A88E220E71A6BC0043BA31 /* string-stream.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1880E719B8F00D62E90 /* string-stream.cc */; };
- 89A88E230E71A6BE0043BA31 /* ia32/stub-cache-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF18B0E719B8F00D62E90 /* ia32/stub-cache-ia32.cc */; };
+ 89A88E230E71A6BE0043BA31 /* stub-cache-ia32.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF18B0E719B8F00D62E90 /* stub-cache-ia32.cc */; };
89A88E240E71A6BF0043BA31 /* stub-cache.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF18C0E719B8F00D62E90 /* stub-cache.cc */; };
89A88E250E71A6C20043BA31 /* token.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF18E0E719B8F00D62E90 /* token.cc */; };
89A88E260E71A6C90043BA31 /* top.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1900E719B8F00D62E90 /* top.cc */; };
@@ -132,6 +132,8 @@
89A88E2C0E71A6D20043BA31 /* v8threads.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF19D0E719B8F00D62E90 /* v8threads.cc */; };
89A88E2D0E71A6D50043BA31 /* variables.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF19F0E719B8F00D62E90 /* variables.cc */; };
89A88E2E0E71A6D60043BA31 /* zone.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1A20E719B8F00D62E90 /* zone.cc */; };
+ 89B933AF0FAA0F9600201304 /* version.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF32F0FAA0ED200136CF6 /* version.cc */; };
+ 89B933B00FAA0F9D00201304 /* version.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF32F0FAA0ED200136CF6 /* version.cc */; };
89F23C3F0E78D5B2006B2466 /* accessors.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF0F60E719B8F00D62E90 /* accessors.cc */; };
89F23C400E78D5B2006B2466 /* allocation.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF0F80E719B8F00D62E90 /* allocation.cc */; };
89F23C410E78D5B2006B2466 /* api.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF0FA0E719B8F00D62E90 /* api.cc */; };
@@ -192,16 +194,16 @@
89F23C810E78D5B2006B2466 /* variables.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF19F0E719B8F00D62E90 /* variables.cc */; };
89F23C820E78D5B2006B2466 /* zone.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1A20E719B8F00D62E90 /* zone.cc */; };
89F23C8E0E78D5B6006B2466 /* shell.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1B50E719C0900D62E90 /* shell.cc */; };
- 89F23C970E78D5E3006B2466 /* arm/assembler-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF0FE0E719B8F00D62E90 /* arm/assembler-arm.cc */; };
- 89F23C980E78D5E7006B2466 /* arm/builtins-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1090E719B8F00D62E90 /* arm/builtins-arm.cc */; };
- 89F23C990E78D5E9006B2466 /* arm/codegen-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1140E719B8F00D62E90 /* arm/codegen-arm.cc */; };
- 89F23C9A0E78D5EC006B2466 /* arm/cpu-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1230E719B8F00D62E90 /* arm/cpu-arm.cc */; };
- 89F23C9B0E78D5EE006B2466 /* arm/disasm-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF12A0E719B8F00D62E90 /* arm/disasm-arm.cc */; };
- 89F23C9C0E78D5F1006B2466 /* arm/frames-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1370E719B8F00D62E90 /* arm/frames-arm.cc */; };
- 89F23C9D0E78D5FB006B2466 /* arm/ic-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1490E719B8F00D62E90 /* arm/ic-arm.cc */; };
- 89F23C9E0E78D5FD006B2466 /* arm/macro-assembler-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1540E719B8F00D62E90 /* arm/macro-assembler-arm.cc */; };
- 89F23C9F0E78D604006B2466 /* arm/simulator-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF17D0E719B8F00D62E90 /* arm/simulator-arm.cc */; };
- 89F23CA00E78D609006B2466 /* arm/stub-cache-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF18A0E719B8F00D62E90 /* arm/stub-cache-arm.cc */; };
+ 89F23C970E78D5E3006B2466 /* assembler-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF0FE0E719B8F00D62E90 /* assembler-arm.cc */; };
+ 89F23C980E78D5E7006B2466 /* builtins-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1090E719B8F00D62E90 /* builtins-arm.cc */; };
+ 89F23C990E78D5E9006B2466 /* codegen-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1140E719B8F00D62E90 /* codegen-arm.cc */; };
+ 89F23C9A0E78D5EC006B2466 /* cpu-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1230E719B8F00D62E90 /* cpu-arm.cc */; };
+ 89F23C9B0E78D5EE006B2466 /* disasm-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF12A0E719B8F00D62E90 /* disasm-arm.cc */; };
+ 89F23C9C0E78D5F1006B2466 /* frames-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1370E719B8F00D62E90 /* frames-arm.cc */; };
+ 89F23C9D0E78D5FB006B2466 /* ic-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1490E719B8F00D62E90 /* ic-arm.cc */; };
+ 89F23C9E0E78D5FD006B2466 /* macro-assembler-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF1540E719B8F00D62E90 /* macro-assembler-arm.cc */; };
+ 89F23C9F0E78D604006B2466 /* simulator-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF17D0E719B8F00D62E90 /* simulator-arm.cc */; };
+ 89F23CA00E78D609006B2466 /* stub-cache-arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 897FF18A0E719B8F00D62E90 /* stub-cache-arm.cc */; };
89FB0E3A0F8E533F00B04B3C /* d8-posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 89FB0E360F8E531900B04B3C /* d8-posix.cc */; };
9F92FAA90F8F28AD0089F02C /* func-name-inferrer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9F92FAA70F8F28AD0089F02C /* func-name-inferrer.cc */; };
9F92FAAA0F8F28AD0089F02C /* func-name-inferrer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9F92FAA70F8F28AD0089F02C /* func-name-inferrer.cc */; };
@@ -270,18 +272,18 @@
/* Begin PBXFileReference section */
58242A1E0FA1F14D00BD6F59 /* json-delay.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "json-delay.js"; sourceTree = "<group>"; };
- 58950D4E0F55514900F3E8BA /* arm/jump-target-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "arm/jump-target-arm.cc"; sourceTree = "<group>"; };
- 58950D4F0F55514900F3E8BA /* ia32/jump-target-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "ia32/jump-target-ia32.cc"; sourceTree = "<group>"; };
+ 58950D4E0F55514900F3E8BA /* jump-target-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "jump-target-arm.cc"; path = "arm/jump-target-arm.cc"; sourceTree = "<group>"; };
+ 58950D4F0F55514900F3E8BA /* jump-target-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "jump-target-ia32.cc"; path = "ia32/jump-target-ia32.cc"; sourceTree = "<group>"; };
58950D500F55514900F3E8BA /* jump-target.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "jump-target.cc"; sourceTree = "<group>"; };
58950D510F55514900F3E8BA /* jump-target.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "jump-target.h"; sourceTree = "<group>"; };
- 58950D520F55514900F3E8BA /* arm/register-allocator-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "arm/register-allocator-arm.cc"; sourceTree = "<group>"; };
- 58950D530F55514900F3E8BA /* ia32/register-allocator-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "ia32/register-allocator-ia32.cc"; sourceTree = "<group>"; };
+ 58950D520F55514900F3E8BA /* register-allocator-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "register-allocator-arm.cc"; path = "arm/register-allocator-arm.cc"; sourceTree = "<group>"; };
+ 58950D530F55514900F3E8BA /* register-allocator-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "register-allocator-ia32.cc"; path = "ia32/register-allocator-ia32.cc"; sourceTree = "<group>"; };
58950D540F55514900F3E8BA /* register-allocator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "register-allocator.cc"; sourceTree = "<group>"; };
58950D550F55514900F3E8BA /* register-allocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "register-allocator.h"; sourceTree = "<group>"; };
- 58950D560F55514900F3E8BA /* arm/virtual-frame-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "arm/virtual-frame-arm.cc"; sourceTree = "<group>"; };
- 58950D570F55514900F3E8BA /* arm/virtual-frame-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "arm/virtual-frame-arm.h"; sourceTree = "<group>"; };
- 58950D580F55514900F3E8BA /* ia32/virtual-frame-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "ia32/virtual-frame-ia32.cc"; sourceTree = "<group>"; };
- 58950D590F55514900F3E8BA /* ia32/virtual-frame-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ia32/virtual-frame-ia32.h"; sourceTree = "<group>"; };
+ 58950D560F55514900F3E8BA /* virtual-frame-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "virtual-frame-arm.cc"; path = "arm/virtual-frame-arm.cc"; sourceTree = "<group>"; };
+ 58950D570F55514900F3E8BA /* virtual-frame-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "virtual-frame-arm.h"; path = "arm/virtual-frame-arm.h"; sourceTree = "<group>"; };
+ 58950D580F55514900F3E8BA /* virtual-frame-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "virtual-frame-ia32.cc"; path = "ia32/virtual-frame-ia32.cc"; sourceTree = "<group>"; };
+ 58950D590F55514900F3E8BA /* virtual-frame-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "virtual-frame-ia32.h"; path = "ia32/virtual-frame-ia32.h"; sourceTree = "<group>"; };
58950D5A0F55514900F3E8BA /* virtual-frame.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "virtual-frame.cc"; sourceTree = "<group>"; };
58950D5B0F55514900F3E8BA /* virtual-frame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "virtual-frame.h"; sourceTree = "<group>"; };
8900116B0E71CA2300F91F35 /* libraries.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = libraries.cc; sourceTree = "<group>"; };
@@ -300,8 +302,8 @@
89495E470E79FC23001F68C3 /* compilation-cache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "compilation-cache.h"; sourceTree = "<group>"; };
8956B6CD0F5D86570033B5A2 /* debug-agent.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "debug-agent.cc"; sourceTree = "<group>"; };
8956B6CE0F5D86570033B5A2 /* debug-agent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "debug-agent.h"; sourceTree = "<group>"; };
- 8964482B0E9C00F700E7C516 /* ia32/codegen-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ia32/codegen-ia32.h"; sourceTree = "<group>"; };
- 896448BC0E9D530500E7C516 /* arm/codegen-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "arm/codegen-arm.h"; sourceTree = "<group>"; };
+ 8964482B0E9C00F700E7C516 /* codegen-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "codegen-ia32.h"; path = "ia32/codegen-ia32.h"; sourceTree = "<group>"; };
+ 896448BC0E9D530500E7C516 /* codegen-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "codegen-arm.h"; path = "arm/codegen-arm.h"; sourceTree = "<group>"; };
8970F2F00E719FB2006AE7B5 /* libv8.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libv8.a; sourceTree = BUILT_PRODUCTS_DIR; };
897F767A0E71B4CC007ACF34 /* v8_shell */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = v8_shell; sourceTree = BUILT_PRODUCTS_DIR; };
897FF0D40E719A8500D62E90 /* v8-debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "v8-debug.h"; sourceTree = "<group>"; };
@@ -315,20 +317,20 @@
897FF0FA0E719B8F00D62E90 /* api.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = api.cc; sourceTree = "<group>"; };
897FF0FB0E719B8F00D62E90 /* api.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = api.h; sourceTree = "<group>"; };
897FF0FC0E719B8F00D62E90 /* arguments.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = arguments.h; sourceTree = "<group>"; };
- 897FF0FD0E719B8F00D62E90 /* arm/assembler-arm-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "arm/assembler-arm-inl.h"; sourceTree = "<group>"; };
- 897FF0FE0E719B8F00D62E90 /* arm/assembler-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "arm/assembler-arm.cc"; sourceTree = "<group>"; };
- 897FF0FF0E719B8F00D62E90 /* arm/assembler-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "arm/assembler-arm.h"; sourceTree = "<group>"; };
- 897FF1000E719B8F00D62E90 /* ia32/assembler-ia32-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ia32/assembler-ia32-inl.h"; sourceTree = "<group>"; };
- 897FF1010E719B8F00D62E90 /* ia32/assembler-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "ia32/assembler-ia32.cc"; sourceTree = "<group>"; };
- 897FF1020E719B8F00D62E90 /* ia32/assembler-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ia32/assembler-ia32.h"; sourceTree = "<group>"; };
+ 897FF0FD0E719B8F00D62E90 /* assembler-arm-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "assembler-arm-inl.h"; path = "arm/assembler-arm-inl.h"; sourceTree = "<group>"; };
+ 897FF0FE0E719B8F00D62E90 /* assembler-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "assembler-arm.cc"; path = "arm/assembler-arm.cc"; sourceTree = "<group>"; };
+ 897FF0FF0E719B8F00D62E90 /* assembler-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "assembler-arm.h"; path = "arm/assembler-arm.h"; sourceTree = "<group>"; };
+ 897FF1000E719B8F00D62E90 /* assembler-ia32-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "assembler-ia32-inl.h"; path = "ia32/assembler-ia32-inl.h"; sourceTree = "<group>"; };
+ 897FF1010E719B8F00D62E90 /* assembler-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "assembler-ia32.cc"; path = "ia32/assembler-ia32.cc"; sourceTree = "<group>"; };
+ 897FF1020E719B8F00D62E90 /* assembler-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "assembler-ia32.h"; path = "ia32/assembler-ia32.h"; sourceTree = "<group>"; };
897FF1030E719B8F00D62E90 /* assembler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = assembler.cc; sourceTree = "<group>"; };
897FF1040E719B8F00D62E90 /* assembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = assembler.h; sourceTree = "<group>"; };
897FF1050E719B8F00D62E90 /* ast.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ast.cc; sourceTree = "<group>"; };
897FF1060E719B8F00D62E90 /* ast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ast.h; sourceTree = "<group>"; };
897FF1070E719B8F00D62E90 /* bootstrapper.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bootstrapper.cc; sourceTree = "<group>"; };
897FF1080E719B8F00D62E90 /* bootstrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootstrapper.h; sourceTree = "<group>"; };
- 897FF1090E719B8F00D62E90 /* arm/builtins-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "arm/builtins-arm.cc"; sourceTree = "<group>"; };
- 897FF10A0E719B8F00D62E90 /* ia32/builtins-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "ia32/builtins-ia32.cc"; sourceTree = "<group>"; };
+ 897FF1090E719B8F00D62E90 /* builtins-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "builtins-arm.cc"; path = "arm/builtins-arm.cc"; sourceTree = "<group>"; };
+ 897FF10A0E719B8F00D62E90 /* builtins-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "builtins-ia32.cc"; path = "ia32/builtins-ia32.cc"; sourceTree = "<group>"; };
897FF10B0E719B8F00D62E90 /* builtins.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = builtins.cc; sourceTree = "<group>"; };
897FF10C0E719B8F00D62E90 /* builtins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = builtins.h; sourceTree = "<group>"; };
897FF10D0E719B8F00D62E90 /* char-predicates-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "char-predicates-inl.h"; sourceTree = "<group>"; };
@@ -338,14 +340,14 @@
897FF1110E719B8F00D62E90 /* code-stubs.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "code-stubs.cc"; sourceTree = "<group>"; };
897FF1120E719B8F00D62E90 /* code-stubs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "code-stubs.h"; sourceTree = "<group>"; };
897FF1130E719B8F00D62E90 /* code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = code.h; sourceTree = "<group>"; };
- 897FF1140E719B8F00D62E90 /* arm/codegen-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "arm/codegen-arm.cc"; sourceTree = "<group>"; };
- 897FF1150E719B8F00D62E90 /* ia32/codegen-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "ia32/codegen-ia32.cc"; sourceTree = "<group>"; };
+ 897FF1140E719B8F00D62E90 /* codegen-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "codegen-arm.cc"; path = "arm/codegen-arm.cc"; sourceTree = "<group>"; };
+ 897FF1150E719B8F00D62E90 /* codegen-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "codegen-ia32.cc"; path = "ia32/codegen-ia32.cc"; sourceTree = "<group>"; };
897FF1160E719B8F00D62E90 /* codegen-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "codegen-inl.h"; sourceTree = "<group>"; };
897FF1170E719B8F00D62E90 /* codegen.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = codegen.cc; sourceTree = "<group>"; };
897FF1180E719B8F00D62E90 /* codegen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = codegen.h; sourceTree = "<group>"; };
897FF1190E719B8F00D62E90 /* compiler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = compiler.cc; sourceTree = "<group>"; };
897FF11A0E719B8F00D62E90 /* compiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = compiler.h; sourceTree = "<group>"; };
- 897FF11B0E719B8F00D62E90 /* arm/constants-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "arm/constants-arm.h"; sourceTree = "<group>"; };
+ 897FF11B0E719B8F00D62E90 /* constants-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "constants-arm.h"; path = "arm/constants-arm.h"; sourceTree = "<group>"; };
897FF11C0E719B8F00D62E90 /* contexts.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = contexts.cc; sourceTree = "<group>"; };
897FF11D0E719B8F00D62E90 /* contexts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = contexts.h; sourceTree = "<group>"; };
897FF11E0E719B8F00D62E90 /* conversions-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "conversions-inl.h"; sourceTree = "<group>"; };
@@ -353,15 +355,15 @@
897FF1200E719B8F00D62E90 /* conversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conversions.h; sourceTree = "<group>"; };
897FF1210E719B8F00D62E90 /* counters.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = counters.cc; sourceTree = "<group>"; };
897FF1220E719B8F00D62E90 /* counters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = counters.h; sourceTree = "<group>"; };
- 897FF1230E719B8F00D62E90 /* arm/cpu-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "arm/cpu-arm.cc"; sourceTree = "<group>"; };
- 897FF1240E719B8F00D62E90 /* ia32/cpu-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "ia32/cpu-ia32.cc"; sourceTree = "<group>"; };
+ 897FF1230E719B8F00D62E90 /* cpu-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "cpu-arm.cc"; path = "arm/cpu-arm.cc"; sourceTree = "<group>"; };
+ 897FF1240E719B8F00D62E90 /* cpu-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "cpu-ia32.cc"; path = "ia32/cpu-ia32.cc"; sourceTree = "<group>"; };
897FF1250E719B8F00D62E90 /* cpu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpu.h; sourceTree = "<group>"; };
897FF1260E719B8F00D62E90 /* dateparser.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dateparser.cc; sourceTree = "<group>"; };
897FF1270E719B8F00D62E90 /* dateparser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dateparser.h; sourceTree = "<group>"; };
897FF1280E719B8F00D62E90 /* debug.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = debug.cc; sourceTree = "<group>"; };
897FF1290E719B8F00D62E90 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = "<group>"; };
- 897FF12A0E719B8F00D62E90 /* arm/disasm-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "arm/disasm-arm.cc"; sourceTree = "<group>"; };
- 897FF12B0E719B8F00D62E90 /* ia32/disasm-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "ia32/disasm-ia32.cc"; sourceTree = "<group>"; };
+ 897FF12A0E719B8F00D62E90 /* disasm-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "disasm-arm.cc"; path = "arm/disasm-arm.cc"; sourceTree = "<group>"; };
+ 897FF12B0E719B8F00D62E90 /* disasm-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "disasm-ia32.cc"; path = "ia32/disasm-ia32.cc"; sourceTree = "<group>"; };
897FF12C0E719B8F00D62E90 /* disasm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = disasm.h; sourceTree = "<group>"; };
897FF12D0E719B8F00D62E90 /* disassembler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = disassembler.cc; sourceTree = "<group>"; };
897FF12E0E719B8F00D62E90 /* disassembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = disassembler.h; sourceTree = "<group>"; };
@@ -372,10 +374,10 @@
897FF1330E719B8F00D62E90 /* factory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = factory.h; sourceTree = "<group>"; };
897FF1350E719B8F00D62E90 /* flags.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = flags.cc; sourceTree = "<group>"; };
897FF1360E719B8F00D62E90 /* flags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = flags.h; sourceTree = "<group>"; };
- 897FF1370E719B8F00D62E90 /* arm/frames-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "arm/frames-arm.cc"; sourceTree = "<group>"; };
- 897FF1380E719B8F00D62E90 /* arm/frames-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "arm/frames-arm.h"; sourceTree = "<group>"; };
- 897FF1390E719B8F00D62E90 /* ia32/frames-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "ia32/frames-ia32.cc"; sourceTree = "<group>"; };
- 897FF13A0E719B8F00D62E90 /* ia32/frames-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ia32/frames-ia32.h"; sourceTree = "<group>"; };
+ 897FF1370E719B8F00D62E90 /* frames-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "frames-arm.cc"; path = "arm/frames-arm.cc"; sourceTree = "<group>"; };
+ 897FF1380E719B8F00D62E90 /* frames-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "frames-arm.h"; path = "arm/frames-arm.h"; sourceTree = "<group>"; };
+ 897FF1390E719B8F00D62E90 /* frames-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "frames-ia32.cc"; path = "ia32/frames-ia32.cc"; sourceTree = "<group>"; };
+ 897FF13A0E719B8F00D62E90 /* frames-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "frames-ia32.h"; path = "ia32/frames-ia32.h"; sourceTree = "<group>"; };
897FF13B0E719B8F00D62E90 /* frames-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "frames-inl.h"; sourceTree = "<group>"; };
897FF13C0E719B8F00D62E90 /* frames.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = frames.cc; sourceTree = "<group>"; };
897FF13D0E719B8F00D62E90 /* frames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = frames.h; sourceTree = "<group>"; };
@@ -390,8 +392,8 @@
897FF1460E719B8F00D62E90 /* heap-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "heap-inl.h"; sourceTree = "<group>"; };
897FF1470E719B8F00D62E90 /* heap.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = heap.cc; sourceTree = "<group>"; };
897FF1480E719B8F00D62E90 /* heap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = heap.h; sourceTree = "<group>"; };
- 897FF1490E719B8F00D62E90 /* arm/ic-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "arm/ic-arm.cc"; sourceTree = "<group>"; };
- 897FF14A0E719B8F00D62E90 /* ia32/ic-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "ia32/ic-ia32.cc"; sourceTree = "<group>"; };
+ 897FF1490E719B8F00D62E90 /* ic-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "ic-arm.cc"; path = "arm/ic-arm.cc"; sourceTree = "<group>"; };
+ 897FF14A0E719B8F00D62E90 /* ic-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "ic-ia32.cc"; path = "ia32/ic-ia32.cc"; sourceTree = "<group>"; };
897FF14B0E719B8F00D62E90 /* ic-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ic-inl.h"; sourceTree = "<group>"; };
897FF14C0E719B8F00D62E90 /* ic.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ic.cc; sourceTree = "<group>"; };
897FF14D0E719B8F00D62E90 /* ic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ic.h; sourceTree = "<group>"; };
@@ -401,10 +403,10 @@
897FF1510E719B8F00D62E90 /* list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = list.h; sourceTree = "<group>"; };
897FF1520E719B8F00D62E90 /* log.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = log.cc; sourceTree = "<group>"; };
897FF1530E719B8F00D62E90 /* log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = log.h; sourceTree = "<group>"; };
- 897FF1540E719B8F00D62E90 /* arm/macro-assembler-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "arm/macro-assembler-arm.cc"; sourceTree = "<group>"; };
- 897FF1550E719B8F00D62E90 /* arm/macro-assembler-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "arm/macro-assembler-arm.h"; sourceTree = "<group>"; };
- 897FF1560E719B8F00D62E90 /* ia32/macro-assembler-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "ia32/macro-assembler-ia32.cc"; sourceTree = "<group>"; };
- 897FF1570E719B8F00D62E90 /* ia32/macro-assembler-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ia32/macro-assembler-ia32.h"; sourceTree = "<group>"; };
+ 897FF1540E719B8F00D62E90 /* macro-assembler-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "macro-assembler-arm.cc"; path = "arm/macro-assembler-arm.cc"; sourceTree = "<group>"; };
+ 897FF1550E719B8F00D62E90 /* macro-assembler-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "macro-assembler-arm.h"; path = "arm/macro-assembler-arm.h"; sourceTree = "<group>"; };
+ 897FF1560E719B8F00D62E90 /* macro-assembler-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "macro-assembler-ia32.cc"; path = "ia32/macro-assembler-ia32.cc"; sourceTree = "<group>"; };
+ 897FF1570E719B8F00D62E90 /* macro-assembler-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "macro-assembler-ia32.h"; path = "ia32/macro-assembler-ia32.h"; sourceTree = "<group>"; };
897FF1580E719B8F00D62E90 /* macro-assembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "macro-assembler.h"; sourceTree = "<group>"; };
897FF1590E719B8F00D62E90 /* mark-compact.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "mark-compact.cc"; sourceTree = "<group>"; };
897FF15A0E719B8F00D62E90 /* mark-compact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "mark-compact.h"; sourceTree = "<group>"; };
@@ -442,10 +444,10 @@
897FF17A0E719B8F00D62E90 /* serialize.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = serialize.cc; sourceTree = "<group>"; };
897FF17B0E719B8F00D62E90 /* serialize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = serialize.h; sourceTree = "<group>"; };
897FF17C0E719B8F00D62E90 /* shell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shell.h; sourceTree = "<group>"; };
- 897FF17D0E719B8F00D62E90 /* arm/simulator-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "arm/simulator-arm.cc"; sourceTree = "<group>"; };
- 897FF17E0E719B8F00D62E90 /* arm/simulator-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "arm/simulator-arm.h"; sourceTree = "<group>"; };
- 897FF17F0E719B8F00D62E90 /* ia32/simulator-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "ia32/simulator-ia32.cc"; sourceTree = "<group>"; };
- 897FF1800E719B8F00D62E90 /* ia32/simulator-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ia32/simulator-ia32.h"; sourceTree = "<group>"; };
+ 897FF17D0E719B8F00D62E90 /* simulator-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "simulator-arm.cc"; path = "arm/simulator-arm.cc"; sourceTree = "<group>"; };
+ 897FF17E0E719B8F00D62E90 /* simulator-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "simulator-arm.h"; path = "arm/simulator-arm.h"; sourceTree = "<group>"; };
+ 897FF17F0E719B8F00D62E90 /* simulator-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "simulator-ia32.cc"; path = "ia32/simulator-ia32.cc"; sourceTree = "<group>"; };
+ 897FF1800E719B8F00D62E90 /* simulator-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "simulator-ia32.h"; path = "ia32/simulator-ia32.h"; sourceTree = "<group>"; };
897FF1810E719B8F00D62E90 /* smart-pointer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "smart-pointer.h"; sourceTree = "<group>"; };
897FF1820E719B8F00D62E90 /* snapshot-common.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "snapshot-common.cc"; sourceTree = "<group>"; };
897FF1830E719B8F00D62E90 /* snapshot-empty.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "snapshot-empty.cc"; sourceTree = "<group>"; };
@@ -455,8 +457,8 @@
897FF1870E719B8F00D62E90 /* spaces.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spaces.h; sourceTree = "<group>"; };
897FF1880E719B8F00D62E90 /* string-stream.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "string-stream.cc"; sourceTree = "<group>"; };
897FF1890E719B8F00D62E90 /* string-stream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "string-stream.h"; sourceTree = "<group>"; };
- 897FF18A0E719B8F00D62E90 /* arm/stub-cache-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "arm/stub-cache-arm.cc"; sourceTree = "<group>"; };
- 897FF18B0E719B8F00D62E90 /* ia32/stub-cache-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "ia32/stub-cache-ia32.cc"; sourceTree = "<group>"; };
+ 897FF18A0E719B8F00D62E90 /* stub-cache-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "stub-cache-arm.cc"; path = "arm/stub-cache-arm.cc"; sourceTree = "<group>"; };
+ 897FF18B0E719B8F00D62E90 /* stub-cache-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "stub-cache-ia32.cc"; path = "ia32/stub-cache-ia32.cc"; sourceTree = "<group>"; };
897FF18C0E719B8F00D62E90 /* stub-cache.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "stub-cache.cc"; sourceTree = "<group>"; };
897FF18D0E719B8F00D62E90 /* stub-cache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "stub-cache.h"; sourceTree = "<group>"; };
897FF18E0E719B8F00D62E90 /* token.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = token.cc; sourceTree = "<group>"; };
@@ -496,17 +498,19 @@
897FF1B50E719C0900D62E90 /* shell.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = shell.cc; sourceTree = "<group>"; };
897FF1B60E719C2300D62E90 /* js2c.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = js2c.py; sourceTree = "<group>"; };
897FF1B70E719C2E00D62E90 /* macros.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = macros.py; path = ../src/macros.py; sourceTree = "<group>"; };
- 898BD20C0EF6CC850068B00A /* arm/debug-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "arm/debug-arm.cc"; sourceTree = "<group>"; };
- 898BD20D0EF6CC850068B00A /* ia32/debug-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "ia32/debug-ia32.cc"; sourceTree = "<group>"; };
+ 897FF32F0FAA0ED200136CF6 /* version.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = version.cc; sourceTree = "<group>"; };
+ 897FF3300FAA0ED200136CF6 /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = "<group>"; };
+ 898BD20C0EF6CC850068B00A /* debug-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "debug-arm.cc"; path = "arm/debug-arm.cc"; sourceTree = "<group>"; };
+ 898BD20D0EF6CC850068B00A /* debug-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "debug-ia32.cc"; path = "ia32/debug-ia32.cc"; sourceTree = "<group>"; };
89A15C630EE4661A00B48DEB /* bytecodes-irregexp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "bytecodes-irregexp.h"; sourceTree = "<group>"; };
89A15C660EE4665300B48DEB /* interpreter-irregexp.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "interpreter-irregexp.cc"; sourceTree = "<group>"; };
89A15C670EE4665300B48DEB /* interpreter-irregexp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "interpreter-irregexp.h"; sourceTree = "<group>"; };
89A15C680EE4665300B48DEB /* jsregexp-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "jsregexp-inl.h"; sourceTree = "<group>"; };
89A15C6D0EE466A900B48DEB /* platform-freebsd.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "platform-freebsd.cc"; sourceTree = "<group>"; };
- 89A15C700EE466D000B48DEB /* arm/regexp-macro-assembler-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "arm/regexp-macro-assembler-arm.cc"; sourceTree = "<group>"; };
- 89A15C710EE466D000B48DEB /* arm/regexp-macro-assembler-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "arm/regexp-macro-assembler-arm.h"; sourceTree = "<group>"; };
- 89A15C720EE466D000B48DEB /* ia32/regexp-macro-assembler-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "ia32/regexp-macro-assembler-ia32.cc"; sourceTree = "<group>"; };
- 89A15C730EE466D000B48DEB /* ia32/regexp-macro-assembler-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ia32/regexp-macro-assembler-ia32.h"; sourceTree = "<group>"; };
+ 89A15C700EE466D000B48DEB /* regexp-macro-assembler-arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "regexp-macro-assembler-arm.cc"; path = "arm/regexp-macro-assembler-arm.cc"; sourceTree = "<group>"; };
+ 89A15C710EE466D000B48DEB /* regexp-macro-assembler-arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "regexp-macro-assembler-arm.h"; path = "arm/regexp-macro-assembler-arm.h"; sourceTree = "<group>"; };
+ 89A15C720EE466D000B48DEB /* regexp-macro-assembler-ia32.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "regexp-macro-assembler-ia32.cc"; path = "ia32/regexp-macro-assembler-ia32.cc"; sourceTree = "<group>"; };
+ 89A15C730EE466D000B48DEB /* regexp-macro-assembler-ia32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "regexp-macro-assembler-ia32.h"; path = "ia32/regexp-macro-assembler-ia32.h"; sourceTree = "<group>"; };
89A15C740EE466D000B48DEB /* regexp-macro-assembler-irregexp-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "regexp-macro-assembler-irregexp-inl.h"; sourceTree = "<group>"; };
89A15C750EE466D000B48DEB /* regexp-macro-assembler-irregexp.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "regexp-macro-assembler-irregexp.cc"; sourceTree = "<group>"; };
89A15C760EE466D000B48DEB /* regexp-macro-assembler-irregexp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "regexp-macro-assembler-irregexp.h"; sourceTree = "<group>"; };
@@ -622,20 +626,20 @@
897FF0FB0E719B8F00D62E90 /* api.h */,
893986D40F29020C007D5254 /* apiutils.h */,
897FF0FC0E719B8F00D62E90 /* arguments.h */,
- 897FF0FD0E719B8F00D62E90 /* arm/assembler-arm-inl.h */,
- 897FF0FE0E719B8F00D62E90 /* arm/assembler-arm.cc */,
- 897FF0FF0E719B8F00D62E90 /* arm/assembler-arm.h */,
- 897FF1000E719B8F00D62E90 /* ia32/assembler-ia32-inl.h */,
- 897FF1010E719B8F00D62E90 /* ia32/assembler-ia32.cc */,
- 897FF1020E719B8F00D62E90 /* ia32/assembler-ia32.h */,
+ 897FF0FD0E719B8F00D62E90 /* assembler-arm-inl.h */,
+ 897FF0FE0E719B8F00D62E90 /* assembler-arm.cc */,
+ 897FF0FF0E719B8F00D62E90 /* assembler-arm.h */,
+ 897FF1000E719B8F00D62E90 /* assembler-ia32-inl.h */,
+ 897FF1010E719B8F00D62E90 /* assembler-ia32.cc */,
+ 897FF1020E719B8F00D62E90 /* assembler-ia32.h */,
897FF1030E719B8F00D62E90 /* assembler.cc */,
897FF1040E719B8F00D62E90 /* assembler.h */,
897FF1050E719B8F00D62E90 /* ast.cc */,
897FF1060E719B8F00D62E90 /* ast.h */,
897FF1070E719B8F00D62E90 /* bootstrapper.cc */,
897FF1080E719B8F00D62E90 /* bootstrapper.h */,
- 897FF1090E719B8F00D62E90 /* arm/builtins-arm.cc */,
- 897FF10A0E719B8F00D62E90 /* ia32/builtins-ia32.cc */,
+ 897FF1090E719B8F00D62E90 /* builtins-arm.cc */,
+ 897FF10A0E719B8F00D62E90 /* builtins-ia32.cc */,
897FF10B0E719B8F00D62E90 /* builtins.cc */,
897FF10C0E719B8F00D62E90 /* builtins.h */,
89A15C630EE4661A00B48DEB /* bytecodes-irregexp.h */,
@@ -646,10 +650,10 @@
897FF1110E719B8F00D62E90 /* code-stubs.cc */,
897FF1120E719B8F00D62E90 /* code-stubs.h */,
897FF1130E719B8F00D62E90 /* code.h */,
- 897FF1140E719B8F00D62E90 /* arm/codegen-arm.cc */,
- 896448BC0E9D530500E7C516 /* arm/codegen-arm.h */,
- 897FF1150E719B8F00D62E90 /* ia32/codegen-ia32.cc */,
- 8964482B0E9C00F700E7C516 /* ia32/codegen-ia32.h */,
+ 897FF1140E719B8F00D62E90 /* codegen-arm.cc */,
+ 896448BC0E9D530500E7C516 /* codegen-arm.h */,
+ 897FF1150E719B8F00D62E90 /* codegen-ia32.cc */,
+ 8964482B0E9C00F700E7C516 /* codegen-ia32.h */,
897FF1160E719B8F00D62E90 /* codegen-inl.h */,
897FF1170E719B8F00D62E90 /* codegen.cc */,
897FF1180E719B8F00D62E90 /* codegen.h */,
@@ -657,7 +661,7 @@
89495E470E79FC23001F68C3 /* compilation-cache.h */,
897FF1190E719B8F00D62E90 /* compiler.cc */,
897FF11A0E719B8F00D62E90 /* compiler.h */,
- 897FF11B0E719B8F00D62E90 /* arm/constants-arm.h */,
+ 897FF11B0E719B8F00D62E90 /* constants-arm.h */,
897FF11C0E719B8F00D62E90 /* contexts.cc */,
897FF11D0E719B8F00D62E90 /* contexts.h */,
897FF11E0E719B8F00D62E90 /* conversions-inl.h */,
@@ -665,20 +669,20 @@
897FF1200E719B8F00D62E90 /* conversions.h */,
897FF1210E719B8F00D62E90 /* counters.cc */,
897FF1220E719B8F00D62E90 /* counters.h */,
- 897FF1230E719B8F00D62E90 /* arm/cpu-arm.cc */,
- 897FF1240E719B8F00D62E90 /* ia32/cpu-ia32.cc */,
+ 897FF1230E719B8F00D62E90 /* cpu-arm.cc */,
+ 897FF1240E719B8F00D62E90 /* cpu-ia32.cc */,
897FF1250E719B8F00D62E90 /* cpu.h */,
893A722A0F7B4A3200303DD2 /* dateparser-inl.h */,
897FF1260E719B8F00D62E90 /* dateparser.cc */,
897FF1270E719B8F00D62E90 /* dateparser.h */,
- 898BD20C0EF6CC850068B00A /* arm/debug-arm.cc */,
- 898BD20D0EF6CC850068B00A /* ia32/debug-ia32.cc */,
+ 898BD20C0EF6CC850068B00A /* debug-arm.cc */,
+ 898BD20D0EF6CC850068B00A /* debug-ia32.cc */,
897FF1280E719B8F00D62E90 /* debug.cc */,
897FF1290E719B8F00D62E90 /* debug.h */,
8956B6CD0F5D86570033B5A2 /* debug-agent.cc */,
8956B6CE0F5D86570033B5A2 /* debug-agent.h */,
- 897FF12A0E719B8F00D62E90 /* arm/disasm-arm.cc */,
- 897FF12B0E719B8F00D62E90 /* ia32/disasm-ia32.cc */,
+ 897FF12A0E719B8F00D62E90 /* disasm-arm.cc */,
+ 897FF12B0E719B8F00D62E90 /* disasm-ia32.cc */,
897FF12C0E719B8F00D62E90 /* disasm.h */,
897FF12D0E719B8F00D62E90 /* disassembler.cc */,
897FF12E0E719B8F00D62E90 /* disassembler.h */,
@@ -690,10 +694,10 @@
89471C7F0EB23EE400B6874B /* flag-definitions.h */,
897FF1350E719B8F00D62E90 /* flags.cc */,
897FF1360E719B8F00D62E90 /* flags.h */,
- 897FF1370E719B8F00D62E90 /* arm/frames-arm.cc */,
- 897FF1380E719B8F00D62E90 /* arm/frames-arm.h */,
- 897FF1390E719B8F00D62E90 /* ia32/frames-ia32.cc */,
- 897FF13A0E719B8F00D62E90 /* ia32/frames-ia32.h */,
+ 897FF1370E719B8F00D62E90 /* frames-arm.cc */,
+ 897FF1380E719B8F00D62E90 /* frames-arm.h */,
+ 897FF1390E719B8F00D62E90 /* frames-ia32.cc */,
+ 897FF13A0E719B8F00D62E90 /* frames-ia32.h */,
897FF13B0E719B8F00D62E90 /* frames-inl.h */,
897FF13C0E719B8F00D62E90 /* frames.cc */,
897FF13D0E719B8F00D62E90 /* frames.h */,
@@ -710,8 +714,8 @@
897FF1460E719B8F00D62E90 /* heap-inl.h */,
897FF1470E719B8F00D62E90 /* heap.cc */,
897FF1480E719B8F00D62E90 /* heap.h */,
- 897FF1490E719B8F00D62E90 /* arm/ic-arm.cc */,
- 897FF14A0E719B8F00D62E90 /* ia32/ic-ia32.cc */,
+ 897FF1490E719B8F00D62E90 /* ic-arm.cc */,
+ 897FF14A0E719B8F00D62E90 /* ic-ia32.cc */,
897FF14B0E719B8F00D62E90 /* ic-inl.h */,
897FF14C0E719B8F00D62E90 /* ic.cc */,
897FF14D0E719B8F00D62E90 /* ic.h */,
@@ -720,18 +724,18 @@
89A15C680EE4665300B48DEB /* jsregexp-inl.h */,
897FF14E0E719B8F00D62E90 /* jsregexp.cc */,
897FF14F0E719B8F00D62E90 /* jsregexp.h */,
- 58950D4E0F55514900F3E8BA /* arm/jump-target-arm.cc */,
- 58950D4F0F55514900F3E8BA /* ia32/jump-target-ia32.cc */,
+ 58950D4E0F55514900F3E8BA /* jump-target-arm.cc */,
+ 58950D4F0F55514900F3E8BA /* jump-target-ia32.cc */,
58950D500F55514900F3E8BA /* jump-target.cc */,
58950D510F55514900F3E8BA /* jump-target.h */,
897FF1500E719B8F00D62E90 /* list-inl.h */,
897FF1510E719B8F00D62E90 /* list.h */,
897FF1520E719B8F00D62E90 /* log.cc */,
897FF1530E719B8F00D62E90 /* log.h */,
- 897FF1540E719B8F00D62E90 /* arm/macro-assembler-arm.cc */,
- 897FF1550E719B8F00D62E90 /* arm/macro-assembler-arm.h */,
- 897FF1560E719B8F00D62E90 /* ia32/macro-assembler-ia32.cc */,
- 897FF1570E719B8F00D62E90 /* ia32/macro-assembler-ia32.h */,
+ 897FF1540E719B8F00D62E90 /* macro-assembler-arm.cc */,
+ 897FF1550E719B8F00D62E90 /* macro-assembler-arm.h */,
+ 897FF1560E719B8F00D62E90 /* macro-assembler-ia32.cc */,
+ 897FF1570E719B8F00D62E90 /* macro-assembler-ia32.h */,
897FF1580E719B8F00D62E90 /* macro-assembler.h */,
897FF1590E719B8F00D62E90 /* mark-compact.cc */,
897FF15A0E719B8F00D62E90 /* mark-compact.h */,
@@ -759,10 +763,10 @@
897FF16C0E719B8F00D62E90 /* prettyprinter.h */,
897FF16D0E719B8F00D62E90 /* property.cc */,
897FF16E0E719B8F00D62E90 /* property.h */,
- 89A15C700EE466D000B48DEB /* arm/regexp-macro-assembler-arm.cc */,
- 89A15C710EE466D000B48DEB /* arm/regexp-macro-assembler-arm.h */,
- 89A15C720EE466D000B48DEB /* ia32/regexp-macro-assembler-ia32.cc */,
- 89A15C730EE466D000B48DEB /* ia32/regexp-macro-assembler-ia32.h */,
+ 89A15C700EE466D000B48DEB /* regexp-macro-assembler-arm.cc */,
+ 89A15C710EE466D000B48DEB /* regexp-macro-assembler-arm.h */,
+ 89A15C720EE466D000B48DEB /* regexp-macro-assembler-ia32.cc */,
+ 89A15C730EE466D000B48DEB /* regexp-macro-assembler-ia32.h */,
89A15C740EE466D000B48DEB /* regexp-macro-assembler-irregexp-inl.h */,
89A15C750EE466D000B48DEB /* regexp-macro-assembler-irregexp.cc */,
89A15C760EE466D000B48DEB /* regexp-macro-assembler-irregexp.h */,
@@ -772,8 +776,8 @@
89A15C7A0EE466D000B48DEB /* regexp-macro-assembler.h */,
8944AD0E0F1D4D3A0028D560 /* regexp-stack.cc */,
8944AD0F0F1D4D3A0028D560 /* regexp-stack.h */,
- 58950D520F55514900F3E8BA /* arm/register-allocator-arm.cc */,
- 58950D530F55514900F3E8BA /* ia32/register-allocator-ia32.cc */,
+ 58950D520F55514900F3E8BA /* register-allocator-arm.cc */,
+ 58950D530F55514900F3E8BA /* register-allocator-ia32.cc */,
893A722D0F7B4A7100303DD2 /* register-allocator-inl.h */,
58950D540F55514900F3E8BA /* register-allocator.cc */,
58950D550F55514900F3E8BA /* register-allocator.h */,
@@ -791,10 +795,10 @@
897FF17A0E719B8F00D62E90 /* serialize.cc */,
897FF17B0E719B8F00D62E90 /* serialize.h */,
897FF17C0E719B8F00D62E90 /* shell.h */,
- 897FF17D0E719B8F00D62E90 /* arm/simulator-arm.cc */,
- 897FF17E0E719B8F00D62E90 /* arm/simulator-arm.h */,
- 897FF17F0E719B8F00D62E90 /* ia32/simulator-ia32.cc */,
- 897FF1800E719B8F00D62E90 /* ia32/simulator-ia32.h */,
+ 897FF17D0E719B8F00D62E90 /* simulator-arm.cc */,
+ 897FF17E0E719B8F00D62E90 /* simulator-arm.h */,
+ 897FF17F0E719B8F00D62E90 /* simulator-ia32.cc */,
+ 897FF1800E719B8F00D62E90 /* simulator-ia32.h */,
897FF1810E719B8F00D62E90 /* smart-pointer.h */,
897FF1820E719B8F00D62E90 /* snapshot-common.cc */,
897FF1830E719B8F00D62E90 /* snapshot-empty.cc */,
@@ -804,8 +808,8 @@
897FF1870E719B8F00D62E90 /* spaces.h */,
897FF1880E719B8F00D62E90 /* string-stream.cc */,
897FF1890E719B8F00D62E90 /* string-stream.h */,
- 897FF18A0E719B8F00D62E90 /* arm/stub-cache-arm.cc */,
- 897FF18B0E719B8F00D62E90 /* ia32/stub-cache-ia32.cc */,
+ 897FF18A0E719B8F00D62E90 /* stub-cache-arm.cc */,
+ 897FF18B0E719B8F00D62E90 /* stub-cache-ia32.cc */,
897FF18C0E719B8F00D62E90 /* stub-cache.cc */,
897FF18D0E719B8F00D62E90 /* stub-cache.h */,
897FF18E0E719B8F00D62E90 /* token.cc */,
@@ -827,10 +831,12 @@
897FF19E0E719B8F00D62E90 /* v8threads.h */,
897FF19F0E719B8F00D62E90 /* variables.cc */,
897FF1A00E719B8F00D62E90 /* variables.h */,
- 58950D560F55514900F3E8BA /* arm/virtual-frame-arm.cc */,
- 58950D570F55514900F3E8BA /* arm/virtual-frame-arm.h */,
- 58950D580F55514900F3E8BA /* ia32/virtual-frame-ia32.cc */,
- 58950D590F55514900F3E8BA /* ia32/virtual-frame-ia32.h */,
+ 897FF32F0FAA0ED200136CF6 /* version.cc */,
+ 897FF3300FAA0ED200136CF6 /* version.h */,
+ 58950D560F55514900F3E8BA /* virtual-frame-arm.cc */,
+ 58950D570F55514900F3E8BA /* virtual-frame-arm.h */,
+ 58950D580F55514900F3E8BA /* virtual-frame-ia32.cc */,
+ 58950D590F55514900F3E8BA /* virtual-frame-ia32.h */,
58950D5A0F55514900F3E8BA /* virtual-frame.cc */,
58950D5B0F55514900F3E8BA /* virtual-frame.h */,
897FF1A10E719B8F00D62E90 /* zone-inl.h */,
@@ -1097,48 +1103,48 @@
89A88DEC0E71A5FF0043BA31 /* accessors.cc in Sources */,
89A88DED0E71A6000043BA31 /* allocation.cc in Sources */,
89A88DEE0E71A6010043BA31 /* api.cc in Sources */,
- 89A88DEF0E71A60A0043BA31 /* ia32/assembler-ia32.cc in Sources */,
+ 89A88DEF0E71A60A0043BA31 /* assembler-ia32.cc in Sources */,
89A88DF00E71A60A0043BA31 /* assembler.cc in Sources */,
89A88DF10E71A60B0043BA31 /* ast.cc in Sources */,
89A88DF20E71A60C0043BA31 /* bootstrapper.cc in Sources */,
- 89A88DF40E71A6160043BA31 /* ia32/builtins-ia32.cc in Sources */,
+ 89A88DF40E71A6160043BA31 /* builtins-ia32.cc in Sources */,
89A88DF50E71A6170043BA31 /* builtins.cc in Sources */,
89A88DF60E71A61C0043BA31 /* checks.cc in Sources */,
893CCE640E71D83700357A03 /* code-stubs.cc in Sources */,
- 89A88DF70E71A6240043BA31 /* ia32/codegen-ia32.cc in Sources */,
+ 89A88DF70E71A6240043BA31 /* codegen-ia32.cc in Sources */,
89A88DF80E71A6260043BA31 /* codegen.cc in Sources */,
89495E480E79FC23001F68C3 /* compilation-cache.cc in Sources */,
89A88DF90E71A6430043BA31 /* compiler.cc in Sources */,
89A88DFA0E71A6440043BA31 /* contexts.cc in Sources */,
89A88DFB0E71A6440043BA31 /* conversions.cc in Sources */,
89A88DFC0E71A6460043BA31 /* counters.cc in Sources */,
- 89A88DFD0E71A6470043BA31 /* ia32/cpu-ia32.cc in Sources */,
+ 89A88DFD0E71A6470043BA31 /* cpu-ia32.cc in Sources */,
89A88DFE0E71A6480043BA31 /* dateparser.cc in Sources */,
8956B6CF0F5D86730033B5A2 /* debug-agent.cc in Sources */,
- 898BD20E0EF6CC930068B00A /* ia32/debug-ia32.cc in Sources */,
+ 898BD20E0EF6CC930068B00A /* debug-ia32.cc in Sources */,
89A88DFF0E71A6530043BA31 /* debug.cc in Sources */,
- 89A88E000E71A6540043BA31 /* ia32/disasm-ia32.cc in Sources */,
+ 89A88E000E71A6540043BA31 /* disasm-ia32.cc in Sources */,
89A88E010E71A6550043BA31 /* disassembler.cc in Sources */,
89A88E020E71A65A0043BA31 /* dtoa-config.c in Sources */,
89A88E030E71A65B0043BA31 /* execution.cc in Sources */,
89A88E040E71A65D0043BA31 /* factory.cc in Sources */,
89A88E050E71A65D0043BA31 /* flags.cc in Sources */,
- 89A88E060E71A6600043BA31 /* ia32/frames-ia32.cc in Sources */,
+ 89A88E060E71A6600043BA31 /* frames-ia32.cc in Sources */,
89A88E070E71A6610043BA31 /* frames.cc in Sources */,
9F92FAA90F8F28AD0089F02C /* func-name-inferrer.cc in Sources */,
89A88E080E71A6620043BA31 /* global-handles.cc in Sources */,
89A88E090E71A6640043BA31 /* handles.cc in Sources */,
89A88E0A0E71A6650043BA31 /* hashmap.cc in Sources */,
89A88E0B0E71A66C0043BA31 /* heap.cc in Sources */,
- 89A88E0C0E71A66D0043BA31 /* ia32/ic-ia32.cc in Sources */,
+ 89A88E0C0E71A66D0043BA31 /* ic-ia32.cc in Sources */,
89A88E0D0E71A66E0043BA31 /* ic.cc in Sources */,
89A15C850EE4678B00B48DEB /* interpreter-irregexp.cc in Sources */,
89A88E0E0E71A66F0043BA31 /* jsregexp.cc in Sources */,
58950D5E0F55519800F3E8BA /* jump-target.cc in Sources */,
- 58950D5F0F55519D00F3E8BA /* ia32/jump-target-ia32.cc in Sources */,
+ 58950D5F0F55519D00F3E8BA /* jump-target-ia32.cc in Sources */,
8900116C0E71CA2300F91F35 /* libraries.cc in Sources */,
89A88E0F0E71A6740043BA31 /* log.cc in Sources */,
- 89A88E100E71A6770043BA31 /* ia32/macro-assembler-ia32.cc in Sources */,
+ 89A88E100E71A6770043BA31 /* macro-assembler-ia32.cc in Sources */,
89A88E110E71A6780043BA31 /* mark-compact.cc in Sources */,
89A88E120E71A67A0043BA31 /* messages.cc in Sources */,
89A88E130E71A6860043BA31 /* objects-debug.cc in Sources */,
@@ -1149,12 +1155,12 @@
89A88E160E71A68E0043BA31 /* platform-macos.cc in Sources */,
89A88E170E71A6950043BA31 /* prettyprinter.cc in Sources */,
89A88E180E71A6960043BA31 /* property.cc in Sources */,
- 89A15C7B0EE466EB00B48DEB /* ia32/regexp-macro-assembler-ia32.cc in Sources */,
+ 89A15C7B0EE466EB00B48DEB /* regexp-macro-assembler-ia32.cc in Sources */,
89A15C830EE4675E00B48DEB /* regexp-macro-assembler-irregexp.cc in Sources */,
89A15C8A0EE467D100B48DEB /* regexp-macro-assembler-tracer.cc in Sources */,
89A15C810EE4674900B48DEB /* regexp-macro-assembler.cc in Sources */,
8944AD100F1D4D500028D560 /* regexp-stack.cc in Sources */,
- 58950D620F5551AF00F3E8BA /* ia32/register-allocator-ia32.cc in Sources */,
+ 58950D620F5551AF00F3E8BA /* register-allocator-ia32.cc in Sources */,
58950D630F5551AF00F3E8BA /* register-allocator.cc in Sources */,
89A88E190E71A6970043BA31 /* rewriter.cc in Sources */,
89A88E1A0E71A69B0043BA31 /* runtime.cc in Sources */,
@@ -1166,7 +1172,7 @@
89A88E200E71A6B60043BA31 /* snapshot-empty.cc in Sources */,
89A88E210E71A6B70043BA31 /* spaces.cc in Sources */,
89A88E220E71A6BC0043BA31 /* string-stream.cc in Sources */,
- 89A88E230E71A6BE0043BA31 /* ia32/stub-cache-ia32.cc in Sources */,
+ 89A88E230E71A6BE0043BA31 /* stub-cache-ia32.cc in Sources */,
89A88E240E71A6BF0043BA31 /* stub-cache.cc in Sources */,
89A88E250E71A6C20043BA31 /* token.cc in Sources */,
89A88E260E71A6C90043BA31 /* top.cc in Sources */,
@@ -1177,8 +1183,9 @@
89A88E2B0E71A6D10043BA31 /* v8.cc in Sources */,
89A88E2C0E71A6D20043BA31 /* v8threads.cc in Sources */,
89A88E2D0E71A6D50043BA31 /* variables.cc in Sources */,
+ 89B933AF0FAA0F9600201304 /* version.cc in Sources */,
58950D660F5551C200F3E8BA /* virtual-frame.cc in Sources */,
- 58950D670F5551C400F3E8BA /* ia32/virtual-frame-ia32.cc in Sources */,
+ 58950D670F5551C400F3E8BA /* virtual-frame-ia32.cc in Sources */,
89A88E2E0E71A6D60043BA31 /* zone.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -1198,48 +1205,48 @@
89F23C3F0E78D5B2006B2466 /* accessors.cc in Sources */,
89F23C400E78D5B2006B2466 /* allocation.cc in Sources */,
89F23C410E78D5B2006B2466 /* api.cc in Sources */,
- 89F23C970E78D5E3006B2466 /* arm/assembler-arm.cc in Sources */,
+ 89F23C970E78D5E3006B2466 /* assembler-arm.cc in Sources */,
89F23C430E78D5B2006B2466 /* assembler.cc in Sources */,
89F23C440E78D5B2006B2466 /* ast.cc in Sources */,
89F23C450E78D5B2006B2466 /* bootstrapper.cc in Sources */,
- 89F23C980E78D5E7006B2466 /* arm/builtins-arm.cc in Sources */,
+ 89F23C980E78D5E7006B2466 /* builtins-arm.cc in Sources */,
89F23C470E78D5B2006B2466 /* builtins.cc in Sources */,
89F23C480E78D5B2006B2466 /* checks.cc in Sources */,
89F23C490E78D5B2006B2466 /* code-stubs.cc in Sources */,
- 89F23C990E78D5E9006B2466 /* arm/codegen-arm.cc in Sources */,
+ 89F23C990E78D5E9006B2466 /* codegen-arm.cc in Sources */,
89F23C4B0E78D5B2006B2466 /* codegen.cc in Sources */,
89495E490E79FC23001F68C3 /* compilation-cache.cc in Sources */,
89F23C4C0E78D5B2006B2466 /* compiler.cc in Sources */,
89F23C4D0E78D5B2006B2466 /* contexts.cc in Sources */,
89F23C4E0E78D5B2006B2466 /* conversions.cc in Sources */,
89F23C4F0E78D5B2006B2466 /* counters.cc in Sources */,
- 89F23C9A0E78D5EC006B2466 /* arm/cpu-arm.cc in Sources */,
+ 89F23C9A0E78D5EC006B2466 /* cpu-arm.cc in Sources */,
89F23C510E78D5B2006B2466 /* dateparser.cc in Sources */,
894599A30F5D8729008DA8FB /* debug-agent.cc in Sources */,
- 898BD20F0EF6CC9A0068B00A /* arm/debug-arm.cc in Sources */,
+ 898BD20F0EF6CC9A0068B00A /* debug-arm.cc in Sources */,
89F23C520E78D5B2006B2466 /* debug.cc in Sources */,
- 89F23C9B0E78D5EE006B2466 /* arm/disasm-arm.cc in Sources */,
+ 89F23C9B0E78D5EE006B2466 /* disasm-arm.cc in Sources */,
89F23C540E78D5B2006B2466 /* disassembler.cc in Sources */,
89F23C550E78D5B2006B2466 /* dtoa-config.c in Sources */,
89F23C560E78D5B2006B2466 /* execution.cc in Sources */,
89F23C570E78D5B2006B2466 /* factory.cc in Sources */,
89F23C580E78D5B2006B2466 /* flags.cc in Sources */,
- 89F23C9C0E78D5F1006B2466 /* arm/frames-arm.cc in Sources */,
+ 89F23C9C0E78D5F1006B2466 /* frames-arm.cc in Sources */,
89F23C5A0E78D5B2006B2466 /* frames.cc in Sources */,
9F92FAAA0F8F28AD0089F02C /* func-name-inferrer.cc in Sources */,
89F23C5B0E78D5B2006B2466 /* global-handles.cc in Sources */,
89F23C5C0E78D5B2006B2466 /* handles.cc in Sources */,
89F23C5D0E78D5B2006B2466 /* hashmap.cc in Sources */,
89F23C5E0E78D5B2006B2466 /* heap.cc in Sources */,
- 89F23C9D0E78D5FB006B2466 /* arm/ic-arm.cc in Sources */,
+ 89F23C9D0E78D5FB006B2466 /* ic-arm.cc in Sources */,
89F23C600E78D5B2006B2466 /* ic.cc in Sources */,
890A13FE0EE9C47F00E49346 /* interpreter-irregexp.cc in Sources */,
89F23C610E78D5B2006B2466 /* jsregexp.cc in Sources */,
58950D600F5551A300F3E8BA /* jump-target.cc in Sources */,
- 58950D610F5551A400F3E8BA /* arm/jump-target-arm.cc in Sources */,
+ 58950D610F5551A400F3E8BA /* jump-target-arm.cc in Sources */,
89F23C620E78D5B2006B2466 /* libraries.cc in Sources */,
89F23C630E78D5B2006B2466 /* log.cc in Sources */,
- 89F23C9E0E78D5FD006B2466 /* arm/macro-assembler-arm.cc in Sources */,
+ 89F23C9E0E78D5FD006B2466 /* macro-assembler-arm.cc in Sources */,
89F23C650E78D5B2006B2466 /* mark-compact.cc in Sources */,
89F23C660E78D5B2006B2466 /* messages.cc in Sources */,
89F23C670E78D5B2006B2466 /* objects-debug.cc in Sources */,
@@ -1250,25 +1257,25 @@
89F23C6A0E78D5B2006B2466 /* platform-macos.cc in Sources */,
89F23C6B0E78D5B2006B2466 /* prettyprinter.cc in Sources */,
89F23C6C0E78D5B2006B2466 /* property.cc in Sources */,
- 890A14010EE9C4B000E49346 /* arm/regexp-macro-assembler-arm.cc in Sources */,
+ 890A14010EE9C4B000E49346 /* regexp-macro-assembler-arm.cc in Sources */,
890A14020EE9C4B400E49346 /* regexp-macro-assembler-irregexp.cc in Sources */,
890A14030EE9C4B500E49346 /* regexp-macro-assembler-tracer.cc in Sources */,
890A14040EE9C4B700E49346 /* regexp-macro-assembler.cc in Sources */,
8944AD110F1D4D570028D560 /* regexp-stack.cc in Sources */,
58950D640F5551B500F3E8BA /* register-allocator.cc in Sources */,
- 58950D650F5551B600F3E8BA /* arm/register-allocator-arm.cc in Sources */,
+ 58950D650F5551B600F3E8BA /* register-allocator-arm.cc in Sources */,
89F23C6D0E78D5B2006B2466 /* rewriter.cc in Sources */,
89F23C6E0E78D5B2006B2466 /* runtime.cc in Sources */,
89F23C6F0E78D5B2006B2466 /* scanner.cc in Sources */,
89F23C700E78D5B2006B2466 /* scopeinfo.cc in Sources */,
89F23C710E78D5B2006B2466 /* scopes.cc in Sources */,
89F23C720E78D5B2006B2466 /* serialize.cc in Sources */,
- 89F23C9F0E78D604006B2466 /* arm/simulator-arm.cc in Sources */,
+ 89F23C9F0E78D604006B2466 /* simulator-arm.cc in Sources */,
89F23C730E78D5B2006B2466 /* snapshot-common.cc in Sources */,
89F23C740E78D5B2006B2466 /* snapshot-empty.cc in Sources */,
89F23C750E78D5B2006B2466 /* spaces.cc in Sources */,
89F23C760E78D5B2006B2466 /* string-stream.cc in Sources */,
- 89F23CA00E78D609006B2466 /* arm/stub-cache-arm.cc in Sources */,
+ 89F23CA00E78D609006B2466 /* stub-cache-arm.cc in Sources */,
89F23C780E78D5B2006B2466 /* stub-cache.cc in Sources */,
89F23C790E78D5B2006B2466 /* token.cc in Sources */,
89F23C7A0E78D5B2006B2466 /* top.cc in Sources */,
@@ -1279,8 +1286,9 @@
89F23C7F0E78D5B2006B2466 /* v8.cc in Sources */,
89F23C800E78D5B2006B2466 /* v8threads.cc in Sources */,
89F23C810E78D5B2006B2466 /* variables.cc in Sources */,
+ 89B933B00FAA0F9D00201304 /* version.cc in Sources */,
58950D680F5551CB00F3E8BA /* virtual-frame.cc in Sources */,
- 58950D690F5551CE00F3E8BA /* arm/virtual-frame-arm.cc in Sources */,
+ 58950D690F5551CE00F3E8BA /* virtual-frame-arm.cc in Sources */,
89F23C820E78D5B2006B2466 /* zone.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -1428,6 +1436,11 @@
893988090F2A35FA007D5254 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ V8_ARCH_IA32,
+ DEBUG,
+ );
HEADER_SEARCH_PATHS = ../src;
PRODUCT_NAME = v8_shell;
};
@@ -1436,6 +1449,11 @@
8939880A0F2A35FA007D5254 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ V8_ARCH_IA32,
+ NDEBUG,
+ );
HEADER_SEARCH_PATHS = ../src;
PRODUCT_NAME = v8_shell;
};
@@ -1448,6 +1466,7 @@
GCC_PREPROCESSOR_DEFINITIONS = (
"$(GCC_PREPROCESSOR_DEFINITIONS)",
ENABLE_DISASSEMBLER,
+ V8_ARCH_IA32,
ENABLE_LOGGING_AND_PROFILING,
);
HEADER_SEARCH_PATHS = ../src;
@@ -1460,6 +1479,11 @@
isa = XCBuildConfiguration;
buildSettings = {
DEPLOYMENT_POSTPROCESSING = NO;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ V8_ARCH_IA32,
+ NDEBUG,
+ );
HEADER_SEARCH_PATHS = ../src;
PRODUCT_NAME = v8;
STRIP_STYLE = debugging;
@@ -1488,7 +1512,7 @@
DEPLOYMENT_POSTPROCESSING = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(GCC_PREPROCESSOR_DEFINITIONS)",
- ARM,
+ V8_ARCH_ARM,
ENABLE_DISASSEMBLER,
ENABLE_LOGGING_AND_PROFILING,
);
@@ -1504,7 +1528,7 @@
DEPLOYMENT_POSTPROCESSING = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(GCC_PREPROCESSOR_DEFINITIONS)",
- ARM,
+ V8_ARCH_ARM,
);
HEADER_SEARCH_PATHS = ../src;
PRODUCT_NAME = "v8-arm";
diff --git a/tools/visual_studio/arm.vsprops b/tools/visual_studio/arm.vsprops
index 0e37d41..4f0f4e3 100644
--- a/tools/visual_studio/arm.vsprops
+++ b/tools/visual_studio/arm.vsprops
@@ -6,7 +6,7 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="ARM"
+ PreprocessorDefinitions="V8_ARCH_ARM"
DisableSpecificWarnings="4996"
/>
</VisualStudioPropertySheet>
diff --git a/tools/visual_studio/d8.vcproj b/tools/visual_studio/d8.vcproj
index a05a3f3..21636ba 100644
--- a/tools/visual_studio/d8.vcproj
+++ b/tools/visual_studio/d8.vcproj
@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
- InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
@@ -79,7 +79,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="1"
- InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
diff --git a/tools/visual_studio/ia32.vsprops b/tools/visual_studio/ia32.vsprops
new file mode 100644
index 0000000..8e02c94
--- /dev/null
+++ b/tools/visual_studio/ia32.vsprops
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="ia32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="V8_ARCH_IA32"
+ />
+</VisualStudioPropertySheet>
diff --git a/tools/visual_studio/v8.vcproj b/tools/visual_studio/v8.vcproj
index c2f336e..47ba8c1 100644
--- a/tools/visual_studio/v8.vcproj
+++ b/tools/visual_studio/v8.vcproj
@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="4"
- InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
@@ -70,7 +70,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="4"
- InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
diff --git a/tools/visual_studio/v8_base.vcproj b/tools/visual_studio/v8_base.vcproj
index 43c970d..b1802ef 100644
--- a/tools/visual_studio/v8_base.vcproj
+++ b/tools/visual_studio/v8_base.vcproj
@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="4"
- InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
@@ -69,7 +69,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="4"
- InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
@@ -857,6 +857,14 @@
>
</File>
<File
+ RelativePath="..\..\src\version.cc"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\version.h"
+ >
+ </File>
+ <File
RelativePath="..\..\src\virtual-frame.h"
>
</File>
diff --git a/tools/visual_studio/v8_base_arm.vcproj b/tools/visual_studio/v8_base_arm.vcproj
index 954ebe2..35a08d5 100644
--- a/tools/visual_studio/v8_base_arm.vcproj
+++ b/tools/visual_studio/v8_base_arm.vcproj
@@ -869,6 +869,14 @@
>
</File>
<File
+ RelativePath="..\..\src\version.cc"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\version.h"
+ >
+ </File>
+ <File
RelativePath="..\..\src\virtual-frame.h"
>
</File>
diff --git a/tools/visual_studio/v8_cctest.vcproj b/tools/visual_studio/v8_cctest.vcproj
index 5d49d24..29023f8 100644
--- a/tools/visual_studio/v8_cctest.vcproj
+++ b/tools/visual_studio/v8_cctest.vcproj
@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
- InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
@@ -79,7 +79,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="1"
- InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
@@ -233,6 +233,10 @@
RelativePath="..\..\test\cctest\test-utils.cc"
>
</File>
+ <File
+ RelativePath="..\..\test\cctest\test-version.cc"
+ >
+ </File>
</Files>
<Globals>
</Globals>
diff --git a/tools/visual_studio/v8_cctest_arm.vcproj b/tools/visual_studio/v8_cctest_arm.vcproj
index 44812f0..44ffbc7 100644
--- a/tools/visual_studio/v8_cctest_arm.vcproj
+++ b/tools/visual_studio/v8_cctest_arm.vcproj
@@ -219,6 +219,10 @@
RelativePath="..\..\test\cctest\test-utils.cc"
>
</File>
+ <File
+ RelativePath="..\..\test\cctest\test-version.cc"
+ >
+ </File>
</Files>
<Globals>
</Globals>
diff --git a/tools/visual_studio/v8_mksnapshot.vcproj b/tools/visual_studio/v8_mksnapshot.vcproj
index 4d5d84f..00950b0 100644
--- a/tools/visual_studio/v8_mksnapshot.vcproj
+++ b/tools/visual_studio/v8_mksnapshot.vcproj
@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
- InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
@@ -79,7 +79,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="1"
- InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
diff --git a/tools/visual_studio/v8_process_sample.vcproj b/tools/visual_studio/v8_process_sample.vcproj
index ea8c97d..d94966b 100644
--- a/tools/visual_studio/v8_process_sample.vcproj
+++ b/tools/visual_studio/v8_process_sample.vcproj
@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
- InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
@@ -79,7 +79,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="1"
- InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
diff --git a/tools/visual_studio/v8_shell_sample.vcproj b/tools/visual_studio/v8_shell_sample.vcproj
index b5d9c61..2cbd22d 100644
--- a/tools/visual_studio/v8_shell_sample.vcproj
+++ b/tools/visual_studio/v8_shell_sample.vcproj
@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
- InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
@@ -79,7 +79,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="1"
- InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
diff --git a/tools/visual_studio/v8_snapshot.vcproj b/tools/visual_studio/v8_snapshot.vcproj
index 25d922f..29db4f8 100644
--- a/tools/visual_studio/v8_snapshot.vcproj
+++ b/tools/visual_studio/v8_snapshot.vcproj
@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="4"
- InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
@@ -70,7 +70,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="4"
- InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
diff --git a/tools/visual_studio/v8_snapshot_cc.vcproj b/tools/visual_studio/v8_snapshot_cc.vcproj
index 1cfac24..7c4799a 100644
--- a/tools/visual_studio/v8_snapshot_cc.vcproj
+++ b/tools/visual_studio/v8_snapshot_cc.vcproj
@@ -18,7 +18,7 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="10"
- InheritedPropertySheets=".\common.vsprops;.\debug.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\debug.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
@@ -36,7 +36,7 @@
<Configuration
Name="Release|Win32"
ConfigurationType="10"
- InheritedPropertySheets=".\common.vsprops;.\release.vsprops"
+ InheritedPropertySheets=".\common.vsprops;.\ia32.vsprops;.\release.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
diff --git a/tools/windows-tick-processor.bat b/tools/windows-tick-processor.bat
new file mode 100644
index 0000000..52454e3
--- /dev/null
+++ b/tools/windows-tick-processor.bat
@@ -0,0 +1,5 @@
+@echo off
+
+SET tools_dir=%~dp0
+
+%tools_dir%..\d8 %tools_dir%splaytree.js %tools_dir%codemap.js %tools_dir%csvparser.js %tools_dir%consarray.js %tools_dir%profile.js %tools_dir%profile_view.js %tools_dir%tickprocessor.js -- --windows %*