OLD | NEW |
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 "src/factory.h" | 5 #include "src/factory.h" |
6 | 6 |
7 #include "src/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 2214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2225 // object. | 2225 // object. |
2226 Handle<FixedArray> break_points( | 2226 Handle<FixedArray> break_points( |
2227 NewFixedArray(DebugInfo::kEstimatedNofBreakPointsInFunction)); | 2227 NewFixedArray(DebugInfo::kEstimatedNofBreakPointsInFunction)); |
2228 | 2228 |
2229 // Create and set up the debug info object. Debug info contains function, a | 2229 // Create and set up the debug info object. Debug info contains function, a |
2230 // copy of the original code, the executing code and initial fixed array for | 2230 // copy of the original code, the executing code and initial fixed array for |
2231 // active break points. | 2231 // active break points. |
2232 Handle<DebugInfo> debug_info = | 2232 Handle<DebugInfo> debug_info = |
2233 Handle<DebugInfo>::cast(NewStruct(DEBUG_INFO_TYPE)); | 2233 Handle<DebugInfo>::cast(NewStruct(DEBUG_INFO_TYPE)); |
2234 debug_info->set_shared(*shared); | 2234 debug_info->set_shared(*shared); |
2235 if (shared->IsInterpreted()) { | 2235 if (shared->HasBytecodeArray()) { |
2236 // We need to create a copy, but delay since this may cause heap | 2236 // We need to create a copy, but delay since this may cause heap |
2237 // verification. | 2237 // verification. |
2238 debug_info->set_abstract_code(AbstractCode::cast(shared->bytecode_array())); | 2238 debug_info->set_abstract_code(AbstractCode::cast(shared->bytecode_array())); |
2239 } else { | 2239 } else { |
2240 debug_info->set_abstract_code(AbstractCode::cast(shared->code())); | 2240 debug_info->set_abstract_code(AbstractCode::cast(shared->code())); |
2241 } | 2241 } |
2242 debug_info->set_break_points(*break_points); | 2242 debug_info->set_break_points(*break_points); |
2243 if (shared->IsInterpreted()) { | 2243 if (shared->HasBytecodeArray()) { |
2244 // Create a copy for debugging. | 2244 // Create a copy for debugging. |
2245 Handle<BytecodeArray> original(shared->bytecode_array()); | 2245 Handle<BytecodeArray> original(shared->bytecode_array()); |
2246 Handle<BytecodeArray> copy = CopyBytecodeArray(original); | 2246 Handle<BytecodeArray> copy = CopyBytecodeArray(original); |
2247 debug_info->set_abstract_code(AbstractCode::cast(*copy)); | 2247 debug_info->set_abstract_code(AbstractCode::cast(*copy)); |
2248 } | 2248 } |
2249 | 2249 |
2250 // Link debug info to function. | 2250 // Link debug info to function. |
2251 shared->set_debug_info(*debug_info); | 2251 shared->set_debug_info(*debug_info); |
2252 | 2252 |
2253 return debug_info; | 2253 return debug_info; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2371 } | 2371 } |
2372 | 2372 |
2373 | 2373 |
2374 Handle<Object> Factory::ToBoolean(bool value) { | 2374 Handle<Object> Factory::ToBoolean(bool value) { |
2375 return value ? true_value() : false_value(); | 2375 return value ? true_value() : false_value(); |
2376 } | 2376 } |
2377 | 2377 |
2378 | 2378 |
2379 } // namespace internal | 2379 } // namespace internal |
2380 } // namespace v8 | 2380 } // namespace v8 |
OLD | NEW |