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

Unified Diff: test/cctest/test-parsing.cc

Issue 231073002: WIP: Parser: delay string internalization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: internalizing better Created 6 years, 7 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
« src/scopes.cc ('K') | « src/variables.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index 58734d054e2d67ddb15d036213cc91ff7a3f2150..57446843015ac4a50706128f915d574e608904b1 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -37,6 +37,7 @@
#include "isolate.h"
#include "objects.h"
#include "parser.h"
+#include "parser-symbol-table.h"
#include "preparser.h"
#include "scanner-character-streams.h"
#include "token.h"
@@ -796,8 +797,9 @@ void TestScanRegExp(const char* re_source, const char* expected) {
CHECK(start == i::Token::DIV || start == i::Token::ASSIGN_DIV);
CHECK(scanner.ScanRegExpPattern(start == i::Token::ASSIGN_DIV));
scanner.Next(); // Current token is now the regexp literal.
- i::Handle<i::String> val =
- scanner.AllocateInternalizedString(CcTest::i_isolate());
+ i::ParserSymbolTable symbol_table;
+ symbol_table.AlwaysInternalize(CcTest::i_isolate());
+ i::Handle<i::String> val = scanner.CurrentString(&symbol_table)->string();
i::DisallowHeapAllocation no_alloc;
i::String::FlatContent content = val->GetFlatContent();
CHECK(content.IsAscii());
@@ -1147,12 +1149,12 @@ i::Handle<i::String> FormatMessage(i::ScriptData* data) {
const char* message = data->BuildMessage();
i::Handle<i::String> format = v8::Utils::OpenHandle(
*v8::String::NewFromUtf8(CcTest::isolate(), message));
- i::Vector<const char*> args = data->BuildArgs();
- i::Handle<i::JSArray> args_array = factory->NewJSArray(args.length());
- for (int i = 0; i < args.length(); i++) {
+ const char* arg = data->BuildArg();
+ i::Handle<i::JSArray> args_array = factory->NewJSArray(arg != NULL ? 1 : 0);
+ if (arg != NULL) {
i::JSArray::SetElement(
- args_array, i, v8::Utils::OpenHandle(*v8::String::NewFromUtf8(
- CcTest::isolate(), args[i])),
+ args_array, 0,
+ v8::Utils::OpenHandle(*v8::String::NewFromUtf8(CcTest::isolate(), arg)),
NONE, i::SLOPPY).Check();
}
i::Handle<i::JSObject> builtins(isolate->js_builtins_object());
@@ -1162,10 +1164,7 @@ i::Handle<i::String> FormatMessage(i::ScriptData* data) {
i::Handle<i::Object> result = i::Execution::Call(
isolate, format_fun, builtins, 2, arg_handles).ToHandleChecked();
CHECK(result->IsString());
- for (int i = 0; i < args.length(); i++) {
- i::DeleteArray(args[i]);
- }
- i::DeleteArray(args.start());
+ i::DeleteArray(arg);
i::DeleteArray(message);
return i::Handle<i::String>::cast(result);
}
« src/scopes.cc ('K') | « src/variables.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698