X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fv8%2Ftest%2Fcctest%2Ftest-compiler.cc;h=2d913715e1e25f914946e5541ad06b885ea7eb2b;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=cd537b53e3d5bb2d8488929b3b5d40e54083d37b;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/v8/test/cctest/test-compiler.cc b/src/v8/test/cctest/test-compiler.cc index cd537b5..2d91371 100644 --- a/src/v8/test/cctest/test-compiler.cc +++ b/src/v8/test/cctest/test-compiler.cc @@ -32,6 +32,7 @@ #include "src/compiler.h" #include "src/disasm.h" +#include "src/parser.h" #include "test/cctest/cctest.h" using namespace v8::internal; @@ -49,7 +50,7 @@ static void SetGlobalProperty(const char* name, Object* value) { Handle internalized_name = isolate->factory()->InternalizeUtf8String(name); Handle global(isolate->context()->global_object()); - Runtime::SetObjectProperty(isolate, global, internalized_name, object, NONE, + Runtime::SetObjectProperty(isolate, global, internalized_name, object, SLOPPY).Check(); } @@ -58,15 +59,10 @@ static Handle Compile(const char* source) { Isolate* isolate = CcTest::i_isolate(); Handle source_code = isolate->factory()->NewStringFromUtf8( CStrVector(source)).ToHandleChecked(); - Handle shared_function = - Compiler::CompileScript(source_code, - Handle(), - 0, - 0, - false, - Handle(isolate->native_context()), - NULL, NULL, NO_CACHED_DATA, - NOT_NATIVES_CODE); + Handle shared_function = Compiler::CompileScript( + source_code, Handle(), 0, 0, false, + Handle(isolate->native_context()), NULL, NULL, + v8::ScriptCompiler::kNoCompileOptions, NOT_NATIVES_CODE); return isolate->factory()->NewFunctionFromSharedFunctionInfo( shared_function, isolate->native_context()); } @@ -313,8 +309,9 @@ TEST(FeedbackVectorPreservedAcrossRecompiles) { Handle feedback_vector(f->shared()->feedback_vector()); // Verify that we gathered feedback. - CHECK_EQ(1, feedback_vector->length()); - CHECK(feedback_vector->get(0)->IsJSFunction()); + int expected_count = FLAG_vector_ics ? 2 : 1; + CHECK_EQ(expected_count, feedback_vector->length()); + CHECK(feedback_vector->get(expected_count - 1)->IsJSFunction()); CompileRun("%OptimizeFunctionOnNextCall(f); f(fun1);"); @@ -322,7 +319,8 @@ TEST(FeedbackVectorPreservedAcrossRecompiles) { // of the full code. CHECK(f->IsOptimized()); CHECK(f->shared()->has_deoptimization_support()); - CHECK(f->shared()->feedback_vector()->get(0)->IsJSFunction()); + CHECK(f->shared()->feedback_vector()-> + get(expected_count - 1)->IsJSFunction()); } @@ -348,16 +346,15 @@ TEST(FeedbackVectorUnaffectedByScopeChanges) { *v8::Handle::Cast( CcTest::global()->Get(v8_str("morphing_call")))); - // morphing_call should have one feedback vector slot for the call to - // call_target(). - CHECK_EQ(1, f->shared()->feedback_vector()->length()); + int expected_count = FLAG_vector_ics ? 2 : 1; + CHECK_EQ(expected_count, f->shared()->feedback_vector()->length()); // And yet it's not compiled. CHECK(!f->shared()->is_compiled()); CompileRun("morphing_call();"); // The vector should have the same size despite the new scoping. - CHECK_EQ(1, f->shared()->feedback_vector()->length()); + CHECK_EQ(expected_count, f->shared()->feedback_vector()->length()); CHECK(f->shared()->is_compiled()); }