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

Side by Side Diff: src/ast.cc

Issue 181543002: Eliminate extended mode, and other modes clean-up (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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/ast.h ('k') | src/bootstrapper.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 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 int FunctionLiteral::start_position() const { 173 int FunctionLiteral::start_position() const {
174 return scope()->start_position(); 174 return scope()->start_position();
175 } 175 }
176 176
177 177
178 int FunctionLiteral::end_position() const { 178 int FunctionLiteral::end_position() const {
179 return scope()->end_position(); 179 return scope()->end_position();
180 } 180 }
181 181
182 182
183 LanguageMode FunctionLiteral::language_mode() const { 183 StrictMode FunctionLiteral::strict_mode() const {
184 return scope()->language_mode(); 184 return scope()->strict_mode();
185 } 185 }
186 186
187 187
188 void FunctionLiteral::InitializeSharedInfo( 188 void FunctionLiteral::InitializeSharedInfo(
189 Handle<Code> unoptimized_code) { 189 Handle<Code> unoptimized_code) {
190 for (RelocIterator it(*unoptimized_code); !it.done(); it.next()) { 190 for (RelocIterator it(*unoptimized_code); !it.done(); it.next()) {
191 RelocInfo* rinfo = it.rinfo(); 191 RelocInfo* rinfo = it.rinfo();
192 if (rinfo->rmode() != RelocInfo::EMBEDDED_OBJECT) continue; 192 if (rinfo->rmode() != RelocInfo::EMBEDDED_OBJECT) continue;
193 Object* obj = rinfo->target_object(); 193 Object* obj = rinfo->target_object();
194 if (obj->IsSharedFunctionInfo()) { 194 if (obj->IsSharedFunctionInfo()) {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 if (m_literal->depth() + 1 > depth_acc) { 372 if (m_literal->depth() + 1 > depth_acc) {
373 depth_acc = m_literal->depth() + 1; 373 depth_acc = m_literal->depth() + 1;
374 } 374 }
375 } 375 }
376 Handle<Object> boilerplate_value = GetBoilerplateValue(element, isolate); 376 Handle<Object> boilerplate_value = GetBoilerplateValue(element, isolate);
377 if (boilerplate_value->IsTheHole()) { 377 if (boilerplate_value->IsTheHole()) {
378 is_holey = true; 378 is_holey = true;
379 } else if (boilerplate_value->IsUninitialized()) { 379 } else if (boilerplate_value->IsUninitialized()) {
380 is_simple = false; 380 is_simple = false;
381 JSObject::SetOwnElement( 381 JSObject::SetOwnElement(
382 array, i, handle(Smi::FromInt(0), isolate), kSloppyMode); 382 array, i, handle(Smi::FromInt(0), isolate), SLOPPY);
383 } else { 383 } else {
384 JSObject::SetOwnElement(array, i, boilerplate_value, kSloppyMode); 384 JSObject::SetOwnElement(array, i, boilerplate_value, SLOPPY);
385 } 385 }
386 } 386 }
387 387
388 Handle<FixedArrayBase> element_values(array->elements()); 388 Handle<FixedArrayBase> element_values(array->elements());
389 389
390 // Simple and shallow arrays can be lazily copied, we transform the 390 // Simple and shallow arrays can be lazily copied, we transform the
391 // elements array to a copy-on-write array. 391 // elements array to a copy-on-write array.
392 if (is_simple && depth_acc == 1 && values()->length() > 0 && 392 if (is_simple && depth_acc == 1 && values()->length() > 0 &&
393 array->HasFastSmiOrObjectElements()) { 393 array->HasFastSmiOrObjectElements()) {
394 element_values->set_map(isolate->heap()->fixed_cow_array_map()); 394 element_values->set_map(isolate->heap()->fixed_cow_array_map());
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value()); 1173 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value());
1174 str = arr; 1174 str = arr;
1175 } else { 1175 } else {
1176 str = DoubleToCString(value_->Number(), buffer); 1176 str = DoubleToCString(value_->Number(), buffer);
1177 } 1177 }
1178 return isolate_->factory()->NewStringFromAscii(CStrVector(str)); 1178 return isolate_->factory()->NewStringFromAscii(CStrVector(str));
1179 } 1179 }
1180 1180
1181 1181
1182 } } // namespace v8::internal 1182 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698