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

Side by Side Diff: src/factory.cc

Issue 256653004: Always include debugger support. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Makefile Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "factory.h" 5 #include "factory.h"
6 6
7 #include "macro-assembler.h" 7 #include "macro-assembler.h"
8 #include "isolate-inl.h" 8 #include "isolate-inl.h"
9 #include "v8conversions.h" 9 #include "v8conversions.h"
10 10
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 code->set_next_code_link(*undefined_value()); 1386 code->set_next_code_link(*undefined_value());
1387 code->set_handler_table(*empty_fixed_array(), SKIP_WRITE_BARRIER); 1387 code->set_handler_table(*empty_fixed_array(), SKIP_WRITE_BARRIER);
1388 code->set_prologue_offset(prologue_offset); 1388 code->set_prologue_offset(prologue_offset);
1389 if (code->kind() == Code::OPTIMIZED_FUNCTION) { 1389 if (code->kind() == Code::OPTIMIZED_FUNCTION) {
1390 code->set_marked_for_deoptimization(false); 1390 code->set_marked_for_deoptimization(false);
1391 } 1391 }
1392 1392
1393 desc.origin->PopulateConstantPool(*constant_pool); 1393 desc.origin->PopulateConstantPool(*constant_pool);
1394 code->set_constant_pool(*constant_pool); 1394 code->set_constant_pool(*constant_pool);
1395 1395
1396 #ifdef ENABLE_DEBUGGER_SUPPORT
1397 if (code->kind() == Code::FUNCTION) { 1396 if (code->kind() == Code::FUNCTION) {
1398 code->set_has_debug_break_slots(isolate()->debugger()->IsDebuggerActive()); 1397 code->set_has_debug_break_slots(isolate()->debugger()->IsDebuggerActive());
1399 } 1398 }
1400 #endif
1401 1399
1402 // Allow self references to created code object by patching the handle to 1400 // Allow self references to created code object by patching the handle to
1403 // point to the newly allocated Code object. 1401 // point to the newly allocated Code object.
1404 if (!self_ref.is_null()) *(self_ref.location()) = *code; 1402 if (!self_ref.is_null()) *(self_ref.location()) = *code;
1405 1403
1406 // Migrate generated code. 1404 // Migrate generated code.
1407 // The generated code can contain Object** values (typically from handles) 1405 // The generated code can contain Object** values (typically from handles)
1408 // that are dereferenced during the copy to point directly to the actual heap 1406 // that are dereferenced during the copy to point directly to the actual heap
1409 // objects. These pointers can include references to the code object itself, 1407 // objects. These pointers can include references to the code object itself,
1410 // through the self_reference parameter. 1408 // through the self_reference parameter.
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
2024 2022
2025 2023
2026 Handle<JSFunction> Factory::NewFunctionWithPrototype(Handle<String> name, 2024 Handle<JSFunction> Factory::NewFunctionWithPrototype(Handle<String> name,
2027 Handle<Object> prototype) { 2025 Handle<Object> prototype) {
2028 Handle<SharedFunctionInfo> info = NewSharedFunctionInfo(name); 2026 Handle<SharedFunctionInfo> info = NewSharedFunctionInfo(name);
2029 Handle<Context> context(isolate()->context()->native_context()); 2027 Handle<Context> context(isolate()->context()->native_context());
2030 return NewFunction(info, context, prototype); 2028 return NewFunction(info, context, prototype);
2031 } 2029 }
2032 2030
2033 2031
2034 #ifdef ENABLE_DEBUGGER_SUPPORT
2035 Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) { 2032 Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) {
2036 // Get the original code of the function. 2033 // Get the original code of the function.
2037 Handle<Code> code(shared->code()); 2034 Handle<Code> code(shared->code());
2038 2035
2039 // Create a copy of the code before allocating the debug info object to avoid 2036 // Create a copy of the code before allocating the debug info object to avoid
2040 // allocation while setting up the debug info object. 2037 // allocation while setting up the debug info object.
2041 Handle<Code> original_code(*Factory::CopyCode(code)); 2038 Handle<Code> original_code(*Factory::CopyCode(code));
2042 2039
2043 // Allocate initial fixed array for active break points before allocating the 2040 // Allocate initial fixed array for active break points before allocating the
2044 // debug info object to avoid allocation while setting up the debug info 2041 // debug info object to avoid allocation while setting up the debug info
2045 // object. 2042 // object.
2046 Handle<FixedArray> break_points( 2043 Handle<FixedArray> break_points(
2047 NewFixedArray(Debug::kEstimatedNofBreakPointsInFunction)); 2044 NewFixedArray(Debug::kEstimatedNofBreakPointsInFunction));
2048 2045
2049 // Create and set up the debug info object. Debug info contains function, a 2046 // Create and set up the debug info object. Debug info contains function, a
2050 // copy of the original code, the executing code and initial fixed array for 2047 // copy of the original code, the executing code and initial fixed array for
2051 // active break points. 2048 // active break points.
2052 Handle<DebugInfo> debug_info = 2049 Handle<DebugInfo> debug_info =
2053 Handle<DebugInfo>::cast(NewStruct(DEBUG_INFO_TYPE)); 2050 Handle<DebugInfo>::cast(NewStruct(DEBUG_INFO_TYPE));
2054 debug_info->set_shared(*shared); 2051 debug_info->set_shared(*shared);
2055 debug_info->set_original_code(*original_code); 2052 debug_info->set_original_code(*original_code);
2056 debug_info->set_code(*code); 2053 debug_info->set_code(*code);
2057 debug_info->set_break_points(*break_points); 2054 debug_info->set_break_points(*break_points);
2058 2055
2059 // Link debug info to function. 2056 // Link debug info to function.
2060 shared->set_debug_info(*debug_info); 2057 shared->set_debug_info(*debug_info);
2061 2058
2062 return debug_info; 2059 return debug_info;
2063 } 2060 }
2064 #endif
2065 2061
2066 2062
2067 Handle<JSObject> Factory::NewArgumentsObject(Handle<Object> callee, 2063 Handle<JSObject> Factory::NewArgumentsObject(Handle<Object> callee,
2068 int length) { 2064 int length) {
2069 CALL_HEAP_FUNCTION( 2065 CALL_HEAP_FUNCTION(
2070 isolate(), 2066 isolate(),
2071 isolate()->heap()->AllocateArgumentsObject(*callee, length), JSObject); 2067 isolate()->heap()->AllocateArgumentsObject(*callee, length), JSObject);
2072 } 2068 }
2073 2069
2074 2070
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
2326 return Handle<Object>::null(); 2322 return Handle<Object>::null();
2327 } 2323 }
2328 2324
2329 2325
2330 Handle<Object> Factory::ToBoolean(bool value) { 2326 Handle<Object> Factory::ToBoolean(bool value) {
2331 return value ? true_value() : false_value(); 2327 return value ? true_value() : false_value();
2332 } 2328 }
2333 2329
2334 2330
2335 } } // namespace v8::internal 2331 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698