Reviewers: Vyacheslav Egorov, Sven Panne, yurys,
Message:
PTAL
Description:
A few tests fails when I run them with --hydrogen-track-positions
BUG=452067
TEST=test-cpu-profiler/SourceLocation
LOG=n
Please review this at https://codereview.chromium.org/940593002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+22, -2 lines):
M src/preparser.h
M test/cctest/test-cpu-profiler.cc
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index
1b365af3c8032b876845adc37e4c27728fc315b8..1cd5dadf0d13557e9e978c5a0bee07f95680c89c
100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -1375,7 +1375,8 @@ class PreParserTraits {
}
static PreParserExpression ThisExpression(Scope* scope,
- PreParserFactory* factory) {
+ PreParserFactory* factory,
+ int pos) {
return PreParserExpression::This();
}
@@ -1850,7 +1851,7 @@ ParserBase<Traits>::ParsePrimaryExpression(bool* ok) {
case Token::THIS: {
Consume(Token::THIS);
scope_->RecordThisUsage();
- result = this->ThisExpression(scope_, factory());
+ result = this->ThisExpression(scope_, factory(), pos);
break;
}
Index: test/cctest/test-cpu-profiler.cc
diff --git a/test/cctest/test-cpu-profiler.cc
b/test/cctest/test-cpu-profiler.cc
index
d54aefa7aebb75733dffe969bfd86650be7c6e25..e6236a44824ecfb94bc99c36c4323a8d3f70dfbc
100644
--- a/test/cctest/test-cpu-profiler.cc
+++ b/test/cctest/test-cpu-profiler.cc
@@ -1780,3 +1780,22 @@ TEST(CollectDeoptEvents) {
iopt_function->deopt_infos()[1].deopt_reason);
iprofiler->DeleteProfile(iprofile);
}
+
+
+TEST(SourceLocation) {
+ i::FLAG_always_opt = true;
+ i::FLAG_hydrogen_track_positions = true;
+ v8::HandleScope scope(CcTest::isolate());
+ v8::Local<v8::Context> env = CcTest::NewContext(PROFILER_EXTENSION);
+ v8::Context::Scope context_scope(env);
+
+ printf("--------------start--------------\n");
+ const char* source =
+ "function CompareStatementWithThis() {\n"
+ " if (this === 1) {\n"
+ " }\n"
+ "}\n"
+ "CompareStatementWithThis();\n";
+
+ v8::Script::Compile(v8_str(source))->Run();
+}
--
--
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.