summaryrefslogtreecommitdiff
path: root/deps/v8
diff options
context:
space:
mode:
authoryangguo@chromium.org <yangguo@chromium.org>2012-05-08 12:38:24 +0000
committerBert Belder <bertbelder@gmail.com>2012-05-09 03:56:04 +0200
commit29b2fdb0c513f1735be9e16223b873c71ee7e7ab (patch)
tree1d292bde14830f26038675a41a605596ea350ddd /deps/v8
parent78e831a31c0ad31156457c7068726e3c0e93b266 (diff)
downloadnode-29b2fdb0c513f1735be9e16223b873c71ee7e7ab.tar.gz
Force inlining CopyChars and String::Get.
BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10332054 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@11527 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
Diffstat (limited to 'deps/v8')
-rw-r--r--deps/v8/src/globals.h3
-rw-r--r--deps/v8/src/objects.h2
-rw-r--r--deps/v8/src/v8utils.h9
3 files changed, 10 insertions, 4 deletions
diff --git a/deps/v8/src/globals.h b/deps/v8/src/globals.h
index 25d4ffe89..97b033f84 100644
--- a/deps/v8/src/globals.h
+++ b/deps/v8/src/globals.h
@@ -345,6 +345,9 @@ F FUNCTION_CAST(Address addr) {
#define INLINE(header) inline __attribute__((always_inline)) header
#define NO_INLINE(header) __attribute__((noinline)) header
#endif
+#elif defined(_MSC_VER) && !defined(DEBUG)
+#define INLINE(header) __forceinline header
+#define NO_INLINE(header) header
#else
#define INLINE(header) inline header
#define NO_INLINE(header) header
diff --git a/deps/v8/src/objects.h b/deps/v8/src/objects.h
index a9cb8e0db..ced23a98c 100644
--- a/deps/v8/src/objects.h
+++ b/deps/v8/src/objects.h
@@ -6829,7 +6829,7 @@ class String: public HeapObject {
inline void Set(int index, uint16_t value);
// Get individual two byte char in the string. Repeated calls
// to this method are not efficient unless the string is flat.
- inline uint16_t Get(int index);
+ INLINE(uint16_t Get(int index));
// Try to flatten the string. Checks first inline to see if it is
// necessary. Does nothing if the string is not a cons string.
diff --git a/deps/v8/src/v8utils.h b/deps/v8/src/v8utils.h
index c73222a29..bb587e173 100644
--- a/deps/v8/src/v8utils.h
+++ b/deps/v8/src/v8utils.h
@@ -1,4 +1,4 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
+// Copyright 2012 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:
@@ -199,10 +199,13 @@ Vector<const char> ReadFile(FILE* file,
bool verbose = true);
-
// Copy from ASCII/16bit chars to ASCII/16bit chars.
template <typename sourcechar, typename sinkchar>
-inline void CopyChars(sinkchar* dest, const sourcechar* src, int chars) {
+INLINE(void CopyChars(sinkchar* dest, const sourcechar* src, int chars));
+
+
+template <typename sourcechar, typename sinkchar>
+void CopyChars(sinkchar* dest, const sourcechar* src, int chars) {
sinkchar* limit = dest + chars;
#ifdef V8_HOST_CAN_READ_UNALIGNED
if (sizeof(*dest) == sizeof(*src)) {