Commit 6105581e authored by mythria's avatar mythria Committed by Commit bot

Continuing removing deprecated function from cctest

Removes deprecated functions from the following files:

test/cctest/test-object-observe.cc
test/cctest/test-parsing.cc
test/cctest/test-platform.cc
test/cctest/test-platform-linux.cc
test/cctest/test-platform-win32.cc
test/cctest/test-profile-generator.cc
test/cctest/test-random-number-generator.cc
test/cctest/test-regexp.cc
test/cctest/test-reloc-info.cc
test/cctest/test-representation.cc
test/cctest/test-sampler-api.cc
test/cctest/test-serialize.cc
test/cctest/test-simd.cc
test/cctest/test-slots-buffer.cc
test/cctest/test-spaces.cc
test/cctest/test-strings.cc
test/cctest/test-strtod.cc
test/cctest/test-symbols.cc
test/cctest/test-threads.cc

BUG=v8:4134
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#31173}
parent 519f2151
......@@ -38,9 +38,8 @@ namespace internal {
class ProfilerExtension : public v8::Extension {
public:
ProfilerExtension() : v8::Extension("v8/profiler", kSource) { }
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate,
v8::Handle<v8::String> name);
virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate, v8::Local<v8::String> name);
static void StartProfiling(const v8::FunctionCallbackInfo<v8::Value>& args);
static void StopProfiling(const v8::FunctionCallbackInfo<v8::Value>& args);
static v8::CpuProfile* last_profile;
......
This diff is collapsed.
This diff is collapsed.
......@@ -27,6 +27,9 @@
//
// Tests of the TokenLock class from lock.h
// TODO(mythria): Remove this define after this flag is turned on globally
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include <pthread.h>
#include <stdlib.h>
#include <unistd.h> // for usleep()
......
......@@ -27,6 +27,9 @@
//
// Tests of the TokenLock class from lock.h
// TODO(mythria): Remove this define after this flag is turned on globally
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include <stdlib.h>
#include "src/v8.h"
......
......@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(mythria): Remove this define after this flag is turned on globally
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include <stdint.h>
#include "src/base/build_config.h"
#include "src/base/platform/platform.h"
......@@ -40,7 +43,7 @@ void GetStackPointer(const v8::FunctionCallbackInfo<v8::Value>& args) {
TEST(StackAlignment) {
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::ObjectTemplate> global_template =
v8::Local<v8::ObjectTemplate> global_template =
v8::ObjectTemplate::New(isolate);
global_template->Set(v8_str("get_stack_pointer"),
v8::FunctionTemplate::New(isolate, GetStackPointer));
......@@ -52,12 +55,15 @@ TEST(StackAlignment) {
"}");
v8::Local<v8::Object> global_object = env->Global();
v8::Local<v8::Function> foo =
v8::Local<v8::Function>::Cast(global_object->Get(v8_str("foo")));
v8::Local<v8::Function> foo = v8::Local<v8::Function>::Cast(
global_object->Get(isolate->GetCurrentContext(), v8_str("foo"))
.ToLocalChecked());
v8::Local<v8::Value> result = foo->Call(global_object, 0, NULL);
CHECK_EQ(0u,
result->Uint32Value() % v8::base::OS::ActivationFrameAlignment());
v8::Local<v8::Value> result =
foo->Call(isolate->GetCurrentContext(), global_object, 0, NULL)
.ToLocalChecked();
CHECK_EQ(0u, result->Uint32Value(isolate->GetCurrentContext()).FromJust() %
v8::base::OS::ActivationFrameAlignment());
}
#endif // V8_CC_GNU
......@@ -27,6 +27,9 @@
//
// Tests of profiles generator and utilities.
// TODO(mythria): Remove this define after this flag is turned on globally
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include "src/v8.h"
#include "include/v8-profiler.h"
......@@ -577,15 +580,16 @@ TEST(ProfileNodeScriptId) {
v8::CpuProfiler* profiler = env->GetIsolate()->GetCpuProfiler();
i::CpuProfiler* iprofiler = reinterpret_cast<i::CpuProfiler*>(profiler);
CHECK_EQ(0, iprofiler->GetProfilesCount());
v8::Handle<v8::Script> script_a = v8::Script::Compile(v8::String::NewFromUtf8(
env->GetIsolate(), "function a() { startProfiling(); }\n"));
script_a->Run();
v8::Handle<v8::Script> script_b =
v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(),
"function b() { a(); }\n"
"b();\n"
"stopProfiling();\n"));
script_b->Run();
v8::Local<v8::Script> script_a =
v8_compile(v8_str("function a() { startProfiling(); }\n"));
script_a->Run(v8::Isolate::GetCurrent()->GetCurrentContext())
.ToLocalChecked();
v8::Local<v8::Script> script_b =
v8_compile(v8_str("function b() { a(); }\n"
"b();\n"
"stopProfiling();\n"));
script_b->Run(v8::Isolate::GetCurrent()->GetCurrentContext())
.ToLocalChecked();
CHECK_EQ(1, iprofiler->GetProfilesCount());
const v8::CpuProfile* profile = i::ProfilerExtension::last_profile;
const v8::CpuProfileNode* current = profile->GetTopDownRoot();
......@@ -632,9 +636,13 @@ static const char* line_number_test_source_profile_time_functions =
int GetFunctionLineNumber(LocalContext* env, const char* name) {
CpuProfiler* profiler = CcTest::i_isolate()->cpu_profiler();
CodeMap* code_map = profiler->generator()->code_map();
i::Handle<i::JSFunction> func = v8::Utils::OpenHandle(
*v8::Local<v8::Function>::Cast(
(*(*env))->Global()->Get(v8_str(name))));
i::Handle<i::JSFunction> func =
v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
(*(*env))
->Global()
->Get(v8::Isolate::GetCurrent()->GetCurrentContext(),
v8_str(name))
.ToLocalChecked()));
CodeEntry* func_entry = code_map->FindEntry(func->code()->address());
if (!func_entry)
FATAL(name);
......@@ -679,20 +687,19 @@ TEST(BailoutReason) {
v8::CpuProfiler* profiler = env->GetIsolate()->GetCpuProfiler();
i::CpuProfiler* iprofiler = reinterpret_cast<i::CpuProfiler*>(profiler);
CHECK_EQ(0, iprofiler->GetProfilesCount());
v8::Handle<v8::Script> script =
v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(),
"function Debugger() {\n"
" debugger;\n"
" startProfiling();\n"
"}\n"
"function TryFinally() {\n"
" try {\n"
" Debugger();\n"
" } finally { };\n"
"}\n"
"TryFinally();\n"
"stopProfiling();"));
script->Run();
v8::Local<v8::Script> script =
v8_compile(v8_str("function Debugger() {\n"
" debugger;\n"
" startProfiling();\n"
"}\n"
"function TryFinally() {\n"
" try {\n"
" Debugger();\n"
" } finally { };\n"
"}\n"
"TryFinally();\n"
"stopProfiling();"));
script->Run(v8::Isolate::GetCurrent()->GetCurrentContext()).ToLocalChecked();
CHECK_EQ(1, iprofiler->GetProfilesCount());
const v8::CpuProfile* profile = i::ProfilerExtension::last_profile;
CHECK(profile);
......
......@@ -25,6 +25,9 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// TODO(mythria): Remove this define after this flag is turned on globally
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include "src/v8.h"
#include "test/cctest/cctest.h"
......
......@@ -25,6 +25,9 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// TODO(mythria): Remove this define after this flag is turned on globally
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include <cstdlib>
#include <sstream>
......@@ -715,7 +718,7 @@ class ContextInitializer {
}
private:
v8::HandleScope scope_;
v8::Handle<v8::Context> env_;
v8::Local<v8::Context> env_;
};
......
......@@ -25,6 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// TODO(mythria): Remove this define after this flag is turned on globally
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include "src/assembler.h"
#include "test/cctest/cctest.h"
......
......@@ -25,6 +25,9 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// TODO(mythria): Remove this define after this flag is turned on globally
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include "test/cctest/cctest.h"
#include "src/property-details.h"
......
......@@ -4,6 +4,9 @@
//
// Tests the sampling API in include/v8.h
// TODO(mythria): Remove this define after this flag is turned on globally
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include <map>
#include <string>
#include "include/v8.h"
......@@ -94,14 +97,13 @@ class SamplingTestHelper {
DCHECK(!instance_);
instance_ = this;
v8::HandleScope scope(isolate_);
v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate_);
global->Set(v8::String::NewFromUtf8(isolate_, "CollectSample"),
v8::Local<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate_);
global->Set(v8_str("CollectSample"),
v8::FunctionTemplate::New(isolate_, CollectSample));
LocalContext env(isolate_, NULL, global);
isolate_->SetJitCodeEventHandler(v8::kJitCodeEventDefault,
JitCodeEventHandler);
v8::Script::Compile(
v8::String::NewFromUtf8(isolate_, test_function.c_str()))->Run();
CompileRun(v8_str(test_function.c_str()));
}
~SamplingTestHelper() {
......
This diff is collapsed.
......@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(mythria): Remove this define after this flag is turned on globally
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include "src/v8.h"
#include "src/objects.h"
......
......@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(mythria): Remove this define after this flag is turned on globally
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include "src/heap/slots-buffer.h"
#include "test/cctest/cctest.h"
......
......@@ -25,6 +25,9 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// TODO(mythria): Remove this define after this flag is turned on globally
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include <stdlib.h>
#include "src/base/platform/platform.h"
......
......@@ -25,6 +25,9 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// TODO(mythria): Remove this define after this flag is turned on globally
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include <stdlib.h>
#include "src/v8.h"
......
......@@ -30,6 +30,9 @@
// of ConsStrings. These operations may not be very fast, but they
// should be possible without getting errors due to too deep recursion.
// TODO(mythria): Remove this define after this flag is turned on globally
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include "src/v8.h"
#include "src/objects.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment