OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 3784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3795 | 3795 |
3796 double v8::Date::NumberValue() const { | 3796 double v8::Date::NumberValue() const { |
3797 if (IsDeadCheck("v8::Date::NumberValue()")) return 0; | 3797 if (IsDeadCheck("v8::Date::NumberValue()")) return 0; |
3798 LOG_API("Date::NumberValue"); | 3798 LOG_API("Date::NumberValue"); |
3799 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 3799 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
3800 i::Handle<i::JSValue> jsvalue = i::Handle<i::JSValue>::cast(obj); | 3800 i::Handle<i::JSValue> jsvalue = i::Handle<i::JSValue>::cast(obj); |
3801 return jsvalue->value()->Number(); | 3801 return jsvalue->value()->Number(); |
3802 } | 3802 } |
3803 | 3803 |
3804 | 3804 |
| 3805 void v8::Date::ResetCache() { |
| 3806 ON_BAILOUT("v8::Date::ResetCache()", return); |
| 3807 LOG_API("Date::ResetCache"); |
| 3808 ENTER_V8; |
| 3809 |
| 3810 HandleScope scope; |
| 3811 |
| 3812 // Get the function ResetDateCache (defined in date-delay.js). |
| 3813 i::Handle<i::String> func_name_str = |
| 3814 i::Factory::LookupAsciiSymbol("ResetDateCache"); |
| 3815 i::MaybeObject* result = i::Top::builtins()->GetProperty(*func_name_str); |
| 3816 i::Object* object_func; |
| 3817 if (!result->ToObject(&object_func)) { |
| 3818 return; |
| 3819 } |
| 3820 |
| 3821 if (object_func->IsJSFunction()) { |
| 3822 i::Handle<i::JSFunction> func = |
| 3823 i::Handle<i::JSFunction>(i::JSFunction::cast(object_func)); |
| 3824 |
| 3825 // Call ResetDateCache(0 but expect no exceptions: |
| 3826 bool caught_exception = false; |
| 3827 i::Handle<i::Object> result = |
| 3828 i::Execution::TryCall(func, i::Top::builtins(), 0, NULL, |
| 3829 &caught_exception); |
| 3830 } |
| 3831 } |
| 3832 |
| 3833 |
3805 static i::Handle<i::String> RegExpFlagsToString(RegExp::Flags flags) { | 3834 static i::Handle<i::String> RegExpFlagsToString(RegExp::Flags flags) { |
3806 char flags_buf[3]; | 3835 char flags_buf[3]; |
3807 int num_flags = 0; | 3836 int num_flags = 0; |
3808 if ((flags & RegExp::kGlobal) != 0) flags_buf[num_flags++] = 'g'; | 3837 if ((flags & RegExp::kGlobal) != 0) flags_buf[num_flags++] = 'g'; |
3809 if ((flags & RegExp::kMultiline) != 0) flags_buf[num_flags++] = 'm'; | 3838 if ((flags & RegExp::kMultiline) != 0) flags_buf[num_flags++] = 'm'; |
3810 if ((flags & RegExp::kIgnoreCase) != 0) flags_buf[num_flags++] = 'i'; | 3839 if ((flags & RegExp::kIgnoreCase) != 0) flags_buf[num_flags++] = 'i'; |
3811 ASSERT(num_flags <= static_cast<int>(ARRAY_SIZE(flags_buf))); | 3840 ASSERT(num_flags <= static_cast<int>(ARRAY_SIZE(flags_buf))); |
3812 return i::Factory::LookupSymbol( | 3841 return i::Factory::LookupSymbol( |
3813 i::Vector<const char>(flags_buf, num_flags)); | 3842 i::Vector<const char>(flags_buf, num_flags)); |
3814 } | 3843 } |
(...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5107 | 5136 |
5108 | 5137 |
5109 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 5138 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
5110 HandleScopeImplementer* thread_local = | 5139 HandleScopeImplementer* thread_local = |
5111 reinterpret_cast<HandleScopeImplementer*>(storage); | 5140 reinterpret_cast<HandleScopeImplementer*>(storage); |
5112 thread_local->IterateThis(v); | 5141 thread_local->IterateThis(v); |
5113 return storage + ArchiveSpacePerThread(); | 5142 return storage + ArchiveSpacePerThread(); |
5114 } | 5143 } |
5115 | 5144 |
5116 } } // namespace v8::internal | 5145 } } // namespace v8::internal |
OLD | NEW |