| Index: src/elements.h
|
| diff --git a/src/shell.h b/src/elements.h
|
| similarity index 60%
|
| copy from src/shell.h
|
| copy to src/elements.h
|
| index ca510408cccde4a8cfe31e7f5bcfd15798695622..b552286f0804798b9e3b35099d92fe56eb00391d 100644
|
| --- a/src/shell.h
|
| +++ b/src/elements.h
|
| @@ -1,4 +1,4 @@
|
| -// Copyright 2006-2008 the V8 project authors. All rights reserved.
|
| +// Copyright 2011 the V8 project authors. All rights reserved.
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| // met:
|
| @@ -24,32 +24,43 @@
|
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| -//
|
| -// A simple interactive shell. Enable with --shell.
|
|
|
| -#ifndef V8_SHELL_H_
|
| -#define V8_SHELL_H_
|
| +#ifndef V8_ELEMENTS_H_
|
| +#define V8_ELEMENTS_H_
|
|
|
| -#include "../public/debug.h"
|
| +#include "objects.h"
|
|
|
| namespace v8 {
|
| namespace internal {
|
|
|
| -// Debug event handler for interactive debugging.
|
| -void handle_debug_event(v8::DebugEvent event,
|
| - v8::Handle<v8::Object> exec_state,
|
| - v8::Handle<v8::Object> event_data,
|
| - v8::Handle<Value> data);
|
| +// Abstract base class for handles that can operate on objects with differing
|
| +// ElementsKinds.
|
| +class ElementsAccessor {
|
| + public:
|
| + ElementsAccessor() { }
|
| + virtual ~ElementsAccessor() { }
|
| + virtual MaybeObject* GetWithReceiver(JSObject* obj,
|
| + Object* receiver,
|
| + uint32_t index) = 0;
|
|
|
| + virtual MaybeObject* Delete(JSObject* obj,
|
| + uint32_t index,
|
| + JSReceiver::DeleteMode mode) = 0;
|
|
|
| -class Shell {
|
| - public:
|
| - static void PrintObject(v8::Handle<v8::Value> obj);
|
| - // Run the read-eval loop, executing code in the specified
|
| - // environment.
|
| - static void Run(v8::Handle<v8::Context> context);
|
| + // Returns a shared ElementsAccessor for the specified ElementsKind.
|
| + static ElementsAccessor* ForKind(JSObject::ElementsKind elements_kind) {
|
| + ASSERT(elements_kind < JSObject::kElementsKindCount);
|
| + return elements_accessors_[elements_kind];
|
| + }
|
| +
|
| + static void InitializeOncePerProcess();
|
| +
|
| + private:
|
| + static ElementsAccessor** elements_accessors_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ElementsAccessor);
|
| };
|
|
|
| } } // namespace v8::internal
|
|
|
| -#endif // V8_SHELL_H_
|
| +#endif // V8_ELEMENTS_H_
|
|
|