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

Side by Side Diff: src/objects.cc

Issue 10969069: Fast path for symbol lookup in JSON.parse. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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
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 7367 matching lines...) Expand 10 before | Expand all | Expand 10 after
7378 7378
7379 void StringHasher::AddSurrogatePairNoIndex(uc32 c) { 7379 void StringHasher::AddSurrogatePairNoIndex(uc32 c) {
7380 uint16_t lead = unibrow::Utf16::LeadSurrogate(c); 7380 uint16_t lead = unibrow::Utf16::LeadSurrogate(c);
7381 AddCharacterNoIndex(lead); 7381 AddCharacterNoIndex(lead);
7382 uint16_t trail = unibrow::Utf16::TrailSurrogate(c); 7382 uint16_t trail = unibrow::Utf16::TrailSurrogate(c);
7383 AddCharacterNoIndex(trail); 7383 AddCharacterNoIndex(trail);
7384 } 7384 }
7385 7385
7386 7386
7387 uint32_t StringHasher::GetHashField() { 7387 uint32_t StringHasher::GetHashField() {
7388 ASSERT(is_valid());
7389 if (length_ <= String::kMaxHashCalcLength) { 7388 if (length_ <= String::kMaxHashCalcLength) {
7390 if (is_array_index()) { 7389 if (is_array_index()) {
7391 return MakeArrayIndexHash(array_index(), length_); 7390 return MakeArrayIndexHash(array_index(), length_);
7392 } 7391 }
7393 return (GetHash() << String::kHashShift) | String::kIsNotArrayIndexMask; 7392 return (GetHash() << String::kHashShift) | String::kIsNotArrayIndexMask;
7394 } else { 7393 } else {
7395 return (length_ << String::kHashShift) | String::kIsNotArrayIndexMask; 7394 return (length_ << String::kHashShift) | String::kIsNotArrayIndexMask;
7396 } 7395 }
7397 } 7396 }
7398 7397
(...skipping 6147 matching lines...) Expand 10 before | Expand all | Expand 10 after
13546 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13545 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13547 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13546 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13548 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13547 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13549 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13548 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13550 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13549 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13551 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13550 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13552 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13551 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13553 } 13552 }
13554 13553
13555 } } // namespace v8::internal 13554 } } // namespace v8::internal
OLDNEW
« src/objects.h ('K') | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698