Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 6346e5b59600dd24b5e3da5d262db462cc0774c0..b508ad3e995ed3f3a39454e69fe1633c41b88214 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -1098,15 +1098,14 @@ static MaybeObject* GetOwnProperty(Isolate* isolate, |
PropertyAttributes attrs = obj->GetLocalPropertyAttribute(*name); |
if (attrs == ABSENT) return heap->undefined_value(); |
- AccessorPair* raw_accessors = obj->GetLocalPropertyAccessorPair(*name); |
- Handle<AccessorPair> accessors(raw_accessors, isolate); |
+ AccessorPair* accessors = obj->GetLocalPropertyAccessorPair(*name); |
Handle<FixedArray> elms = isolate->factory()->NewFixedArray(DESCRIPTOR_SIZE); |
elms->set(ENUMERABLE_INDEX, heap->ToBoolean((attrs & DONT_ENUM) == 0)); |
elms->set(CONFIGURABLE_INDEX, heap->ToBoolean((attrs & DONT_DELETE) == 0)); |
- elms->set(IS_ACCESSOR_INDEX, heap->ToBoolean(raw_accessors != NULL)); |
+ elms->set(IS_ACCESSOR_INDEX, heap->ToBoolean(accessors != NULL)); |
- if (raw_accessors == NULL) { |
+ if (accessors == NULL) { |
elms->set(WRITABLE_INDEX, heap->ToBoolean((attrs & READ_ONLY) == 0)); |
// GetProperty does access check. |
Handle<Object> value = GetProperty(obj, name); |
@@ -5804,9 +5803,7 @@ MUST_USE_RESULT static MaybeObject* ConvertCaseHelper( |
namespace { |
static const uintptr_t kOneInEveryByte = kUintptrAllBitsSet / 0xFF; |
-#ifdef ENABLE_LATIN_1 |
-static const uintptr_t kAsciiMask = kOneInEveryByte << 7; |
-#endif |
+ |
// Given a word and two range boundaries returns a word with high bit |
// set in every byte iff the corresponding input byte was strictly in |
@@ -5820,10 +5817,7 @@ static inline uintptr_t AsciiRangeMask(uintptr_t w, char m, char n) { |
ASSERT((w & (kOneInEveryByte * 0x7F)) == w); |
// Use strict inequalities since in edge cases the function could be |
// further simplified. |
- ASSERT(0 < m && m < n); |
-#ifndef ENABLE_LATIN_1 |
- ASSERT(n < 0x7F); |
-#endif |
+ ASSERT(0 < m && m < n && n < 0x7F); |
// Has high bit set in every w byte less than n. |
uintptr_t tmp1 = kOneInEveryByte * (0x7F + n) - w; |
// Has high bit set in every w byte greater than m. |
@@ -5840,11 +5834,7 @@ enum AsciiCaseConversion { |
template <AsciiCaseConversion dir> |
struct FastAsciiConverter { |
-#ifdef ENABLE_LATIN_1 |
- static bool Convert(char* dst, char* src, int length, bool* changed_out) { |
-#else |
static bool Convert(char* dst, char* src, int length) { |
-#endif |
#ifdef DEBUG |
char* saved_dst = dst; |
char* saved_src = src; |
@@ -5856,18 +5846,12 @@ struct FastAsciiConverter { |
const char lo = (dir == ASCII_TO_LOWER) ? 'A' - 1 : 'a' - 1; |
const char hi = (dir == ASCII_TO_LOWER) ? 'Z' + 1 : 'z' + 1; |
bool changed = false; |
-#ifdef ENABLE_LATIN_1 |
- uintptr_t or_acc = 0; |
-#endif |
char* const limit = src + length; |
#ifdef V8_HOST_CAN_READ_UNALIGNED |
// Process the prefix of the input that requires no conversion one |
// (machine) word at a time. |
while (src <= limit - sizeof(uintptr_t)) { |
uintptr_t w = *reinterpret_cast<uintptr_t*>(src); |
-#ifdef ENABLE_LATIN_1 |
- or_acc |= w; |
-#endif |
if (AsciiRangeMask(w, lo, hi) != 0) { |
changed = true; |
break; |
@@ -5880,9 +5864,6 @@ struct FastAsciiConverter { |
// required one word at a time. |
while (src <= limit - sizeof(uintptr_t)) { |
uintptr_t w = *reinterpret_cast<uintptr_t*>(src); |
-#ifdef ENABLE_LATIN_1 |
- or_acc |= w; |
-#endif |
uintptr_t m = AsciiRangeMask(w, lo, hi); |
// The mask has high (7th) bit set in every byte that needs |
// conversion and we know that the distance between cases is |
@@ -5896,9 +5877,6 @@ struct FastAsciiConverter { |
// unaligned access is not supported). |
while (src < limit) { |
char c = *src; |
-#ifdef ENABLE_LATIN_1 |
- or_acc |= c; |
-#endif |
if (lo < c && c < hi) { |
c ^= (1 << 5); |
changed = true; |
@@ -5907,20 +5885,10 @@ struct FastAsciiConverter { |
++src; |
++dst; |
} |
-#ifdef ENABLE_LATIN_1 |
- if ((or_acc & kAsciiMask) != 0) { |
- return false; |
- } |
-#endif |
#ifdef DEBUG |
CheckConvert(saved_dst, saved_src, length, changed); |
#endif |
-#ifdef ENABLE_LATIN_1 |
- *changed_out = changed; |
- return true; |
-#else |
return changed; |
-#endif |
} |
#ifdef DEBUG |
@@ -5973,6 +5941,7 @@ MUST_USE_RESULT static MaybeObject* ConvertCase( |
// Assume that the string is not empty; we need this assumption later |
if (length == 0) return s; |
+#ifndef ENABLE_LATIN_1 |
// Simpler handling of ASCII strings. |
// |
// NOTE: This assumes that the upper/lower case of an ASCII |
@@ -5985,25 +5954,13 @@ MUST_USE_RESULT static MaybeObject* ConvertCase( |
if (!maybe_o->ToObject(&o)) return maybe_o; |
} |
SeqOneByteString* result = SeqOneByteString::cast(o); |
-#ifndef ENABLE_LATIN_1 |
bool has_changed_character = ConvertTraits::AsciiConverter::Convert( |
reinterpret_cast<char*>(result->GetChars()), |
reinterpret_cast<char*>(SeqOneByteString::cast(s)->GetChars()), |
length); |
return has_changed_character ? result : s; |
-#else |
- bool has_changed_character; |
- bool is_ascii = ConvertTraits::AsciiConverter::Convert( |
- reinterpret_cast<char*>(result->GetChars()), |
- reinterpret_cast<char*>(SeqOneByteString::cast(s)->GetChars()), |
- length, |
- &has_changed_character); |
- // If not ASCII, we discard the result and take the 2 byte path. |
- if (is_ascii) { |
- return has_changed_character ? result : s; |
- } |
-#endif |
} |
+#endif |
Object* answer; |
{ MaybeObject* maybe_answer = |
@@ -13262,49 +13219,19 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CollectStackTrace) { |
} |
-// Mark a function to recognize when called after GC to format the stack trace. |
-RUNTIME_FUNCTION(MaybeObject*, Runtime_MarkOneShotGetter) { |
- ASSERT_EQ(args.length(), 1); |
- CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); |
- HandleScope scope(isolate); |
- Handle<String> key = isolate->factory()->hidden_stack_trace_symbol(); |
- JSObject::SetHiddenProperty(fun, key, key); |
- return *fun; |
-} |
- |
- |
-// Retrieve the stack trace. This could be the raw stack trace collected |
-// on stack overflow or the already formatted stack trace string. |
-RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOverflowedStackTrace) { |
- HandleScope scope(isolate); |
+// Retrieve the raw stack trace collected on stack overflow and delete |
+// it since it is used only once to avoid keeping it alive. |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOverflowedRawStackTrace) { |
ASSERT_EQ(args.length(), 1); |
CONVERT_ARG_CHECKED(JSObject, error_object, 0); |
String* key = isolate->heap()->hidden_stack_trace_symbol(); |
Object* result = error_object->GetHiddenProperty(key); |
- RUNTIME_ASSERT(result->IsJSArray() || |
- result->IsString() || |
- result->IsUndefined()); |
+ RUNTIME_ASSERT(result->IsJSArray() || result->IsUndefined()); |
+ error_object->DeleteHiddenProperty(key); |
return result; |
} |
-// Set or clear the stack trace attached to an stack overflow error object. |
-RUNTIME_FUNCTION(MaybeObject*, Runtime_SetOverflowedStackTrace) { |
- HandleScope scope(isolate); |
- ASSERT_EQ(args.length(), 2); |
- CONVERT_ARG_HANDLE_CHECKED(JSObject, error_object, 0); |
- CONVERT_ARG_HANDLE_CHECKED(HeapObject, value, 1); |
- Handle<String> key = isolate->factory()->hidden_stack_trace_symbol(); |
- if (value->IsUndefined()) { |
- error_object->DeleteHiddenProperty(*key); |
- } else { |
- RUNTIME_ASSERT(value->IsString()); |
- JSObject::SetHiddenProperty(error_object, key, value); |
- } |
- return *error_object; |
-} |
- |
- |
// Returns V8 version as a string. |
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetV8Version) { |
ASSERT_EQ(args.length(), 0); |