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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 17418003: Short-circuit embedded cons strings. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: update reloc target Created 7 years, 6 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/objects-visiting-inl.h » ('j') | src/objects-visiting-inl.h » ('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 3310 matching lines...) Expand 10 before | Expand all | Expand 10 after
3321 3321
3322 #undef DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR 3322 #undef DEFINE_NEW_H_SIMPLE_ARITHMETIC_INSTR
3323 3323
3324 3324
3325 HInstruction* HStringAdd::New( 3325 HInstruction* HStringAdd::New(
3326 Zone* zone, HValue* context, HValue* left, HValue* right) { 3326 Zone* zone, HValue* context, HValue* left, HValue* right) {
3327 if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) { 3327 if (FLAG_fold_constants && left->IsConstant() && right->IsConstant()) {
3328 HConstant* c_right = HConstant::cast(right); 3328 HConstant* c_right = HConstant::cast(right);
3329 HConstant* c_left = HConstant::cast(left); 3329 HConstant* c_left = HConstant::cast(left);
3330 if (c_left->HasStringValue() && c_right->HasStringValue()) { 3330 if (c_left->HasStringValue() && c_right->HasStringValue()) {
3331 Factory* factory = Isolate::Current()->factory(); 3331 Factory* factory = zone->isolate()->factory();
3332 return new(zone) HConstant(factory->NewConsString(c_left->StringValue(), 3332 return new(zone) HConstant(factory->NewConsString(c_left->StringValue(),
3333 c_right->StringValue()), 3333 c_right->StringValue()),
3334 Representation::Tagged()); 3334 Representation::Tagged());
3335 } 3335 }
3336 } 3336 }
3337 return new(zone) HStringAdd(context, left, right); 3337 return new(zone) HStringAdd(context, left, right);
3338 } 3338 }
3339 3339
3340 3340
3341 HInstruction* HStringCharFromCode::New( 3341 HInstruction* HStringCharFromCode::New(
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
3871 case kBackingStore: 3871 case kBackingStore:
3872 if (!name_.is_null()) stream->Add(*String::cast(*name_)->ToCString()); 3872 if (!name_.is_null()) stream->Add(*String::cast(*name_)->ToCString());
3873 stream->Add("[backing-store]"); 3873 stream->Add("[backing-store]");
3874 break; 3874 break;
3875 } 3875 }
3876 3876
3877 stream->Add("@%d", offset()); 3877 stream->Add("@%d", offset());
3878 } 3878 }
3879 3879
3880 } } // namespace v8::internal 3880 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects-visiting-inl.h » ('j') | src/objects-visiting-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698