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

Side by Side Diff: src/objects-inl.h

Issue 9117034: New class for Date objects: caches individual date components. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add constant for index of first barrier-free slot. Created 8 years, 10 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/objects-debug.cc ('k') | src/objects-printer.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 template <> inline bool Is<JSFunction>(Object* obj) { 588 template <> inline bool Is<JSFunction>(Object* obj) {
589 return obj->IsJSFunction(); 589 return obj->IsJSFunction();
590 } 590 }
591 591
592 592
593 TYPE_CHECKER(Code, CODE_TYPE) 593 TYPE_CHECKER(Code, CODE_TYPE)
594 TYPE_CHECKER(Oddball, ODDBALL_TYPE) 594 TYPE_CHECKER(Oddball, ODDBALL_TYPE)
595 TYPE_CHECKER(JSGlobalPropertyCell, JS_GLOBAL_PROPERTY_CELL_TYPE) 595 TYPE_CHECKER(JSGlobalPropertyCell, JS_GLOBAL_PROPERTY_CELL_TYPE)
596 TYPE_CHECKER(SharedFunctionInfo, SHARED_FUNCTION_INFO_TYPE) 596 TYPE_CHECKER(SharedFunctionInfo, SHARED_FUNCTION_INFO_TYPE)
597 TYPE_CHECKER(JSValue, JS_VALUE_TYPE) 597 TYPE_CHECKER(JSValue, JS_VALUE_TYPE)
598 TYPE_CHECKER(JSDate, JS_DATE_TYPE)
598 TYPE_CHECKER(JSMessageObject, JS_MESSAGE_OBJECT_TYPE) 599 TYPE_CHECKER(JSMessageObject, JS_MESSAGE_OBJECT_TYPE)
599 600
600 601
601 bool Object::IsStringWrapper() { 602 bool Object::IsStringWrapper() {
602 return IsJSValue() && JSValue::cast(this)->value()->IsString(); 603 return IsJSValue() && JSValue::cast(this)->value()->IsString();
603 } 604 }
604 605
605 606
606 TYPE_CHECKER(Foreign, FOREIGN_TYPE) 607 TYPE_CHECKER(Foreign, FOREIGN_TYPE)
607 608
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 case JS_GLOBAL_PROXY_TYPE: 1384 case JS_GLOBAL_PROXY_TYPE:
1384 return JSGlobalProxy::kSize; 1385 return JSGlobalProxy::kSize;
1385 case JS_GLOBAL_OBJECT_TYPE: 1386 case JS_GLOBAL_OBJECT_TYPE:
1386 return JSGlobalObject::kSize; 1387 return JSGlobalObject::kSize;
1387 case JS_BUILTINS_OBJECT_TYPE: 1388 case JS_BUILTINS_OBJECT_TYPE:
1388 return JSBuiltinsObject::kSize; 1389 return JSBuiltinsObject::kSize;
1389 case JS_FUNCTION_TYPE: 1390 case JS_FUNCTION_TYPE:
1390 return JSFunction::kSize; 1391 return JSFunction::kSize;
1391 case JS_VALUE_TYPE: 1392 case JS_VALUE_TYPE:
1392 return JSValue::kSize; 1393 return JSValue::kSize;
1394 case JS_DATE_TYPE:
1395 return JSDate::kSize;
1393 case JS_ARRAY_TYPE: 1396 case JS_ARRAY_TYPE:
1394 return JSArray::kSize; 1397 return JSArray::kSize;
1395 case JS_WEAK_MAP_TYPE: 1398 case JS_WEAK_MAP_TYPE:
1396 return JSWeakMap::kSize; 1399 return JSWeakMap::kSize;
1397 case JS_REGEXP_TYPE: 1400 case JS_REGEXP_TYPE:
1398 return JSRegExp::kSize; 1401 return JSRegExp::kSize;
1399 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: 1402 case JS_CONTEXT_EXTENSION_OBJECT_TYPE:
1400 return JSObject::kHeaderSize; 1403 return JSObject::kHeaderSize;
1401 case JS_MESSAGE_OBJECT_TYPE: 1404 case JS_MESSAGE_OBJECT_TYPE:
1402 return JSMessageObject::kSize; 1405 return JSMessageObject::kSize;
(...skipping 2612 matching lines...) Expand 10 before | Expand all | Expand 10 after
4015 ACCESSORS(JSValue, value, Object, kValueOffset) 4018 ACCESSORS(JSValue, value, Object, kValueOffset)
4016 4019
4017 4020
4018 JSValue* JSValue::cast(Object* obj) { 4021 JSValue* JSValue::cast(Object* obj) {
4019 ASSERT(obj->IsJSValue()); 4022 ASSERT(obj->IsJSValue());
4020 ASSERT(HeapObject::cast(obj)->Size() == JSValue::kSize); 4023 ASSERT(HeapObject::cast(obj)->Size() == JSValue::kSize);
4021 return reinterpret_cast<JSValue*>(obj); 4024 return reinterpret_cast<JSValue*>(obj);
4022 } 4025 }
4023 4026
4024 4027
4028 ACCESSORS(JSDate, value, Object, kValueOffset)
4029 ACCESSORS(JSDate, year, Object, kYearOffset)
4030 ACCESSORS(JSDate, month, Object, kMonthOffset)
4031 ACCESSORS(JSDate, day, Object, kDayOffset)
4032 ACCESSORS(JSDate, hour, Object, kHourOffset)
4033 ACCESSORS(JSDate, min, Object, kMinOffset)
4034 ACCESSORS(JSDate, sec, Object, kSecOffset)
4035 ACCESSORS(JSDate, ms, Object, kMsOffset)
4036
4037
4038 JSDate* JSDate::cast(Object* obj) {
4039 ASSERT(obj->IsJSDate());
4040 ASSERT(HeapObject::cast(obj)->Size() == JSDate::kSize);
4041 return reinterpret_cast<JSDate*>(obj);
4042 }
4043
4044
4025 ACCESSORS(JSMessageObject, type, String, kTypeOffset) 4045 ACCESSORS(JSMessageObject, type, String, kTypeOffset)
4026 ACCESSORS(JSMessageObject, arguments, JSArray, kArgumentsOffset) 4046 ACCESSORS(JSMessageObject, arguments, JSArray, kArgumentsOffset)
4027 ACCESSORS(JSMessageObject, script, Object, kScriptOffset) 4047 ACCESSORS(JSMessageObject, script, Object, kScriptOffset)
4028 ACCESSORS(JSMessageObject, stack_trace, Object, kStackTraceOffset) 4048 ACCESSORS(JSMessageObject, stack_trace, Object, kStackTraceOffset)
4029 ACCESSORS(JSMessageObject, stack_frames, Object, kStackFramesOffset) 4049 ACCESSORS(JSMessageObject, stack_frames, Object, kStackFramesOffset)
4030 SMI_ACCESSORS(JSMessageObject, start_position, kStartPositionOffset) 4050 SMI_ACCESSORS(JSMessageObject, start_position, kStartPositionOffset)
4031 SMI_ACCESSORS(JSMessageObject, end_position, kEndPositionOffset) 4051 SMI_ACCESSORS(JSMessageObject, end_position, kEndPositionOffset)
4032 4052
4033 4053
4034 JSMessageObject* JSMessageObject::cast(Object* obj) { 4054 JSMessageObject* JSMessageObject::cast(Object* obj) {
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
4783 #undef WRITE_INT_FIELD 4803 #undef WRITE_INT_FIELD
4784 #undef READ_SHORT_FIELD 4804 #undef READ_SHORT_FIELD
4785 #undef WRITE_SHORT_FIELD 4805 #undef WRITE_SHORT_FIELD
4786 #undef READ_BYTE_FIELD 4806 #undef READ_BYTE_FIELD
4787 #undef WRITE_BYTE_FIELD 4807 #undef WRITE_BYTE_FIELD
4788 4808
4789 4809
4790 } } // namespace v8::internal 4810 } } // namespace v8::internal
4791 4811
4792 #endif // V8_OBJECTS_INL_H_ 4812 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects-debug.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698