Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(897)

Unified Diff: test/cctest/test-func-name-inference.cc

Issue 662413002: Move some Runtime:: functions and remove runtime.h as include when unnecessary. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/string-builder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-func-name-inference.cc
diff --git a/test/cctest/test-func-name-inference.cc b/test/cctest/test-func-name-inference.cc
index ceceff63a0d3017ba4614611ac85e6bf6f7ce9d5..7f3dafc0637b4c220422251649e27738900eee4e 100644
--- a/test/cctest/test-func-name-inference.cc
+++ b/test/cctest/test-func-name-inference.cc
@@ -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::Script;
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 @@ static void CheckFunctionName(v8::Handle<v8::Script> script,
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.
« no previous file with comments | « src/runtime/string-builder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698