| Index: src/handles.cc
|
| ===================================================================
|
| --- src/handles.cc (revision 7031)
|
| +++ src/handles.cc (working copy)
|
| @@ -261,20 +261,24 @@
|
| Handle<Object> SetProperty(Handle<JSObject> object,
|
| Handle<String> key,
|
| Handle<Object> value,
|
| - PropertyAttributes attributes) {
|
| + PropertyAttributes attributes,
|
| + StrictModeFlag strict) {
|
| CALL_HEAP_FUNCTION(object->GetHeap()->isolate(),
|
| - object->SetProperty(*key, *value, attributes), Object);
|
| + object->SetProperty(*key, *value, attributes, strict),
|
| + Object);
|
| }
|
|
|
|
|
| Handle<Object> SetProperty(Handle<Object> object,
|
| Handle<Object> key,
|
| Handle<Object> value,
|
| - PropertyAttributes attributes) {
|
| + PropertyAttributes attributes,
|
| + StrictModeFlag strict) {
|
| Isolate* isolate = Isolate::Current();
|
| CALL_HEAP_FUNCTION(
|
| isolate,
|
| - Runtime::SetObjectProperty(isolate, object, key, value, attributes),
|
| + Runtime::SetObjectProperty(
|
| + isolate, object, key, value, attributes, strict),
|
| Object);
|
| }
|
|
|
| @@ -322,14 +326,27 @@
|
| }
|
|
|
|
|
| +void SetLocalPropertyNoThrow(Handle<JSObject> object,
|
| + Handle<String> key,
|
| + Handle<Object> value,
|
| + PropertyAttributes attributes) {
|
| + ASSERT(!object->GetIsolate()->has_pending_exception());
|
| + CHECK(!SetLocalPropertyIgnoreAttributes(
|
| + object, key, value, attributes).is_null());
|
| + CHECK(!object->GetIsolate()->has_pending_exception());
|
| +}
|
| +
|
| +
|
| Handle<Object> SetPropertyWithInterceptor(Handle<JSObject> object,
|
| Handle<String> key,
|
| Handle<Object> value,
|
| - PropertyAttributes attributes) {
|
| + PropertyAttributes attributes,
|
| + StrictModeFlag strict) {
|
| CALL_HEAP_FUNCTION(object->GetIsolate(),
|
| object->SetPropertyWithInterceptor(*key,
|
| *value,
|
| - attributes),
|
| + attributes,
|
| + strict),
|
| Object);
|
| }
|
|
|
| @@ -897,49 +914,41 @@
|
| }
|
|
|
|
|
| -bool CompileLazy(Handle<JSFunction> function,
|
| - ClearExceptionFlag flag) {
|
| +static bool CompileLazyFunction(Handle<JSFunction> function,
|
| + ClearExceptionFlag flag,
|
| + InLoopFlag in_loop_flag) {
|
| bool result = true;
|
| if (function->shared()->is_compiled()) {
|
| function->ReplaceCode(function->shared()->code());
|
| function->shared()->set_code_age(0);
|
| } else {
|
| CompilationInfo info(function);
|
| + if (in_loop_flag == IN_LOOP) info.MarkAsInLoop();
|
| result = CompileLazyHelper(&info, flag);
|
| ASSERT(!result || function->is_compiled());
|
| }
|
| - if (result && function->is_compiled()) {
|
| - PROFILE(FunctionCreateEvent(*function));
|
| - }
|
| return result;
|
| }
|
|
|
|
|
| +bool CompileLazy(Handle<JSFunction> function,
|
| + ClearExceptionFlag flag) {
|
| + return CompileLazyFunction(function, flag, NOT_IN_LOOP);
|
| +}
|
| +
|
| +
|
| bool CompileLazyInLoop(Handle<JSFunction> function,
|
| ClearExceptionFlag flag) {
|
| - bool result = true;
|
| - if (function->shared()->is_compiled()) {
|
| - function->ReplaceCode(function->shared()->code());
|
| - function->shared()->set_code_age(0);
|
| - } else {
|
| - CompilationInfo info(function);
|
| - info.MarkAsInLoop();
|
| - result = CompileLazyHelper(&info, flag);
|
| - ASSERT(!result || function->is_compiled());
|
| - }
|
| - if (result && function->is_compiled()) {
|
| - PROFILE(FunctionCreateEvent(*function));
|
| - }
|
| - return result;
|
| + return CompileLazyFunction(function, flag, IN_LOOP);
|
| }
|
|
|
|
|
| -bool CompileOptimized(Handle<JSFunction> function, int osr_ast_id) {
|
| +bool CompileOptimized(Handle<JSFunction> function,
|
| + int osr_ast_id,
|
| + ClearExceptionFlag flag) {
|
| CompilationInfo info(function);
|
| info.SetOptimizing(osr_ast_id);
|
| - bool result = CompileLazyHelper(&info, KEEP_EXCEPTION);
|
| - if (result) PROFILE(FunctionCreateEvent(*function));
|
| - return result;
|
| + return CompileLazyHelper(&info, flag);
|
| }
|
|
|
|
|
|
|