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

Side by Side Diff: src/objects.cc

Issue 1574223002: Revert of [builtins] Refactor the remaining Date builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime.h » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 19313 matching lines...) Expand 10 before | Expand all | Expand 10 after
19324 case kDaysUTC: return Smi::FromInt(days); 19324 case kDaysUTC: return Smi::FromInt(days);
19325 case kTimeInDayUTC: return Smi::FromInt(time_in_day_ms); 19325 case kTimeInDayUTC: return Smi::FromInt(time_in_day_ms);
19326 default: UNREACHABLE(); 19326 default: UNREACHABLE();
19327 } 19327 }
19328 19328
19329 UNREACHABLE(); 19329 UNREACHABLE();
19330 return NULL; 19330 return NULL;
19331 } 19331 }
19332 19332
19333 19333
19334 // static
19335 Handle<Object> JSDate::SetValue(Handle<JSDate> date, double v) {
19336 Isolate* const isolate = date->GetIsolate();
19337 Handle<Object> value = isolate->factory()->NewNumber(v);
19338 bool value_is_nan = std::isnan(v);
19339 date->SetValue(*value, value_is_nan);
19340 return value;
19341 }
19342
19343
19344 void JSDate::SetValue(Object* value, bool is_value_nan) { 19334 void JSDate::SetValue(Object* value, bool is_value_nan) {
19345 set_value(value); 19335 set_value(value);
19346 if (is_value_nan) { 19336 if (is_value_nan) {
19347 HeapNumber* nan = GetIsolate()->heap()->nan_value(); 19337 HeapNumber* nan = GetIsolate()->heap()->nan_value();
19348 set_cache_stamp(nan, SKIP_WRITE_BARRIER); 19338 set_cache_stamp(nan, SKIP_WRITE_BARRIER);
19349 set_year(nan, SKIP_WRITE_BARRIER); 19339 set_year(nan, SKIP_WRITE_BARRIER);
19350 set_month(nan, SKIP_WRITE_BARRIER); 19340 set_month(nan, SKIP_WRITE_BARRIER);
19351 set_day(nan, SKIP_WRITE_BARRIER); 19341 set_day(nan, SKIP_WRITE_BARRIER);
19352 set_hour(nan, SKIP_WRITE_BARRIER); 19342 set_hour(nan, SKIP_WRITE_BARRIER);
19353 set_min(nan, SKIP_WRITE_BARRIER); 19343 set_min(nan, SKIP_WRITE_BARRIER);
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
19648 if (cell->value() != *new_value) { 19638 if (cell->value() != *new_value) {
19649 cell->set_value(*new_value); 19639 cell->set_value(*new_value);
19650 Isolate* isolate = cell->GetIsolate(); 19640 Isolate* isolate = cell->GetIsolate();
19651 cell->dependent_code()->DeoptimizeDependentCodeGroup( 19641 cell->dependent_code()->DeoptimizeDependentCodeGroup(
19652 isolate, DependentCode::kPropertyCellChangedGroup); 19642 isolate, DependentCode::kPropertyCellChangedGroup);
19653 } 19643 }
19654 } 19644 }
19655 19645
19656 } // namespace internal 19646 } // namespace internal
19657 } // namespace v8 19647 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698