Changeset 154434 in webkit for trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
- Timestamp:
- Aug 21, 2013, 6:04:37 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r154422 r154434 240 240 } 241 241 242 enum ConstantMode { IsConstant, IsVariable }; 243 enum FunctionMode { IsFunctionToSpecialize, NotFunctionOrNotSpecializable }; 244 int addGlobalVar(const Identifier&, ConstantMode, FunctionMode); 245 242 246 public: 243 247 JS_EXPORT_PRIVATE ~JSGlobalObject(); … … 261 265 // lookups prior to initializing the properties 262 266 bool symbolTableHasProperty(PropertyName); 267 268 void addVar(ExecState* exec, const Identifier& propertyName) 269 { 270 if (!hasProperty(exec, propertyName)) 271 addGlobalVar(propertyName, IsVariable, NotFunctionOrNotSpecializable); 272 } 273 void addConst(ExecState* exec, const Identifier& propertyName) 274 { 275 if (!hasProperty(exec, propertyName)) 276 addGlobalVar(propertyName, IsConstant, NotFunctionOrNotSpecializable); 277 } 278 void addFunction(ExecState* exec, const Identifier& propertyName, JSValue value) 279 { 280 bool propertyDidExist = removeDirect(exec->vm(), propertyName); // Newly declared functions overwrite existing properties. 281 int index = addGlobalVar(propertyName, IsVariable, !propertyDidExist ? IsFunctionToSpecialize : NotFunctionOrNotSpecializable); 282 registerAt(index).set(exec->vm(), this, value); 283 } 263 284 264 285 // The following accessors return pristine values, even if a script
Note:
See TracChangeset
for help on using the changeset viewer.