| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #include "v8.h" | 28 #include "v8.h" |
| 29 | 29 |
| 30 #include "api.h" | 30 #include "api.h" |
| 31 #include "debug.h" | 31 #include "debug.h" |
| 32 #include "execution.h" | 32 #include "execution.h" |
| 33 #include "factory.h" | 33 #include "factory.h" |
| 34 #include "isolate-inl.h" |
| 34 #include "macro-assembler.h" | 35 #include "macro-assembler.h" |
| 35 #include "objects.h" | 36 #include "objects.h" |
| 36 #include "objects-visiting.h" | 37 #include "objects-visiting.h" |
| 37 #include "platform.h" | 38 #include "platform.h" |
| 38 #include "scopeinfo.h" | 39 #include "scopeinfo.h" |
| 39 | 40 |
| 40 namespace v8 { | 41 namespace v8 { |
| 41 namespace internal { | 42 namespace internal { |
| 42 | 43 |
| 43 | 44 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 } | 171 } |
| 171 | 172 |
| 172 | 173 |
| 173 // Internalized strings are created in the old generation (data space). | 174 // Internalized strings are created in the old generation (data space). |
| 174 Handle<String> Factory::InternalizeUtf8String(Vector<const char> string) { | 175 Handle<String> Factory::InternalizeUtf8String(Vector<const char> string) { |
| 175 CALL_HEAP_FUNCTION(isolate(), | 176 CALL_HEAP_FUNCTION(isolate(), |
| 176 isolate()->heap()->InternalizeUtf8String(string), | 177 isolate()->heap()->InternalizeUtf8String(string), |
| 177 String); | 178 String); |
| 178 } | 179 } |
| 179 | 180 |
| 181 |
| 180 // Internalized strings are created in the old generation (data space). | 182 // Internalized strings are created in the old generation (data space). |
| 181 Handle<String> Factory::InternalizeString(Handle<String> string) { | 183 Handle<String> Factory::InternalizeString(Handle<String> string) { |
| 182 CALL_HEAP_FUNCTION(isolate(), | 184 CALL_HEAP_FUNCTION(isolate(), |
| 183 isolate()->heap()->InternalizeString(*string), | 185 isolate()->heap()->InternalizeString(*string), |
| 184 String); | 186 String); |
| 185 } | 187 } |
| 186 | 188 |
| 189 |
| 187 Handle<String> Factory::InternalizeOneByteString(Vector<const uint8_t> string) { | 190 Handle<String> Factory::InternalizeOneByteString(Vector<const uint8_t> string) { |
| 188 CALL_HEAP_FUNCTION(isolate(), | 191 CALL_HEAP_FUNCTION(isolate(), |
| 189 isolate()->heap()->InternalizeOneByteString(string), | 192 isolate()->heap()->InternalizeOneByteString(string), |
| 190 String); | 193 String); |
| 191 } | 194 } |
| 192 | 195 |
| 193 | 196 |
| 194 Handle<String> Factory::InternalizeOneByteString( | 197 Handle<String> Factory::InternalizeOneByteString( |
| 195 Handle<SeqOneByteString> string, int from, int length) { | 198 Handle<SeqOneByteString> string, int from, int length) { |
| 196 CALL_HEAP_FUNCTION(isolate(), | 199 CALL_HEAP_FUNCTION(isolate(), |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 | 512 |
| 510 Handle<PropertyCell> Factory::NewPropertyCell(Handle<Object> value) { | 513 Handle<PropertyCell> Factory::NewPropertyCell(Handle<Object> value) { |
| 511 AllowDeferredHandleDereference convert_to_cell; | 514 AllowDeferredHandleDereference convert_to_cell; |
| 512 CALL_HEAP_FUNCTION( | 515 CALL_HEAP_FUNCTION( |
| 513 isolate(), | 516 isolate(), |
| 514 isolate()->heap()->AllocatePropertyCell(*value), | 517 isolate()->heap()->AllocatePropertyCell(*value), |
| 515 PropertyCell); | 518 PropertyCell); |
| 516 } | 519 } |
| 517 | 520 |
| 518 | 521 |
| 522 Handle<AllocationSite> Factory::NewAllocationSite() { |
| 523 CALL_HEAP_FUNCTION( |
| 524 isolate(), |
| 525 isolate()->heap()->AllocateAllocationSite(), |
| 526 AllocationSite); |
| 527 } |
| 528 |
| 529 |
| 519 Handle<Map> Factory::NewMap(InstanceType type, | 530 Handle<Map> Factory::NewMap(InstanceType type, |
| 520 int instance_size, | 531 int instance_size, |
| 521 ElementsKind elements_kind) { | 532 ElementsKind elements_kind) { |
| 522 CALL_HEAP_FUNCTION( | 533 CALL_HEAP_FUNCTION( |
| 523 isolate(), | 534 isolate(), |
| 524 isolate()->heap()->AllocateMap(type, instance_size, elements_kind), | 535 isolate()->heap()->AllocateMap(type, instance_size, elements_kind), |
| 525 Map); | 536 Map); |
| 526 } | 537 } |
| 527 | 538 |
| 528 | 539 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 // Caching of optimized code enabled and optimized code found. | 664 // Caching of optimized code enabled and optimized code found. |
| 654 function_info->InstallFromOptimizedCodeMap(*result, index); | 665 function_info->InstallFromOptimizedCodeMap(*result, index); |
| 655 return result; | 666 return result; |
| 656 } | 667 } |
| 657 | 668 |
| 658 if (V8::UseCrankshaft() && | 669 if (V8::UseCrankshaft() && |
| 659 FLAG_always_opt && | 670 FLAG_always_opt && |
| 660 result->is_compiled() && | 671 result->is_compiled() && |
| 661 !function_info->is_toplevel() && | 672 !function_info->is_toplevel() && |
| 662 function_info->allows_lazy_compilation() && | 673 function_info->allows_lazy_compilation() && |
| 663 !function_info->optimization_disabled()) { | 674 !function_info->optimization_disabled() && |
| 675 !isolate()->DebuggerHasBreakPoints()) { |
| 664 result->MarkForLazyRecompilation(); | 676 result->MarkForLazyRecompilation(); |
| 665 } | 677 } |
| 666 return result; | 678 return result; |
| 667 } | 679 } |
| 668 | 680 |
| 669 | 681 |
| 670 Handle<Object> Factory::NewNumber(double value, | 682 Handle<Object> Factory::NewNumber(double value, |
| 671 PretenureFlag pretenure) { | 683 PretenureFlag pretenure) { |
| 672 CALL_HEAP_FUNCTION( | 684 CALL_HEAP_FUNCTION( |
| 673 isolate(), | 685 isolate(), |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1226 isolate()->heap()->AllocateJSMessageObject(*type, | 1238 isolate()->heap()->AllocateJSMessageObject(*type, |
| 1227 *arguments, | 1239 *arguments, |
| 1228 start_position, | 1240 start_position, |
| 1229 end_position, | 1241 end_position, |
| 1230 *script, | 1242 *script, |
| 1231 *stack_trace, | 1243 *stack_trace, |
| 1232 *stack_frames), | 1244 *stack_frames), |
| 1233 JSMessageObject); | 1245 JSMessageObject); |
| 1234 } | 1246 } |
| 1235 | 1247 |
| 1248 |
| 1236 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(Handle<String> name) { | 1249 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(Handle<String> name) { |
| 1237 CALL_HEAP_FUNCTION(isolate(), | 1250 CALL_HEAP_FUNCTION(isolate(), |
| 1238 isolate()->heap()->AllocateSharedFunctionInfo(*name), | 1251 isolate()->heap()->AllocateSharedFunctionInfo(*name), |
| 1239 SharedFunctionInfo); | 1252 SharedFunctionInfo); |
| 1240 } | 1253 } |
| 1241 | 1254 |
| 1242 | 1255 |
| 1243 Handle<String> Factory::NumberToString(Handle<Object> number) { | 1256 Handle<String> Factory::NumberToString(Handle<Object> number) { |
| 1244 CALL_HEAP_FUNCTION(isolate(), | 1257 CALL_HEAP_FUNCTION(isolate(), |
| 1245 isolate()->heap()->NumberToString(*number), String); | 1258 isolate()->heap()->NumberToString(*number), String); |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1598 return Handle<Object>::null(); | 1611 return Handle<Object>::null(); |
| 1599 } | 1612 } |
| 1600 | 1613 |
| 1601 | 1614 |
| 1602 Handle<Object> Factory::ToBoolean(bool value) { | 1615 Handle<Object> Factory::ToBoolean(bool value) { |
| 1603 return value ? true_value() : false_value(); | 1616 return value ? true_value() : false_value(); |
| 1604 } | 1617 } |
| 1605 | 1618 |
| 1606 | 1619 |
| 1607 } } // namespace v8::internal | 1620 } } // namespace v8::internal |
| OLD | NEW |