[crankshaft] Add missing source position for calls.

R=verwaest@chromium.org
TEST=cctest/test-api
BUG=v8:3995
LOG=N

Review URL: https://codereview.chromium.org/1058553004

Cr-Commit-Position: refs/heads/master@{#27843}
This commit is contained in:
mstarzinger 2015-04-15 05:48:51 -07:00 committed by Commit bot
parent 00aec79079
commit 969475b604
3 changed files with 8 additions and 17 deletions

View File

@ -9171,6 +9171,7 @@ void HOptimizedGraphBuilder::VisitCall(Call* expr) {
DCHECK(!HasStackOverflow());
DCHECK(current_block() != NULL);
DCHECK(current_block()->HasPredecessor());
if (!top_info()->is_tracking_positions()) SetSourcePosition(expr->position());
Expression* callee = expr->expression();
int argument_count = expr->arguments()->length() + 1; // Plus receiver.
HInstruction* call = NULL;

View File

@ -10162,11 +10162,7 @@ THREADED_TEST(CallAsFunction) {
CHECK(try_catch.HasCaught());
String::Utf8Value exception_value1(try_catch.Exception());
// TODO(verwaest): Better message
// TODO(3995): Our compilers disagree about the position (and message).
if (!i::FLAG_always_opt) {
CHECK_EQ(0,
strcmp("TypeError: obj2 is not a function", *exception_value1));
}
CHECK_EQ(0, strcmp("TypeError: obj2 is not a function", *exception_value1));
try_catch.Reset();
// Call an object without call-as-function handler through the API
@ -10722,11 +10718,8 @@ THREADED_PROFILED_TEST(InterceptorCallICFastApi_SimpleSignature_Miss3) {
"}");
CHECK(try_catch.HasCaught());
// TODO(verwaest): Adjust message.
// TODO(3995): Our compilers disagree about the position (and message).
if (!i::FLAG_always_opt) {
CHECK(v8_str("TypeError: receiver.method is not a function")
->Equals(try_catch.Exception()->ToString(isolate)));
}
CHECK(v8_str("TypeError: receiver.method is not a function")
->Equals(try_catch.Exception()->ToString(isolate)));
CHECK_EQ(42, context->Global()->Get(v8_str("saved_result"))->Int32Value());
CHECK_GE(interceptor_call_count, 50);
}
@ -10900,11 +10893,8 @@ THREADED_PROFILED_TEST(CallICFastApi_SimpleSignature_Miss2) {
"}");
CHECK(try_catch.HasCaught());
// TODO(verwaest): Adjust message.
// TODO(3995): Our compilers disagree about the position (and message).
if (!i::FLAG_always_opt) {
CHECK(v8_str("TypeError: receiver.method is not a function")
->Equals(try_catch.Exception()->ToString(isolate)));
}
CHECK(v8_str("TypeError: receiver.method is not a function")
->Equals(try_catch.Exception()->ToString(isolate)));
CHECK_EQ(42, context->Global()->Get(v8_str("saved_result"))->Int32Value());
}

View File

@ -6731,8 +6731,8 @@ TEST(Backtrace) {
v8::Debug::SetMessageHandler(BacktraceData::MessageHandler);
// TODO(3995): This doesn't work with --always-opt because we don't have
// correct source positions in optimized code. Enable once we have.
// TODO(mstarzinger): This doesn't work with --always-opt because we don't
// have correct source positions in optimized code. Enable once we have.
i::FLAG_always_opt = false;
const int kBufferSize = 1000;