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

Side by Side Diff: src/preparser.h

Issue 952303002: Remove NativeContext from Literal array, since we always create the literals in the native context … (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 5 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
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime-function.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 // 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 #ifndef V8_PREPARSER_H 5 #ifndef V8_PREPARSER_H
6 #define V8_PREPARSER_H 6 #define V8_PREPARSER_H
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 public: 205 public:
206 FunctionState(FunctionState** function_state_stack, Scope** scope_stack, 206 FunctionState(FunctionState** function_state_stack, Scope** scope_stack,
207 Scope* scope, FunctionKind kind, 207 Scope* scope, FunctionKind kind,
208 typename Traits::Type::Factory* factory); 208 typename Traits::Type::Factory* factory);
209 ~FunctionState(); 209 ~FunctionState();
210 210
211 int NextMaterializedLiteralIndex() { 211 int NextMaterializedLiteralIndex() {
212 return next_materialized_literal_index_++; 212 return next_materialized_literal_index_++;
213 } 213 }
214 int materialized_literal_count() { 214 int materialized_literal_count() {
215 return next_materialized_literal_index_ - JSFunction::kLiteralsPrefixSize; 215 return next_materialized_literal_index_;
216 } 216 }
217 217
218 int NextHandlerIndex() { return next_handler_index_++; } 218 int NextHandlerIndex() { return next_handler_index_++; }
219 int handler_count() { return next_handler_index_; } 219 int handler_count() { return next_handler_index_; }
220 220
221 void AddProperty() { expected_property_count_++; } 221 void AddProperty() { expected_property_count_++; }
222 int expected_property_count() { return expected_property_count_; } 222 int expected_property_count() { return expected_property_count_; }
223 223
224 bool is_generator() const { return IsGeneratorFunction(kind_); } 224 bool is_generator() const { return IsGeneratorFunction(kind_); }
225 225
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1657 Token::Value fvar_init_op, FunctionKind kind, bool* ok) { 1657 Token::Value fvar_init_op, FunctionKind kind, bool* ok) {
1658 return pre_parser_->ParseEagerFunctionBody(function_name, pos, fvar, 1658 return pre_parser_->ParseEagerFunctionBody(function_name, pos, fvar,
1659 fvar_init_op, kind, ok); 1659 fvar_init_op, kind, ok);
1660 } 1660 }
1661 1661
1662 1662
1663 template <class Traits> 1663 template <class Traits>
1664 ParserBase<Traits>::FunctionState::FunctionState( 1664 ParserBase<Traits>::FunctionState::FunctionState(
1665 FunctionState** function_state_stack, Scope** scope_stack, Scope* scope, 1665 FunctionState** function_state_stack, Scope** scope_stack, Scope* scope,
1666 FunctionKind kind, typename Traits::Type::Factory* factory) 1666 FunctionKind kind, typename Traits::Type::Factory* factory)
1667 : next_materialized_literal_index_(JSFunction::kLiteralsPrefixSize), 1667 : next_materialized_literal_index_(0),
1668 next_handler_index_(0), 1668 next_handler_index_(0),
1669 expected_property_count_(0), 1669 expected_property_count_(0),
1670 kind_(kind), 1670 kind_(kind),
1671 generator_object_variable_(NULL), 1671 generator_object_variable_(NULL),
1672 function_state_stack_(function_state_stack), 1672 function_state_stack_(function_state_stack),
1673 outer_function_state_(*function_state_stack), 1673 outer_function_state_(*function_state_stack),
1674 scope_stack_(scope_stack), 1674 scope_stack_(scope_stack),
1675 outer_scope_(*scope_stack), 1675 outer_scope_(*scope_stack),
1676 factory_(factory) { 1676 factory_(factory) {
1677 *scope_stack_ = scope; 1677 *scope_stack_ = scope;
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
3109 *ok = false; 3109 *ok = false;
3110 return; 3110 return;
3111 } 3111 }
3112 has_seen_constructor_ = true; 3112 has_seen_constructor_ = true;
3113 return; 3113 return;
3114 } 3114 }
3115 } 3115 }
3116 } } // v8::internal 3116 } } // v8::internal
3117 3117
3118 #endif // V8_PREPARSER_H 3118 #endif // V8_PREPARSER_H
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime-function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698