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

Side by Side Diff: src/api.cc

Issue 9572008: Implement date library functions in C++. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/full-codegen-arm.cc » ('j') | src/arm/lithium-codegen-arm.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 4716 matching lines...) Expand 10 before | Expand all | Expand 10 after
4727 EXCEPTION_BAILOUT_CHECK(isolate, Local<v8::Value>()); 4727 EXCEPTION_BAILOUT_CHECK(isolate, Local<v8::Value>());
4728 return Utils::ToLocal(obj); 4728 return Utils::ToLocal(obj);
4729 } 4729 }
4730 4730
4731 4731
4732 double v8::Date::NumberValue() const { 4732 double v8::Date::NumberValue() const {
4733 i::Isolate* isolate = i::Isolate::Current(); 4733 i::Isolate* isolate = i::Isolate::Current();
4734 if (IsDeadCheck(isolate, "v8::Date::NumberValue()")) return 0; 4734 if (IsDeadCheck(isolate, "v8::Date::NumberValue()")) return 0;
4735 LOG_API(isolate, "Date::NumberValue"); 4735 LOG_API(isolate, "Date::NumberValue");
4736 i::Handle<i::Object> obj = Utils::OpenHandle(this); 4736 i::Handle<i::Object> obj = Utils::OpenHandle(this);
4737 i::Handle<i::JSValue> jsvalue = i::Handle<i::JSValue>::cast(obj); 4737 i::Handle<i::JSDate> jsdate = i::Handle<i::JSDate>::cast(obj);
4738 return jsvalue->value()->Number(); 4738 return jsdate->value()->Number();
4739 } 4739 }
4740 4740
4741 4741
4742 void v8::Date::DateTimeConfigurationChangeNotification() { 4742 void v8::Date::DateTimeConfigurationChangeNotification() {
4743 i::Isolate* isolate = i::Isolate::Current(); 4743 i::Isolate* isolate = i::Isolate::Current();
4744 ON_BAILOUT(isolate, "v8::Date::DateTimeConfigurationChangeNotification()", 4744 ON_BAILOUT(isolate, "v8::Date::DateTimeConfigurationChangeNotification()",
4745 return); 4745 return);
4746 LOG_API(isolate, "Date::DateTimeConfigurationChangeNotification"); 4746 LOG_API(isolate, "Date::DateTimeConfigurationChangeNotification");
4747 ENTER_V8(isolate); 4747 ENTER_V8(isolate);
4748 4748
4749 i::HandleScope scope(isolate); 4749 i::HandleScope scope(isolate);
4750 // Get the function ResetDateCache (defined in date-delay.js). 4750 // Get the function ResetDateCache (defined in date.js).
4751 i::Handle<i::String> func_name_str = 4751 i::Handle<i::String> func_name_str =
4752 isolate->factory()->LookupAsciiSymbol("ResetDateCache"); 4752 isolate->factory()->LookupAsciiSymbol("ResetDateCache");
4753 i::MaybeObject* result = 4753 i::MaybeObject* result =
4754 isolate->js_builtins_object()->GetProperty(*func_name_str); 4754 isolate->js_builtins_object()->GetProperty(*func_name_str);
4755 i::Object* object_func; 4755 i::Object* object_func;
4756 if (!result->ToObject(&object_func)) { 4756 if (!result->ToObject(&object_func)) {
4757 return; 4757 return;
4758 } 4758 }
4759 4759
4760 if (object_func->IsJSFunction()) { 4760 if (object_func->IsJSFunction()) {
(...skipping 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after
6194 6194
6195 6195
6196 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 6196 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
6197 HandleScopeImplementer* scope_implementer = 6197 HandleScopeImplementer* scope_implementer =
6198 reinterpret_cast<HandleScopeImplementer*>(storage); 6198 reinterpret_cast<HandleScopeImplementer*>(storage);
6199 scope_implementer->IterateThis(v); 6199 scope_implementer->IterateThis(v);
6200 return storage + ArchiveSpacePerThread(); 6200 return storage + ArchiveSpacePerThread();
6201 } 6201 }
6202 6202
6203 } } // namespace v8::internal 6203 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/arm/full-codegen-arm.cc » ('j') | src/arm/lithium-codegen-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698