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

Side by Side Diff: src/objects.cc

Issue 113393: Optimize the scope creation code by lazily allocating the hash maps... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 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/hashmap.cc ('k') | src/scopes.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 3415 matching lines...) Expand 10 before | Expand all | Expand 10 after
3426 } 3426 }
3427 3427
3428 3428
3429 const uc16* SeqTwoByteString::SeqTwoByteStringGetData(unsigned start) { 3429 const uc16* SeqTwoByteString::SeqTwoByteStringGetData(unsigned start) {
3430 return reinterpret_cast<uc16*>( 3430 return reinterpret_cast<uc16*>(
3431 reinterpret_cast<char*>(this) - kHeapObjectTag + kHeaderSize) + start; 3431 reinterpret_cast<char*>(this) - kHeapObjectTag + kHeaderSize) + start;
3432 } 3432 }
3433 3433
3434 3434
3435 void SeqTwoByteString::SeqTwoByteStringReadBlockIntoBuffer(ReadBlockBuffer* rbb, 3435 void SeqTwoByteString::SeqTwoByteStringReadBlockIntoBuffer(ReadBlockBuffer* rbb,
3436 unsigned* offset_ptr, 3436 unsigned* offset_ptr,
3437 unsigned max_chars) { 3437 unsigned max_chars) {
3438 unsigned chars_read = 0; 3438 unsigned chars_read = 0;
3439 unsigned offset = *offset_ptr; 3439 unsigned offset = *offset_ptr;
3440 while (chars_read < max_chars) { 3440 while (chars_read < max_chars) {
3441 uint16_t c = *reinterpret_cast<uint16_t*>( 3441 uint16_t c = *reinterpret_cast<uint16_t*>(
3442 reinterpret_cast<char*>(this) - 3442 reinterpret_cast<char*>(this) -
3443 kHeapObjectTag + kHeaderSize + offset * kShortSize); 3443 kHeapObjectTag + kHeaderSize + offset * kShortSize);
3444 if (c <= kMaxAsciiCharCode) { 3444 if (c <= kMaxAsciiCharCode) {
3445 // Fast case for ASCII characters. Cursor is an input output argument. 3445 // Fast case for ASCII characters. Cursor is an input output argument.
3446 if (!unibrow::CharacterStream::EncodeAsciiCharacter(c, 3446 if (!unibrow::CharacterStream::EncodeAsciiCharacter(c,
3447 rbb->util_buffer, 3447 rbb->util_buffer,
(...skipping 4020 matching lines...) Expand 10 before | Expand all | Expand 10 after
7468 // No break point. 7468 // No break point.
7469 if (break_point_objects()->IsUndefined()) return 0; 7469 if (break_point_objects()->IsUndefined()) return 0;
7470 // Single beak point. 7470 // Single beak point.
7471 if (!break_point_objects()->IsFixedArray()) return 1; 7471 if (!break_point_objects()->IsFixedArray()) return 1;
7472 // Multiple break points. 7472 // Multiple break points.
7473 return FixedArray::cast(break_point_objects())->length(); 7473 return FixedArray::cast(break_point_objects())->length();
7474 } 7474 }
7475 #endif 7475 #endif
7476 7476
7477 } } // namespace v8::internal 7477 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hashmap.cc ('k') | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698