Revision: 24736
Author: [email protected]
Date: Mon Oct 20 12:07:45 2014 UTC
Log: Move some Runtime:: functions and remove runtime.h as include
when unnecessary.
[email protected]
Review URL: https://codereview.chromium.org/662413002
https://code.google.com/p/v8/source/detail?r=24736
Modified:
/branches/bleeding_edge/src/api.cc
/branches/bleeding_edge/src/runtime/runtime-array.cc
/branches/bleeding_edge/src/runtime/runtime-collections.cc
/branches/bleeding_edge/src/runtime/runtime-compiler.cc
/branches/bleeding_edge/src/runtime/runtime-date.cc
/branches/bleeding_edge/src/runtime/runtime-debug.cc
/branches/bleeding_edge/src/runtime/runtime-function.cc
/branches/bleeding_edge/src/runtime/runtime-generator.cc
/branches/bleeding_edge/src/runtime/runtime-i18n.cc
/branches/bleeding_edge/src/runtime/runtime-internal.cc
/branches/bleeding_edge/src/runtime/runtime-json.cc
/branches/bleeding_edge/src/runtime/runtime-liveedit.cc
/branches/bleeding_edge/src/runtime/runtime-maths.cc
/branches/bleeding_edge/src/runtime/runtime-numbers.cc
/branches/bleeding_edge/src/runtime/runtime-object.cc
/branches/bleeding_edge/src/runtime/runtime-observe.cc
/branches/bleeding_edge/src/runtime/runtime-proxy.cc
/branches/bleeding_edge/src/runtime/runtime-regexp.cc
/branches/bleeding_edge/src/runtime/runtime-scopes.cc
/branches/bleeding_edge/src/runtime/runtime-strings.cc
/branches/bleeding_edge/src/runtime/runtime-symbol.cc
/branches/bleeding_edge/src/runtime/runtime-test.cc
/branches/bleeding_edge/src/runtime/runtime-uri.cc
/branches/bleeding_edge/src/runtime/runtime-utils.h
/branches/bleeding_edge/src/runtime/runtime.h
/branches/bleeding_edge/src/runtime/string-builder.h
/branches/bleeding_edge/test/cctest/test-func-name-inference.cc
=======================================
--- /branches/bleeding_edge/src/api.cc Fri Oct 17 15:44:02 2014 UTC
+++ /branches/bleeding_edge/src/api.cc Mon Oct 20 12:07:45 2014 UTC
@@ -3171,6 +3171,44 @@
return ForceSet(v8::Handle<Value>(reinterpret_cast<Value*>(*key)),
value, DontEnum);
}
+
+
+i::MaybeHandle<i::Object> DeleteObjectProperty(
+ i::Isolate* isolate, i::Handle<i::JSReceiver> receiver,
+ i::Handle<i::Object> key, i::JSReceiver::DeleteMode mode) {
+ // Check if the given key is an array index.
+ uint32_t index;
+ if (key->ToArrayIndex(&index)) {
+ // In Firefox/SpiderMonkey, Safari and Opera you can access the
+ // characters of a string using [] notation. In the case of a
+ // String object we just need to redirect the deletion to the
+ // underlying string if the index is in range. Since the
+ // underlying string does nothing with the deletion, we can ignore
+ // such deletions.
+ if (receiver->IsStringObjectWithCharacterAt(index)) {
+ return isolate->factory()->true_value();
+ }
+
+ return i::JSReceiver::DeleteElement(receiver, index, mode);
+ }
+
+ i::Handle<i::Name> name;
+ if (key->IsName()) {
+ name = i::Handle<i::Name>::cast(key);
+ } else {
+ // Call-back into JavaScript to convert the key to a string.
+ i::Handle<i::Object> converted;
+ if (!i::Execution::ToString(isolate, key).ToHandle(&converted)) {
+ return i::MaybeHandle<i::Object>();
+ }
+ name = i::Handle<i::String>::cast(converted);
+ }
+
+ if (name->IsString()) {
+ name = i::String::Flatten(i::Handle<i::String>::cast(name));
+ }
+ return i::JSReceiver::DeleteProperty(receiver, name, mode);
+}
bool v8::Object::ForceDelete(v8::Handle<Value> key) {
@@ -3191,8 +3229,9 @@
EXCEPTION_PREAMBLE(isolate);
i::Handle<i::Object> obj;
- has_pending_exception = !i::Runtime::DeleteObjectProperty(
- isolate, self, key_obj,
i::JSReceiver::FORCE_DELETION).ToHandle(&obj);
+ has_pending_exception =
+ !DeleteObjectProperty(isolate, self, key_obj,
+ i::JSReceiver::FORCE_DELETION).ToHandle(&obj);
EXCEPTION_BAILOUT_CHECK(isolate, false);
return obj->IsTrue();
}
@@ -3445,8 +3484,9 @@
i::Handle<i::Object> key_obj = Utils::OpenHandle(*key);
EXCEPTION_PREAMBLE(isolate);
i::Handle<i::Object> obj;
- has_pending_exception = !i::Runtime::DeleteObjectProperty(
- isolate, self, key_obj,
i::JSReceiver::NORMAL_DELETION).ToHandle(&obj);
+ has_pending_exception =
+ !DeleteObjectProperty(isolate, self, key_obj,
+ i::JSReceiver::NORMAL_DELETION).ToHandle(&obj);
EXCEPTION_BAILOUT_CHECK(isolate, false);
return obj->IsTrue();
}
@@ -3464,11 +3504,22 @@
i::Handle<i::JSReceiver> self = Utils::OpenHandle(this);
i::Handle<i::Object> key_obj = Utils::OpenHandle(*key);
EXCEPTION_PREAMBLE(isolate);
- i::Handle<i::Object> obj;
- has_pending_exception = !i::Runtime::HasObjectProperty(
- isolate, self, key_obj).ToHandle(&obj);
+ Maybe<bool> maybe;
+ // Check if the given key is an array index.
+ uint32_t index;
+ if (key_obj->ToArrayIndex(&index)) {
+ maybe = i::JSReceiver::HasElement(self, index);
+ } else {
+ // Convert the key to a name - possibly by calling back into
JavaScript.
+ i::Handle<i::Name> name;
+ if (i::Runtime::ToName(isolate, key_obj).ToHandle(&name)) {
+ maybe = i::JSReceiver::HasProperty(self, name);
+ }
+ }
+ if (!maybe.has_value) has_pending_exception = true;
EXCEPTION_BAILOUT_CHECK(isolate, false);
- return obj->IsTrue();
+ DCHECK(maybe.has_value);
+ return maybe.value;
}
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-array.cc Fri Oct 10
14:59:53 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-array.cc Mon Oct 20
12:07:45 2014 UTC
@@ -5,7 +5,6 @@
#include "src/v8.h"
#include "src/arguments.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
namespace v8 {
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-collections.cc Mon Sep 29
09:32:38 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-collections.cc Mon Oct 20
12:07:45 2014 UTC
@@ -5,7 +5,6 @@
#include "src/v8.h"
#include "src/arguments.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-compiler.cc Tue Sep 30
08:23:02 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-compiler.cc Mon Oct 20
12:07:45 2014 UTC
@@ -10,7 +10,6 @@
#include "src/frames.h"
#include "src/full-codegen.h"
#include "src/isolate-inl.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
#include "src/v8threads.h"
#include "src/vm-state-inl.h"
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-date.cc Tue Sep 30 08:23:02
2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-date.cc Mon Oct 20 12:07:45
2014 UTC
@@ -7,7 +7,6 @@
#include "src/arguments.h"
#include "src/date.h"
#include "src/dateparser-inl.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
namespace v8 {
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-debug.cc Thu Oct 16
13:19:36 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-debug.cc Mon Oct 20
12:07:45 2014 UTC
@@ -385,7 +385,7 @@
// Advances the iterator to the frame that matches the index and returns
the
// inlined frame index, or -1 if not found. Skips native JS functions.
-int FindIndexedNonNativeFrame(JavaScriptFrameIterator* it, int index) {
+int Runtime::FindIndexedNonNativeFrame(JavaScriptFrameIterator* it, int
index) {
int count = -1;
for (; !it->done(); it->Advance()) {
List<FrameSummary> frames(FLAG_max_inlining_levels + 1);
@@ -435,7 +435,7 @@
JavaScriptFrameIterator it(isolate, id);
// Inlined frame index in optimized frame, starting from outer function.
- int inlined_jsframe_index = FindIndexedNonNativeFrame(&it, index);
+ int inlined_jsframe_index = Runtime::FindIndexedNonNativeFrame(&it,
index);
if (inlined_jsframe_index == -1) return heap->undefined_value();
FrameInspector frame_inspector(it.frame(), inlined_jsframe_index,
isolate);
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-function.cc Tue Oct 14
14:46:11 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-function.cc Mon Oct 20
12:07:45 2014 UTC
@@ -9,7 +9,6 @@
#include "src/compiler.h"
#include "src/deoptimizer.h"
#include "src/frames.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
namespace v8 {
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-generator.cc Tue Sep 30
08:23:02 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-generator.cc Mon Oct 20
12:07:45 2014 UTC
@@ -6,7 +6,6 @@
#include "src/arguments.h"
#include "src/frames-inl.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
namespace v8 {
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-i18n.cc Wed Oct 1 11:53:29
2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-i18n.cc Mon Oct 20 12:07:45
2014 UTC
@@ -8,7 +8,6 @@
#include "src/arguments.h"
#include "src/i18n.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
#include "unicode/brkiter.h"
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-internal.cc Fri Oct 10
14:59:53 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-internal.cc Mon Oct 20
12:07:45 2014 UTC
@@ -7,7 +7,6 @@
#include "src/arguments.h"
#include "src/bootstrapper.h"
#include "src/debug.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
namespace v8 {
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-json.cc Mon Sep 29 07:08:15
2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-json.cc Mon Oct 20 12:07:45
2014 UTC
@@ -7,7 +7,6 @@
#include "src/arguments.h"
#include "src/json-parser.h"
#include "src/json-stringifier.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
namespace v8 {
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-liveedit.cc Tue Sep 30
08:23:02 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-liveedit.cc Mon Oct 20
12:07:45 2014 UTC
@@ -279,7 +279,7 @@
}
JavaScriptFrameIterator it(isolate, id);
- int inlined_jsframe_index = FindIndexedNonNativeFrame(&it, index);
+ int inlined_jsframe_index = Runtime::FindIndexedNonNativeFrame(&it,
index);
if (inlined_jsframe_index == -1) return heap->undefined_value();
// We don't really care what the inlined frame index is, since we are
// throwing away the entire frame anyways.
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-maths.cc Wed Oct 15
09:24:55 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-maths.cc Mon Oct 20
12:07:45 2014 UTC
@@ -7,7 +7,6 @@
#include "src/arguments.h"
#include "src/assembler.h"
#include "src/codegen.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
#include "src/third_party/fdlibm/fdlibm.h"
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-numbers.cc Fri Oct 10
14:59:53 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-numbers.cc Mon Oct 20
12:07:45 2014 UTC
@@ -8,7 +8,6 @@
#include "src/bootstrapper.h"
#include "src/codegen.h"
#include "src/misc-intrinsics.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-object.cc Tue Oct 14
14:46:11 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-object.cc Mon Oct 20
12:07:45 2014 UTC
@@ -63,27 +63,6 @@
return Handle<Name>::cast(converted);
}
}
-
-
-MaybeHandle<Object> Runtime::HasObjectProperty(Isolate* isolate,
- Handle<JSReceiver> object,
- Handle<Object> key) {
- Maybe<bool> maybe;
- // Check if the given key is an array index.
- uint32_t index;
- if (key->ToArrayIndex(&index)) {
- maybe = JSReceiver::HasElement(object, index);
- } else {
- // Convert the key to a name - possibly by calling back into
JavaScript.
- Handle<Name> name;
- ASSIGN_RETURN_ON_EXCEPTION(isolate, name, ToName(isolate, key),
Object);
-
- maybe = JSReceiver::HasProperty(object, name);
- }
-
- if (!maybe.has_value) return MaybeHandle<Object>();
- return isolate->factory()->ToBoolean(maybe.value);
-}
MaybeHandle<Object> Runtime::GetObjectProperty(Isolate* isolate,
@@ -261,42 +240,6 @@
attr);
}
}
-
-
-MaybeHandle<Object> Runtime::DeleteObjectProperty(Isolate* isolate,
- Handle<JSReceiver>
receiver,
- Handle<Object> key,
- JSReceiver::DeleteMode
mode) {
- // Check if the given key is an array index.
- uint32_t index;
- if (key->ToArrayIndex(&index)) {
- // In Firefox/SpiderMonkey, Safari and Opera you can access the
- // characters of a string using [] notation. In the case of a
- // String object we just need to redirect the deletion to the
- // underlying string if the index is in range. Since the
- // underlying string does nothing with the deletion, we can ignore
- // such deletions.
- if (receiver->IsStringObjectWithCharacterAt(index)) {
- return isolate->factory()->true_value();
- }
-
- return JSReceiver::DeleteElement(receiver, index, mode);
- }
-
- Handle<Name> name;
- if (key->IsName()) {
- name = Handle<Name>::cast(key);
- } else {
- // Call-back into JavaScript to convert the key to a string.
- Handle<Object> converted;
- ASSIGN_RETURN_ON_EXCEPTION(isolate, converted,
- Execution::ToString(isolate, key), Object);
- name = Handle<String>::cast(converted);
- }
-
- if (name->IsString()) name = String::Flatten(Handle<String>::cast(name));
- return JSReceiver::DeleteProperty(receiver, name, mode);
-}
RUNTIME_FUNCTION(Runtime_GetPrototype) {
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-observe.cc Tue Sep 30
10:46:04 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-observe.cc Mon Oct 20
12:07:45 2014 UTC
@@ -5,7 +5,6 @@
#include "src/v8.h"
#include "src/arguments.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
namespace v8 {
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-proxy.cc Wed Oct 15
13:26:43 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-proxy.cc Mon Oct 20
12:07:45 2014 UTC
@@ -5,7 +5,6 @@
#include "src/v8.h"
#include "src/arguments.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
namespace v8 {
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-regexp.cc Tue Sep 30
10:46:04 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-regexp.cc Mon Oct 20
12:07:45 2014 UTC
@@ -7,7 +7,6 @@
#include "src/arguments.h"
#include "src/jsregexp-inl.h"
#include "src/jsregexp.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
#include "src/runtime/string-builder.h"
#include "src/string-search.h"
@@ -1094,46 +1093,5 @@
CONVERT_ARG_CHECKED(Object, obj, 0);
return isolate->heap()->ToBoolean(obj->IsJSRegExp());
}
-
-
-// Perform string match of pattern on subject, starting at start index.
-// Caller must ensure that 0 <= start_index <= sub->length(),
-// and should check that pat->length() + start_index <= sub->length().
-int Runtime::StringMatch(Isolate* isolate, Handle<String> sub,
- Handle<String> pat, int start_index) {
- DCHECK(0 <= start_index);
- DCHECK(start_index <= sub->length());
-
- int pattern_length = pat->length();
- if (pattern_length == 0) return start_index;
-
- int subject_length = sub->length();
- if (start_index + pattern_length > subject_length) return -1;
-
- sub = String::Flatten(sub);
- pat = String::Flatten(pat);
-
- DisallowHeapAllocation no_gc; // ensure vectors stay valid
- // Extract flattened substrings of cons strings before getting encoding.
- String::FlatContent seq_sub = sub->GetFlatContent();
- String::FlatContent seq_pat = pat->GetFlatContent();
-
- // dispatch on type of strings
- if (seq_pat.IsOneByte()) {
- Vector<const uint8_t> pat_vector = seq_pat.ToOneByteVector();
- if (seq_sub.IsOneByte()) {
- return SearchString(isolate, seq_sub.ToOneByteVector(), pat_vector,
- start_index);
- }
- return SearchString(isolate, seq_sub.ToUC16Vector(), pat_vector,
- start_index);
- }
- Vector<const uc16> pat_vector = seq_pat.ToUC16Vector();
- if (seq_sub.IsOneByte()) {
- return SearchString(isolate, seq_sub.ToOneByteVector(), pat_vector,
- start_index);
- }
- return SearchString(isolate, seq_sub.ToUC16Vector(), pat_vector,
start_index);
-}
}
} // namespace v8::internal
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-scopes.cc Tue Sep 30
10:46:04 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-scopes.cc Mon Oct 20
12:07:45 2014 UTC
@@ -7,7 +7,6 @@
#include "src/accessors.h"
#include "src/arguments.h"
#include "src/frames-inl.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
#include "src/scopeinfo.h"
#include "src/scopes.h"
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-strings.cc Fri Oct 10
14:59:53 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-strings.cc Mon Oct 20
12:07:45 2014 UTC
@@ -7,13 +7,53 @@
#include "src/arguments.h"
#include "src/jsregexp-inl.h"
#include "src/jsregexp.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
#include "src/runtime/string-builder.h"
#include "src/string-search.h"
namespace v8 {
namespace internal {
+
+
+// Perform string match of pattern on subject, starting at start index.
+// Caller must ensure that 0 <= start_index <= sub->length(),
+// and should check that pat->length() + start_index <= sub->length().
+int StringMatch(Isolate* isolate, Handle<String> sub, Handle<String> pat,
+ int start_index) {
+ DCHECK(0 <= start_index);
+ DCHECK(start_index <= sub->length());
+
+ int pattern_length = pat->length();
+ if (pattern_length == 0) return start_index;
+
+ int subject_length = sub->length();
+ if (start_index + pattern_length > subject_length) return -1;
+
+ sub = String::Flatten(sub);
+ pat = String::Flatten(pat);
+
+ DisallowHeapAllocation no_gc; // ensure vectors stay valid
+ // Extract flattened substrings of cons strings before getting encoding.
+ String::FlatContent seq_sub = sub->GetFlatContent();
+ String::FlatContent seq_pat = pat->GetFlatContent();
+
+ // dispatch on type of strings
+ if (seq_pat.IsOneByte()) {
+ Vector<const uint8_t> pat_vector = seq_pat.ToOneByteVector();
+ if (seq_sub.IsOneByte()) {
+ return SearchString(isolate, seq_sub.ToOneByteVector(), pat_vector,
+ start_index);
+ }
+ return SearchString(isolate, seq_sub.ToUC16Vector(), pat_vector,
+ start_index);
+ }
+ Vector<const uc16> pat_vector = seq_pat.ToUC16Vector();
+ if (seq_sub.IsOneByte()) {
+ return SearchString(isolate, seq_sub.ToOneByteVector(), pat_vector,
+ start_index);
+ }
+ return SearchString(isolate, seq_sub.ToUC16Vector(), pat_vector,
start_index);
+}
// This may return an empty MaybeHandle if an exception is thrown or
@@ -47,7 +87,7 @@
return subject;
} else {
- int index = Runtime::StringMatch(isolate, subject, search, 0);
+ int index = StringMatch(isolate, subject, search, 0);
if (index == -1) return subject;
*found = true;
Handle<String> first = isolate->factory()->NewSubString(subject, 0,
index);
@@ -101,7 +141,7 @@
if (!index->ToArrayIndex(&start_index)) return Smi::FromInt(-1);
RUNTIME_ASSERT(start_index <= static_cast<uint32_t>(sub->length()));
- int position = Runtime::StringMatch(isolate, sub, pat, start_index);
+ int position = StringMatch(isolate, sub, pat, start_index);
return Smi::FromInt(position);
}
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-symbol.cc Tue Sep 30
10:46:04 2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-symbol.cc Mon Oct 20
12:07:45 2014 UTC
@@ -5,7 +5,6 @@
#include "src/v8.h"
#include "src/arguments.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
namespace v8 {
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-test.cc Thu Oct 9 14:12:05
2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-test.cc Mon Oct 20 12:07:45
2014 UTC
@@ -7,7 +7,6 @@
#include "src/arguments.h"
#include "src/deoptimizer.h"
#include "src/full-codegen.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
namespace v8 {
@@ -391,7 +390,7 @@
#undef ADD_ENTRY
DCHECK_EQ(index, entry_count);
Handle<JSArray> result = factory->NewJSArrayWithElements(elements);
- return *result;
+ return (*result);
}
#endif
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-uri.cc Mon Sep 29 07:08:15
2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-uri.cc Mon Oct 20 12:07:45
2014 UTC
@@ -6,7 +6,6 @@
#include "src/arguments.h"
#include "src/conversions.h"
-#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
#include "src/string-search.h"
#include "src/utils.h"
=======================================
--- /branches/bleeding_edge/src/runtime/runtime-utils.h Tue Sep 30 08:23:02
2014 UTC
+++ /branches/bleeding_edge/src/runtime/runtime-utils.h Mon Oct 20 12:07:45
2014 UTC
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef V8_RUNTIME_UTILS_H_
-#define V8_RUNTIME_UTILS_H_
+#ifndef V8_RUNTIME_RUNTIME_UTILS_H_
+#define V8_RUNTIME_RUNTIME_UTILS_H_
namespace v8 {
@@ -141,10 +141,7 @@
}
#endif
-class JavaScriptFrameIterator;
-
-int FindIndexedNonNativeFrame(JavaScriptFrameIterator* it, int index);
}
} // namespace v8::internal
-#endif // V8_RUNTIME_UTILS_H_
+#endif // V8_RUNTIME_RUNTIME_UTILS_H_
=======================================
--- /branches/bleeding_edge/src/runtime/runtime.h Thu Oct 16 10:55:26 2014
UTC
+++ /branches/bleeding_edge/src/runtime/runtime.h Mon Oct 20 12:07:45 2014
UTC
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef V8_RUNTIME_H_
-#define V8_RUNTIME_H_
+#ifndef V8_RUNTIME_RUNTIME_H_
+#define V8_RUNTIME_RUNTIME_H_
#include "src/allocation.h"
#include "src/objects.h"
@@ -777,6 +777,9 @@
};
+class JavaScriptFrameIterator; // Forward declaration.
+
+
class Runtime : public AllStatic {
public:
enum FunctionId {
@@ -828,10 +831,6 @@
// Get the intrinsic function with the given function entry address.
static const Function* FunctionForEntry(Address ref);
- // General-purpose helper functions for runtime system.
- static int StringMatch(Isolate* isolate, Handle<String> sub,
- Handle<String> pat, int index);
-
// TODO(1240886): Some of the following methods are *not* handle safe,
but
// accept handle arguments. This seems fragile.
@@ -848,13 +847,6 @@
Handle<JSObject> object, Handle<Object> key, Handle<Object> value,
PropertyAttributes attr);
- MUST_USE_RESULT static MaybeHandle<Object> DeleteObjectProperty(
- Isolate* isolate, Handle<JSReceiver> object, Handle<Object> key,
- JSReceiver::DeleteMode mode);
-
- MUST_USE_RESULT static MaybeHandle<Object> HasObjectProperty(
- Isolate* isolate, Handle<JSReceiver> object, Handle<Object> key);
-
MUST_USE_RESULT static MaybeHandle<Object> GetObjectProperty(
Isolate* isolate, Handle<Object> object, Handle<Object> key);
@@ -876,6 +868,8 @@
static void FreeArrayBuffer(Isolate* isolate,
JSArrayBuffer* phantom_array_buffer);
+ static int FindIndexedNonNativeFrame(JavaScriptFrameIterator* it, int
index);
+
enum TypedArrayId {
// arrayIds below should be synchromized with typedarray.js natives.
ARRAY_ID_UINT8 = 1,
@@ -918,4 +912,4 @@
} // namespace internal
} // namespace v8
-#endif // V8_RUNTIME_H_
+#endif // V8_RUNTIME_RUNTIME_H_
=======================================
--- /branches/bleeding_edge/src/runtime/string-builder.h Mon Sep 29
07:08:15 2014 UTC
+++ /branches/bleeding_edge/src/runtime/string-builder.h Mon Oct 20
12:07:45 2014 UTC
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef V8_STRING_BUILDER_H_
-#define V8_STRING_BUILDER_H_
+#ifndef V8_RUNTIME_STRING_BUILDER_H_
+#define V8_RUNTIME_STRING_BUILDER_H_
namespace v8 {
namespace internal {
@@ -293,4 +293,4 @@
}
} // namespace v8::internal
-#endif // V8_STRING_BUILDER_H_
+#endif // V8_RUNTIME_STRING_BUILDER_H_
=======================================
--- /branches/bleeding_edge/test/cctest/test-func-name-inference.cc Thu Sep
25 07:16:15 2014 UTC
+++ /branches/bleeding_edge/test/cctest/test-func-name-inference.cc Mon Oct
20 12:07:45 2014 UTC
@@ -30,7 +30,7 @@
#include "src/api.h"
#include "src/debug.h"
-#include "src/runtime/runtime.h"
+#include "src/string-search.h"
#include "test/cctest/cctest.h"
@@ -46,13 +46,13 @@
using ::v8::internal::SmartArrayPointer;
using ::v8::internal::SharedFunctionInfo;
using ::v8::internal::String;
+using ::v8::internal::Vector;
static void CheckFunctionName(v8::Handle<v8::Script> script,
const char* func_pos_src,
const char* ref_inferred_name) {
Isolate* isolate = CcTest::i_isolate();
- Factory* factory = isolate->factory();
// Get script source.
Handle<Object> obj = v8::Utils::OpenHandle(*script);
@@ -69,12 +69,14 @@
Handle<String> script_src(String::cast(i_script->source()));
// Find the position of a given func source substring in the source.
- Handle<String> func_pos_str =
- factory->NewStringFromAsciiChecked(func_pos_src);
- int func_pos = Runtime::StringMatch(isolate,
- script_src,
- func_pos_str,
- 0);
+ int func_pos;
+ {
+ i::DisallowHeapAllocation no_gc;
+ Vector<const uint8_t> func_pos_str = i::OneByteVector(func_pos_src);
+ String::FlatContent script_content = script_src->GetFlatContent();
+ func_pos = SearchString(isolate, script_content.ToOneByteVector(),
+ func_pos_str, 0);
+ }
CHECK_NE(0, func_pos);
// Obtain SharedFunctionInfo for the function.
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.