From 0dcaac1939f2f017a7b33015443efc9cef2f845f Mon Sep 17 00:00:00 2001 From: "erik.corry@gmail.com" Date: Mon, 25 Oct 2010 15:22:03 +0000 Subject: [PATCH] Make Failure inherit from MaybeObject instead of Object. Review URL: http://codereview.chromium.org/3970005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5698 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/accessors.cc | 86 +- src/accessors.h | 60 +- src/api.cc | 26 +- src/arm/regexp-macro-assembler-arm.cc | 2 +- src/arm/stub-cache-arm.cc | 324 ++++---- src/bootstrapper.cc | 15 +- src/builtins.cc | 193 +++-- src/code-stubs.cc | 14 +- src/code-stubs.h | 2 +- src/compilation-cache.cc | 16 +- src/debug.cc | 12 +- src/execution.cc | 22 +- src/execution.h | 2 +- src/factory.cc | 30 +- src/globals.h | 5 +- src/heap-inl.h | 64 +- src/heap.cc | 1004 +++++++++++++++--------- src/heap.h | 200 ++--- src/ia32/assembler-ia32.cc | 11 +- src/ia32/macro-assembler-ia32.cc | 26 +- src/ia32/macro-assembler-ia32.h | 16 +- src/ia32/regexp-macro-assembler-ia32.cc | 2 +- src/ia32/stub-cache-ia32.cc | 378 +++++---- src/ic.cc | 330 ++++---- src/ic.h | 32 +- src/liveedit.cc | 43 +- src/liveedit.h | 7 +- src/log.cc | 7 +- src/mark-compact.cc | 48 +- src/mark-compact.h | 3 +- src/messages.cc | 4 +- src/objects-debug.cc | 32 +- src/objects-inl.h | 103 ++- src/objects.cc | 1307 +++++++++++++++++++------------ src/objects.h | 515 ++++++------ src/parser.cc | 4 +- src/property.h | 8 +- src/runtime.cc | 1246 ++++++++++++++++------------- src/runtime.h | 43 +- src/serialize.cc | 18 +- src/spaces-inl.h | 8 +- src/spaces.cc | 30 +- src/spaces.h | 50 +- src/stub-cache.cc | 827 +++++++++++-------- src/stub-cache.h | 460 +++++------ src/top.cc | 47 +- src/top.h | 21 +- src/x64/assembler-x64.cc | 8 +- src/x64/macro-assembler-x64.cc | 22 +- src/x64/macro-assembler-x64.h | 10 +- src/x64/regexp-macro-assembler-x64.cc | 2 +- src/x64/stub-cache-x64.cc | 327 ++++---- test/cctest/test-alloc.cc | 7 +- test/cctest/test-api.cc | 80 +- test/cctest/test-assembler-arm.cc | 49 +- test/cctest/test-assembler-ia32.cc | 62 +- test/cctest/test-compiler.cc | 22 +- test/cctest/test-disasm-ia32.cc | 7 +- test/cctest/test-heap.cc | 159 ++-- test/cctest/test-mark-compact.cc | 95 ++- test/cctest/test-serialize.cc | 14 +- test/cctest/test-spaces.cc | 18 +- test/cctest/test-strings.cc | 2 +- test/mjsunit/bugs/bug-617.js | 44 ++ 64 files changed, 5015 insertions(+), 3616 deletions(-) create mode 100644 test/mjsunit/bugs/bug-617.js diff --git a/src/accessors.cc b/src/accessors.cc index 3c49846..7c21659 100644 --- a/src/accessors.cc +++ b/src/accessors.cc @@ -50,7 +50,7 @@ static C* FindInPrototypeChain(Object* obj, bool* found_it) { // Entry point that never should be called. -Object* Accessors::IllegalSetter(JSObject*, Object*, void*) { +MaybeObject* Accessors::IllegalSetter(JSObject*, Object*, void*) { UNREACHABLE(); return NULL; } @@ -62,7 +62,7 @@ Object* Accessors::IllegalGetAccessor(Object* object, void*) { } -Object* Accessors::ReadOnlySetAccessor(JSObject*, Object* value, void*) { +MaybeObject* Accessors::ReadOnlySetAccessor(JSObject*, Object* value, void*) { // According to ECMA-262, section 8.6.2.2, page 28, setting // read-only properties must be silently ignored. return value; @@ -74,7 +74,7 @@ Object* Accessors::ReadOnlySetAccessor(JSObject*, Object* value, void*) { // -Object* Accessors::ArrayGetLength(Object* object, void*) { +MaybeObject* Accessors::ArrayGetLength(Object* object, void*) { // Traverse the prototype chain until we reach an array. bool found_it = false; JSArray* holder = FindInPrototypeChain(object, &found_it); @@ -96,7 +96,7 @@ Object* Accessors::FlattenNumber(Object* value) { } -Object* Accessors::ArraySetLength(JSObject* object, Object* value, void*) { +MaybeObject* Accessors::ArraySetLength(JSObject* object, Object* value, void*) { value = FlattenNumber(value); // Need to call methods that may trigger GC. @@ -144,7 +144,7 @@ const AccessorDescriptor Accessors::ArrayLength = { // -Object* Accessors::StringGetLength(Object* object, void*) { +MaybeObject* Accessors::StringGetLength(Object* object, void*) { Object* value = object; if (object->IsJSValue()) value = JSValue::cast(object)->value(); if (value->IsString()) return Smi::FromInt(String::cast(value)->length()); @@ -166,7 +166,7 @@ const AccessorDescriptor Accessors::StringLength = { // -Object* Accessors::ScriptGetSource(Object* object, void*) { +MaybeObject* Accessors::ScriptGetSource(Object* object, void*) { Object* script = JSValue::cast(object)->value(); return Script::cast(script)->source(); } @@ -184,7 +184,7 @@ const AccessorDescriptor Accessors::ScriptSource = { // -Object* Accessors::ScriptGetName(Object* object, void*) { +MaybeObject* Accessors::ScriptGetName(Object* object, void*) { Object* script = JSValue::cast(object)->value(); return Script::cast(script)->name(); } @@ -202,7 +202,7 @@ const AccessorDescriptor Accessors::ScriptName = { // -Object* Accessors::ScriptGetId(Object* object, void*) { +MaybeObject* Accessors::ScriptGetId(Object* object, void*) { Object* script = JSValue::cast(object)->value(); return Script::cast(script)->id(); } @@ -220,7 +220,7 @@ const AccessorDescriptor Accessors::ScriptId = { // -Object* Accessors::ScriptGetLineOffset(Object* object, void*) { +MaybeObject* Accessors::ScriptGetLineOffset(Object* object, void*) { Object* script = JSValue::cast(object)->value(); return Script::cast(script)->line_offset(); } @@ -238,7 +238,7 @@ const AccessorDescriptor Accessors::ScriptLineOffset = { // -Object* Accessors::ScriptGetColumnOffset(Object* object, void*) { +MaybeObject* Accessors::ScriptGetColumnOffset(Object* object, void*) { Object* script = JSValue::cast(object)->value(); return Script::cast(script)->column_offset(); } @@ -256,7 +256,7 @@ const AccessorDescriptor Accessors::ScriptColumnOffset = { // -Object* Accessors::ScriptGetData(Object* object, void*) { +MaybeObject* Accessors::ScriptGetData(Object* object, void*) { Object* script = JSValue::cast(object)->value(); return Script::cast(script)->data(); } @@ -274,7 +274,7 @@ const AccessorDescriptor Accessors::ScriptData = { // -Object* Accessors::ScriptGetType(Object* object, void*) { +MaybeObject* Accessors::ScriptGetType(Object* object, void*) { Object* script = JSValue::cast(object)->value(); return Script::cast(script)->type(); } @@ -292,7 +292,7 @@ const AccessorDescriptor Accessors::ScriptType = { // -Object* Accessors::ScriptGetCompilationType(Object* object, void*) { +MaybeObject* Accessors::ScriptGetCompilationType(Object* object, void*) { Object* script = JSValue::cast(object)->value(); return Script::cast(script)->compilation_type(); } @@ -310,7 +310,7 @@ const AccessorDescriptor Accessors::ScriptCompilationType = { // -Object* Accessors::ScriptGetLineEnds(Object* object, void*) { +MaybeObject* Accessors::ScriptGetLineEnds(Object* object, void*) { HandleScope scope; Handle