Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1408)

Unified Diff: src/handles.cc

Issue 1094014: Merge the partial_snapshots branch back into bleeding_edge. For... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/handles.cc
===================================================================
--- src/handles.cc (revision 4215)
+++ src/handles.cc (working copy)
@@ -236,6 +236,15 @@
}
+Handle<Object> SetNormalizedProperty(Handle<JSObject> object,
+ Handle<String> key,
+ Handle<Object> value,
+ PropertyDetails details) {
+ CALL_HEAP_FUNCTION(object->SetNormalizedProperty(*key, *value, details),
+ Object);
+}
+
+
Handle<Object> ForceDeleteProperty(Handle<JSObject> object,
Handle<Object> key) {
CALL_HEAP_FUNCTION(Runtime::ForceDeleteObjectProperty(object, key), Object);
@@ -777,92 +786,4 @@
}
}
-
-void LoadLazy(Handle<JSObject> obj, bool* pending_exception) {
- HandleScope scope;
- Handle<FixedArray> info(FixedArray::cast(obj->map()->constructor()));
- int index = Smi::cast(info->get(0))->value();
- ASSERT(index >= 0);
- Handle<Context> compile_context(Context::cast(info->get(1)));
- Handle<Context> function_context(Context::cast(info->get(2)));
- Handle<Object> receiver(compile_context->global()->builtins());
-
- Vector<const char> name = Natives::GetScriptName(index);
-
- Handle<SharedFunctionInfo> function_info;
-
- if (!Bootstrapper::NativesCacheLookup(name, &function_info)) {
- Handle<String> source_code = Bootstrapper::NativesSourceLookup(index);
- Handle<String> script_name = Factory::NewStringFromAscii(name);
- bool allow_natives_syntax = FLAG_allow_natives_syntax;
- FLAG_allow_natives_syntax = true;
- function_info = Compiler::Compile(source_code,
- script_name,
- 0, 0, NULL, NULL,
- Handle<String>::null(),
- NATIVES_CODE);
- FLAG_allow_natives_syntax = allow_natives_syntax;
- // If the compilation failed (possibly due to stack overflows), we
- // should never enter the result in the natives cache. Instead we
- // return from the function without marking the function as having
- // been lazily loaded.
- if (function_info.is_null()) {
- *pending_exception = true;
- return;
- }
- Bootstrapper::NativesCacheAdd(name, function_info);
- }
-
- // We shouldn't get here if compiling the script failed.
- ASSERT(!function_info.is_null());
-
-#ifdef ENABLE_DEBUGGER_SUPPORT
- // When the debugger running in its own context touches lazy loaded
- // functions loading can be triggered. In that case ensure that the
- // execution of the boilerplate is in the correct context.
- SaveContext save;
- if (!Debug::debug_context().is_null() &&
- Top::context() == *Debug::debug_context()) {
- Top::set_context(*compile_context);
- }
-#endif
-
- // Reset the lazy load data before running the script to make sure
- // not to get recursive lazy loading.
- obj->map()->set_needs_loading(false);
- obj->map()->set_constructor(info->get(3));
-
- // Run the script.
- Handle<JSFunction> script_fun(
- Factory::NewFunctionFromSharedFunctionInfo(function_info,
- function_context));
- Execution::Call(script_fun, receiver, 0, NULL, pending_exception);
-
- // If lazy loading failed, restore the unloaded state of obj.
- if (*pending_exception) {
- obj->map()->set_needs_loading(true);
- obj->map()->set_constructor(*info);
- }
-}
-
-
-void SetupLazy(Handle<JSObject> obj,
- int index,
- Handle<Context> compile_context,
- Handle<Context> function_context) {
- Handle<FixedArray> arr = Factory::NewFixedArray(4);
- arr->set(0, Smi::FromInt(index));
- arr->set(1, *compile_context); // Compile in this context
- arr->set(2, *function_context); // Set function context to this
- arr->set(3, obj->map()->constructor()); // Remember the constructor
- Handle<Map> old_map(obj->map());
- Handle<Map> new_map = Factory::CopyMapDropTransitions(old_map);
- obj->set_map(*new_map);
- new_map->set_needs_loading(true);
- // Store the lazy loading info in the constructor field. We'll
- // reestablish the constructor from the fixed array after loading.
- new_map->set_constructor(*arr);
- ASSERT(!obj->IsLoaded());
-}
-
} } // namespace v8::internal

Powered by Google App Engine
This is Rietveld 408576698