From 61c7b030e9a1981519ddd7dae28422e4bec84f1e Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Wed, 29 Jun 2011 08:45:22 +0000 Subject: [PATCH] reverting revision r8454 Review URL: http://codereview.chromium.org/7218042 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8457 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/d8.cc | 26 -------------------------- src/d8.h | 1 - 2 files changed, 27 deletions(-) diff --git a/src/d8.cc b/src/d8.cc index 7d16ec3473..7655aad4b5 100644 --- a/src/d8.cc +++ b/src/d8.cc @@ -599,36 +599,10 @@ Handle Shell::CreateGlobalTemplate() { AddOSMethods(os_templ); global_template->Set(String::New("os"), os_templ); - Handle counter_templ = ObjectTemplate::New(); - counter_templ->Set(String::New("get"), - FunctionTemplate::New(CounterGetValue)); - global_template->Set(String::New("counter"), counter_templ); - return global_template; } -Handle Shell::CounterGetValue(const Arguments& args){ - if (args.Length() != 1) { - return ThrowException(String::New("get() takes one argument")); - } - if (args[0]->IsString()) { - String::AsciiValue name(args[0]); - Counter* counter = counter_map_->Lookup(*name); - if (!counter) { - String::AsciiValue prefixed(String::Concat(String::New("c:"), - String::New(*name))); - counter = counter_map_->Lookup(*prefixed); - if (!counter) { - return ThrowException(String::New("invalid counter name")); - } - } - return Handle::Cast(Integer::New(counter->count())); - } - return ThrowException(String::New("counter name must be a string")); -} - - void Shell::Initialize(bool test_shell) { #ifdef COMPRESS_STARTUP_DATA_BZ2 BZip2Decompressor startup_data_decompressor; diff --git a/src/d8.h b/src/d8.h index 4a82c0becf..f3760e8bc8 100644 --- a/src/d8.h +++ b/src/d8.h @@ -128,7 +128,6 @@ class Shell: public i::AllStatic { size_t buckets); static void AddHistogramSample(void* histogram, int sample); static void MapCounters(const char* name); - static Handle CounterGetValue(const Arguments& args); static Handle ReadFile(const char* name); static void Initialize(bool test_shell); static void RenewEvaluationContext();