Changeset 57192 in webkit for trunk/JavaScriptCore/runtime
- Timestamp:
- Apr 6, 2010, 9:38:23 PM (15 years ago)
- Location:
- trunk/JavaScriptCore/runtime
- Files:
-
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/Completion.cpp
r52856 r57192 63 63 64 64 if (exception) { 65 if (exception.isObject() && asObject(exception)->isWatchdogException()) 66 return Completion(Interrupted, exception); 67 return Completion(Throw, exception); 65 ComplType exceptionType = Throw; 66 if (exception.isObject()) 67 exceptionType = asObject(exception)->exceptionType(); 68 return Completion(exceptionType, exception); 68 69 } 69 70 return Completion(Normal, result); -
trunk/JavaScriptCore/runtime/Completion.h
r44224 r57192 32 32 class SourceCode; 33 33 34 enum ComplType { Normal, Break, Continue, ReturnValue, Throw, Interrupted };34 enum ComplType { Normal, Break, Continue, ReturnValue, Throw, Interrupted, Terminated }; 35 35 36 36 /* -
trunk/JavaScriptCore/runtime/ExceptionHelpers.cpp
r54464 r57192 47 47 } 48 48 49 virtual bool isWatchdogException() const { return true; }49 virtual ComplType exceptionType() const { return Interrupted; } 50 50 51 51 virtual UString toString(ExecState*) const { return "JavaScript execution exceeded timeout."; } … … 55 55 { 56 56 return new (globalData) InterruptedExecutionError(globalData); 57 } 58 59 class TerminatedExecutionError : public JSObject { 60 public: 61 TerminatedExecutionError(JSGlobalData* globalData) 62 : JSObject(globalData->terminatedExecutionErrorStructure) 63 { 64 } 65 66 virtual ComplType exceptionType() const { return Terminated; } 67 68 virtual UString toString(ExecState*) const { return "JavaScript execution terminated."; } 69 }; 70 71 JSValue createTerminatedExecutionException(JSGlobalData* globalData) 72 { 73 return new (globalData) TerminatedExecutionError(globalData); 57 74 } 58 75 -
trunk/JavaScriptCore/runtime/ExceptionHelpers.h
r54394 r57192 44 44 45 45 JSValue createInterruptedExecutionException(JSGlobalData*); 46 JSValue createTerminatedExecutionException(JSGlobalData*); 46 47 JSValue createStackOverflowError(ExecState*); 47 48 JSValue createTypeError(ExecState*, const char* message); -
trunk/JavaScriptCore/runtime/JSGlobalData.cpp
r52956 r57192 116 116 , activationStructure(JSActivation::createStructure(jsNull())) 117 117 , interruptedExecutionErrorStructure(JSObject::createStructure(jsNull())) 118 , terminatedExecutionErrorStructure(JSObject::createStructure(jsNull())) 118 119 , staticScopeStructure(JSStaticScopeObject::createStructure(jsNull())) 119 120 , stringStructure(JSString::createStructure(jsNull())) -
trunk/JavaScriptCore/runtime/JSGlobalData.h
r52956 r57192 38 38 #include "NumericStrings.h" 39 39 #include "SmallStrings.h" 40 #include "Terminator.h" 40 41 #include "TimeoutChecker.h" 41 42 #include "WeakRandom.h" … … 117 118 RefPtr<Structure> activationStructure; 118 119 RefPtr<Structure> interruptedExecutionErrorStructure; 120 RefPtr<Structure> terminatedExecutionErrorStructure; 119 121 RefPtr<Structure> staticScopeStructure; 120 122 RefPtr<Structure> stringStructure; … … 154 156 #endif 155 157 TimeoutChecker timeoutChecker; 158 Terminator terminator; 156 159 Heap heap; 157 160 -
trunk/JavaScriptCore/runtime/JSObject.h
r57019 r57192 27 27 #include "ClassInfo.h" 28 28 #include "CommonIdentifiers.h" 29 #include "Completion.h" 29 30 #include "CallFrame.h" 30 31 #include "JSCell.h" … … 196 197 virtual bool isVariableObject() const { return false; } 197 198 virtual bool isActivationObject() const { return false; } 198 virtual bool isWatchdogException() const { return false; }199 199 virtual bool isNotAnObjectErrorStub() const { return false; } 200 201 virtual ComplType exceptionType() const { return Throw; } 200 202 201 203 void allocatePropertyStorage(size_t oldSize, size_t newSize); -
trunk/JavaScriptCore/runtime/Terminator.h
r57191 r57192 1 1 /* 2 * Copyright (C) 20 08 Apple Inc. All rights reserved.2 * Copyright (C) 2010 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 11 11 * notice, this list of conditions and the following disclaimer in the 12 12 * documentation and/or other materials provided with the distribution. 13 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of13 * 3. Neither the name of Google Inc. ("Google") nor the names of 14 14 * its contributors may be used to endorse or promote products derived 15 15 * from this software without specific prior written permission. … … 27 27 */ 28 28 29 #ifndef ExceptionHelpers_h 30 #define ExceptionHelpers_h 31 29 #ifndef Terminator_h 30 #define Terminator_h 32 31 33 32 namespace JSC { 34 33 35 class CodeBlock; 36 class ExecState; 37 class Identifier; 38 class JSGlobalData; 39 class JSNotAnObjectErrorStub; 40 class JSObject; 41 class JSValue; 42 class Node; 43 struct Instruction; 44 45 JSValue createInterruptedExecutionException(JSGlobalData*); 46 JSValue createStackOverflowError(ExecState*); 47 JSValue createTypeError(ExecState*, const char* message); 48 JSValue createUndefinedVariableError(ExecState*, const Identifier&, unsigned bytecodeOffset, CodeBlock*); 49 JSNotAnObjectErrorStub* createNotAnObjectErrorStub(ExecState*, bool isNull); 50 JSObject* createInvalidParamError(ExecState*, const char* op, JSValue, unsigned bytecodeOffset, CodeBlock*); 51 JSObject* createNotAConstructorError(ExecState*, JSValue, unsigned bytecodeOffset, CodeBlock*); 52 JSValue createNotAFunctionError(ExecState*, JSValue, unsigned bytecodeOffset, CodeBlock*); 53 JSObject* createNotAnObjectError(ExecState*, JSNotAnObjectErrorStub*, unsigned bytecodeOffset, CodeBlock*); 54 JSValue throwOutOfMemoryError(ExecState*); 34 class Terminator { 35 public: 36 Terminator() : m_shouldTerminate(false) { } 37 38 void terminateSoon() { m_shouldTerminate = true; } 39 bool shouldTerminate() const { return m_shouldTerminate; } 40 41 private: 42 bool m_shouldTerminate; 43 }; 55 44 56 45 } // namespace JSC 57 46 58 #endif // ExceptionHelpers_h47 #endif // Terminator_h
Note:
See TracChangeset
for help on using the changeset viewer.